IPFS: How to use IPFS CIDs and Fetch IPFS Links
Learn how to use IPFS CIDs and fetch IPFS Links using IPFS gateways.

Using IPFS CIDs and Fetching IPFS Links

Data stored on IPFS is referred to by its IPFS CID. The CID is a unique content identifier that can be used to retrieve the associated object stored on IPFS.
To use this IPFS CID to retrieve the stored object, you can use an IPFS gateway, or if the SDK or program you’re using supports Native IPFS URLs, you can retrieve the object that way as well.

Native IPFS URLs

Applications that natively support IPFS content addressing can refer to content stored on IPFS in the format:
ipfs://{CID}/{optional path to resource}
This format doesn’t work for applications or tools that rely on HTTP, such as Curl or Wget. For these tools, you need to use an IPFS gateway.

IPFS Gateways

Content stored on IPFS can be accessed by using an IPFS gateway. Gateways are used to provide workarounds for applications that don’t natively support IPFS. An IPFS gateway can be local, private, or public, and uses the IPFS content ID to provide a URL link to the content for access to the stored content.
Filebase's native IPFS gateway is as follows: https://ipfs.filebase.io/ipfs/{CID}
The Filebase Public IPFS Gateway has an effective rate limit of 200 RPM (requests per minute).
All content stored on IPFS through Filebase can be accessed through the Filebase gateway with faster response times than accessing the content through any other gateway. This is because the Filebase gateway peers with our IPFS nodes. The Filebase gateway also peers with the IPFS gateways of other pinning services.

IPFS Subdomain Gateways

The format of a subdomain gateway is as follows:
https://ipfs.io/ipfs/{CID}
Using a subdomain gateway as a drop-in replacement for a traditional gateway removes the need for there to be a CID version translation because there is a difference between opening an older CIDv0 resource and a CIDv1 resource. When a CIDv0 is accessed with a traditional gateway, the domain will return an HTTP 301 redirect to a subdomain, converting the CIDv0 CID to CIDv1 CID.
For example, opening a CIDv0 resource using a traditional gateway at:
https://dweb.link/ipfs/bafkreidgvpkjawlxz6sffxzwgooowe5yt7i6wsyg236mfoks77nywkptdq
returns a redirect to a CIDv1 representation at:
https://bafkreidgvpkjawlxz6sffxzwgooowe5yt7i6wsyg236mfoks77nywkptdq.ipfs.dweb.link/
By using a subdomain gateway initially, there is no need for the conversion step to take place.
If you have any questions, please join our Discord server, or send us an email at [email protected]