{"uid":"cap_pDFf-MWLJP5zZGeVnfLJz","slug":"ipfs-cid-fetch-api-39f54f91","name":"IPFS CID Fetch API","description":"Resolves an IPFS CID and optional path through public gateways, returning text, parsed JSON, or base64 with content type, size, and gateway provenance. 5 MB cap. Use it as a CID fetch API, IPFS gateway API, or Web3 storage fetch.","url":"https://x402.agentutility.ai/ipfs-api","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"required":["cid"],"properties":{"cid":{"type":"string","description":"IPFS CID, CIDv0 (Qm... base58, 46 chars) or CIDv1 (bafy... base32). Required."},"path":{"type":"string","description":"Optional sub-path inside the IPFS directory, e.g. '/index.html' or 'metadata.json'. Leading slash optional."},"output":{"enum":["base64","text","json"],"type":"string","description":"How to return the content. 'base64' (default — safe for binary), 'text' (UTF-8 decode), or 'json' (UTF-8 decode + JSON.parse). Returns 424 if every gateway fails or, for 'json', if the body doesn't parse."},"max_bytes":{"type":"number","description":"Maximum response size in bytes. Default 1000000 (1 MB). Hard-capped at 5000000 (5 MB)."}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"cid":{"type":"string"},"source":{"type":"string"},"content":{"type":"string"},"size_bytes":{"type":"integer"},"content_type":{"type":"string"},"gateway_used":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"cid":"bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi","source":"ipfs","content":"Hello World\n","size_bytes":12,"content_type":"text/plain","gateway_used":"https://cloudflare-ipfs.com"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_XZFnseDuG7Cq6sdwap6xy","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Resolves an IPFS CID (and optional path) through public gateways, returning the content as text, parsed JSON, or base64 with metadata including content type, size, and gateway provenance","exampleAgentPrompt":"Can you fetch the content at IPFS CID QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco and return it as parsed JSON?","exampleUseCases":[{"title":"NFT metadata retrieval from IPFS","prompt":"I have an NFT whose metadata is stored at IPFS CID bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi — can you fetch it and show me the name, description, and image fields?"},{"title":"Decentralized config file lookup","prompt":"My dApp stores its config on IPFS at CID QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o — fetch the file and tell me what the current version and feature flags are set to."},{"title":"IPFS-hosted document access","prompt":"Can you retrieve the whitepaper stored at IPFS CID QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG under the path /docs/whitepaper.txt and show me its full text content?"}],"resultDescription":"Returns the resolved content of the IPFS CID as text, parsed JSON object, or base64-encoded binary depending on the content type. Also includes metadata: the content type (MIME), file size in bytes (up to 5 MB), and the specific public IPFS gateway that served the response.","failureModes":["CID not found or unpinned on public gateways — returns gateway error or 404","Content exceeds 5 MB cap — returns size limit error","Invalid or malformed CID format — returns validation error","All public gateways timeout or are unreachable — returns gateway failure","Binary content requested without base64 mode — may return garbled output","Path not found within a directory CID — returns path resolution error"],"whenToPreferThis":"Use this endpoint when an agent needs to resolve IPFS content-addressed data by CID without running a local IPFS node. It is ideal for fetching NFT metadata, decentralized app configs, or any Web3-stored content. Prefer it over manual gateway requests when you need automatic fallback across multiple gateways, consistent output format (text/JSON/base64), and provenance metadata. Best suited for files under 5 MB.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T13:01:43.394Z","isFirstParty":false}