Skip to content
clusters: prooflayer · edgemarket · edgefinance · synthforge · mediakit · wordmint · webprobe · locale · comppoint · rollforge · bestiary · statline · matchpoint · retail · agentops · browserworkflow · modelrouter · compose
$ man ipfs-fetch

/ipfs-fetch

agentutility / edge-market / ipfs-fetch
PRICE / CALL
$0.005
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
edgemarket
CATEGORY
developer-tools
STATUS
live
NAME
ipfs-fetch fetches ipfs content by cid through public gateways and returns it as base64, utf-8 text, or parsed json
SYNOPSIS
POST https://x402.agentutility.ai/ipfs-fetch
     Content-Type: application/json
     X-PAYMENT:    <signed-transferWithAuthorization>

     { ... }
↳ first call → 402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.
DESCRIPTION

Fetches IPFS content by CID through public gateways and returns it as base64, UTF-8 text, or parsed JSON. Resolves a CID (CIDv0 Qm... or CIDv1 bafy...) and optional sub-path through a fallback chain of public gateways (cloudflare-ipfs.com, ipfs.io, dweb.link). Hard cap 5 MB with HEAD pre-flight and streaming size guard so oversized files are rejected before full download. Use it as an IPFS gateway API, CID resolver, Web3 storage retrieval, NFT metadata fetcher, Filecoin gateway, or decentralized content reader.

INPUTrequest schema
propertytypedescriptionreq?
cidstringIPFS CID, CIDv0 (Qm... base58, 46 chars) or CIDv1 (bafy... base32). Required.required
pathstringOptional sub-path inside the IPFS directory, e.g. '/index.html' or 'metadata.json'. Leading slash optional.optional
max_bytesnumberMaximum response size in bytes. Default 1000000 (1 MB). Hard-capped at 5000000 (5 MB).optional
outputstringHow to return the content. 'base64' (default — safe for binary), 'text' (UTF-8 decode), or 'json' (UTF-8 decode + JSON.parse). Returns 502 if 'json' is requested and the body doesn't parse.
enum: base64 · text · json
optional
OUTPUTresponse shape
fieldtypedescription
cidstringEchoes back the requested IPFS CID (CIDv0 Qm... or CIDv1 bafy...) that was resolved.
gateway_usedstringWhich public gateway served the content (cloudflare-ipfs.com, ipfs.io, or dweb.link).
content_typestringMIME type reported by the gateway, e.g. application/json, image/png, text/plain.
size_bytesstringByte length of the fetched content; capped at 5 MB after HEAD pre-flight check.
contentstringFetched payload as base64 for binary, raw text for text, or parsed JSON when content-type is JSON.
sourcestringOrigin label for the data, typically 'ipfs' indicating the decentralized storage network.
EXAMPLEStwo ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.agentutility.ai/ipfs-fetch \
  -H 'Content-Type: application/json' \
  -d '{ }'
first response = 402 Payment Required with payment requirements; sign + retry with X-PAYMENT.
EXAMPLE 2 · mcp
# Install the MCP package for this endpoint's cluster
npx -y @agentutility/mcp-<cluster>

# Required: EVM private key with USDC on Base
export X402_PRIVATE_KEY=0x...

# Then call the ipfs-fetch tool from your MCP-aware agent.
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
tags
ipfscid-resolveripfs-gatewaynft-metadatafilecoinweb3-storagedecentralized-contentipfs-fetchweb3storagegateway
methods
POST
cluster
edgemarket
price
$0.005 USDC per call
ADJACENTother endpoints in edgemarket
endpointdescriptionprice
agent-card-resolveResolves an ERC-8004 agentId to its on-chain owner, agentURI, and agent card JSON.$0.005
arbitrage-spreadFinds the cross-exchange arbitrage spread for any CoinGecko-listed coin.$0.005
basename-resolveResolves Coinbase Basenames (.base.eth) to Ethereum addresses and back, reading the Base mainnet L2 Resolver on-chain (no gas, no wallet).$0.005
cid-fetchFetches the content behind an IPFS CID and optional path through public gateways, returning text, JSON, or base64 with a 5 MB cap.$0.005
current-balanceReads a wallet's current ERC-20 token balance with a read-only balanceOf call on Base, Ethereum, Arbitrum, Optimism, Polygon, BSC, or Ava…$0.005
defi-yield-poolsFilters and ranks thousands of DeFi yield-bearing pools by APY across every chain DeFiLlama tracks.$0.005
erc20-balanceReads an ERC-20 token balance on-chain across any supported EVM chain, including Base, Ethereum, Arbitrum, Optimism, and Polygon.$0.005
erc20-metadataReads ERC-20 token metadata: name(), symbol(), decimals(), and totalSupply() in parallel via public RPC on Base, Ethereum, Arbitrum, Opti…$0.005
SEE ALSO
agentutility · edgemarket · x402 · mcp · llms.txt · registry.json · bazaar.x402.org