{"openapi":"3.1.0","info":{"title":"ChainList API","version":"2.0.0","description":"Free, open-source REST API for blockchain chain information. Access data for 2,400+ EVM networks including chain IDs, RPC endpoints, native currencies, icons, and TVL. No API keys required.","contact":{"name":"B3","url":"https://b3.fun"},"license":{"name":"MIT","url":"https://github.com/b3-fun/chain-api/blob/main/LICENSE"}},"servers":[{"url":"https://chainlistapi.com","description":"Production"}],"paths":{"/chains/{chainId}":{"get":{"operationId":"getChainById","summary":"Get chain by ID","description":"Retrieve detailed information about a specific blockchain by its chain ID. Returns name, RPC endpoints, native currency, block explorers, icon URL, TVL, and more.","parameters":[{"name":"chainId","in":"path","required":true,"schema":{"type":"integer"},"description":"The chain ID (e.g., 1 for Ethereum, 137 for Polygon, 8453 for Base)","examples":{"ethereum":{"value":1,"summary":"Ethereum Mainnet"},"base":{"value":8453,"summary":"Base"},"polygon":{"value":137,"summary":"Polygon"}}}],"responses":{"200":{"description":"Chain data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chain"}}}},"404":{"description":"Chain not found"}}}},"/chains/search":{"get":{"operationId":"searchChains","summary":"Search chains","description":"Search chains by name, symbol, short name, or chain ID string match.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"},"description":"Search query (e.g., 'polygon', 'eth', '137')"},{"name":"page","in":"query","schema":{"type":"integer","default":1},"description":"Page number"},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":100},"description":"Results per page"}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Chain"}},"total":{"type":"integer"},"page":{"type":"integer"},"perPage":{"type":"integer"}}}}}}}}},"/chains/all":{"get":{"operationId":"listAllChains","summary":"List all chains","description":"Get a paginated list of all chains sorted by TVL descending. Filter by testnet status or dead status.","parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1},"description":"Page number"},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":100},"description":"Results per page"},{"name":"testnet","in":"query","schema":{"type":"boolean"},"description":"Filter by testnet (true) or mainnet (false)"},{"name":"isDead","in":"query","schema":{"type":"boolean"},"description":"Filter by dead chains"}],"responses":{"200":{"description":"Paginated chain list","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Chain"}},"total":{"type":"integer"},"page":{"type":"integer"},"perPage":{"type":"integer"}}}}}}}}},"/icons/{name}":{"get":{"operationId":"getChainIcon","summary":"Get chain icon","description":"Get a chain icon by filename. 1,800+ icons available in SVG and PNG. The icon name is in the 'icon' field of chain responses.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"Icon filename (e.g., ethereum.svg, polygon.svg, base.png)"}],"responses":{"200":{"description":"Icon image file","content":{"image/*":{}}},"404":{"description":"Icon not found"}}}},"/stats":{"get":{"operationId":"getApiStats","summary":"Get API statistics","description":"Get aggregate statistics including total chain count, mainnet/testnet split, icon coverage, and top 10 chains by TVL.","responses":{"200":{"description":"API statistics","content":{"application/json":{"schema":{"type":"object","properties":{"chains":{"type":"object","properties":{"total":{"type":"integer"},"mainnets":{"type":"integer"},"testnets":{"type":"integer"},"withIcons":{"type":"integer"},"dead":{"type":"integer"},"alive":{"type":"integer"}}},"topChainsByTVL":{"type":"array","items":{"type":"object","properties":{"chainId":{"type":"integer"},"name":{"type":"string"},"tvl":{"type":"number"}}}},"lastUpdated":{"type":"string","format":"date-time"}}}}}}}}}},"components":{"schemas":{"Chain":{"type":"object","properties":{"chainId":{"type":"integer","description":"Unique chain identifier"},"name":{"type":"string","description":"Full chain name"},"chain":{"type":"string","nullable":true,"description":"Short chain identifier"},"shortName":{"type":"string","nullable":true,"description":"Abbreviated name"},"networkId":{"type":"integer","nullable":true,"description":"Network ID"},"nativeCurrency":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"symbol":{"type":"string"},"decimals":{"type":"integer"}},"description":"Native token information"},"rpc":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"object","properties":{"url":{"type":"string"}}}]},"description":"RPC endpoint URLs"},"features":{"type":"array","items":{"type":"object"},"description":"Supported features"},"faucets":{"type":"array","items":{"type":"string"},"description":"Faucet URLs"},"infoURL":{"type":"string","nullable":true,"description":"Official website"},"icon":{"type":"string","nullable":true,"description":"Icon name for /icons/ endpoint"},"iconUrl":{"type":"string","nullable":true,"description":"Direct URL to chain icon"},"explorers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"standard":{"type":"string"}}},"description":"Block explorers"},"isTestnet":{"type":"boolean","description":"Whether chain is a testnet"},"isDead":{"type":"boolean","description":"Whether chain is inactive"},"tvl":{"type":"number","nullable":true,"description":"Total Value Locked in USD"},"parent":{"type":"object","nullable":true,"description":"Parent chain info for L2s"}}}}}}