{"uid":"cap_la2EEWctBB7G54o-Osrjv","slug":"ipfs-content-fetcher-via-cid-1cf5cd6e","name":"IPFS Content Fetcher via CID","description":"Retrieves IPFS content by CID and optional path through public gateways, returning base64, text, or parsed JSON with a 5 MB hard cap. Use it as an IPFS fetch API, CID resolver, or NFT metadata fetcher.","url":"https://x402.agentutility.ai/ipfs","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_-c60vPEHxdz-JtCaGgvYU","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":"Fetches content from IPFS by CID and optional path through public gateways, returning the content as base64, plain text, or parsed JSON (up to 5 MB).","exampleAgentPrompt":"Can you fetch the content at IPFS CID bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi and return it as parsed JSON?","exampleUseCases":[{"title":"NFT metadata resolution","prompt":"I have an NFT whose token URI points to IPFS CID QmPK1s3pNYLi9ERiq3BDxKa4XosgWwFRQUydHUtz4YgpqB — can you fetch that metadata and show me the name, description, and image fields?"},{"title":"Decentralized config file retrieval","prompt":"My app stores its config file on IPFS at CID bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq with path /config.json — please fetch it and return the parsed JSON."},{"title":"IPFS-hosted whitepaper fetch","prompt":"Fetch the text content stored at IPFS CID QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o so I can read the whitepaper."}],"resultDescription":"Returns the content of the specified IPFS CID (and optional sub-path) in one of three formats: base64-encoded binary, plain UTF-8 text, or a parsed JSON object. Content is capped at 5 MB. Includes any relevant content-type metadata from the gateway response.","failureModes":["CID not found or unpinned on available gateways — returns 404 or gateway error","Content exceeds 5 MB hard cap — request rejected or truncated","Invalid or malformed CID — returns parsing error","Gateway timeout if content is slow to retrieve from the IPFS network","Path not found within the CID's DAG — returns path resolution error","Non-UTF-8 content requested as text — encoding error"],"whenToPreferThis":"Use this endpoint when you need to resolve IPFS CIDs to their content programmatically from within an agent workflow — especially for NFT metadata, decentralized config files, or any Web3 resource whose URI starts with ipfs://. Prefer this over direct IPFS gateway calls when you need a reliable, agent-friendly API with consistent response formatting (base64/text/JSON) and a known 5 MB cap. It is settled via x402/USDC so it integrates naturally into autonomous agent payment flows without requiring API keys.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T07:11:43.945Z","isFirstParty":false}