{"uid":"cap_63mvI87mLWLxEfefGCjtu","slug":"brainiac-contract-code-lookup-5ecf3717","name":"BRAINIAC Contract Code Lookup","description":"Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.","url":"https://www.brainiac.software/api/v1/chain-data/contract/code?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"address":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"blockNumber":{"type":"integer","maximum":9007199254740991,"minimum":0}}},"responseSchema":{"type":"json","example":{"code":"0x","source":{"url":"https://mainnet.base.org","status":"OK"},"address":"0x1234567890123456789012345678901234567890","chainId":8453,"retrievedAt":"2026-11-07T12:08:59.240Z"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_I_bEyYTDloP1NHC8BJm8p","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Retrieves the deployed bytecode (and potentially source/ABI) of a smart contract at a given address, optionally at a specific block number","exampleAgentPrompt":"Can you fetch the deployed contract code for the address 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on-chain — just grab whatever bytecode is currently deployed there?","exampleUseCases":[{"title":"Audit contract bytecode before interaction","prompt":"Before my agent interacts with the contract at 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984, can you pull the deployed bytecode so I can verify it hasn't been swapped or tampered with?"},{"title":"Historical contract state at past block","prompt":"Fetch the contract code that was deployed at address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 at block number 15000000 — I want to see what code was live at that point in history."},{"title":"Check if address is a contract or EOA","prompt":"Can you check if there's any code deployed at 0xdAC17F958D2ee523a2206206994597C13D831ec7? I need to know whether it's a smart contract or just a regular wallet address."}],"resultDescription":"A JSON response containing the contract bytecode (and potentially ABI or source metadata) deployed at the specified address, optionally scoped to a historical block number. If no code is deployed at the address, the result will likely indicate an empty code field.","failureModes":["Invalid address format (not a valid 0x hex address) causes request rejection","Block number out of range or future block returns an error","Address with no deployed contract returns empty bytecode","Network or RPC errors may cause intermittent failures","Payment failure via x402 prevents the call from completing"],"whenToPreferThis":"Use this endpoint when you need raw on-chain contract bytecode or code existence checks for a specific EVM address, especially with historical block pinning. Prefer this over block explorer scraping when you need programmatic, pay-per-call access with no account setup, and when operating in an agent context using x402 micropayments on Base.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-17T00:36:48.403Z","isFirstParty":false,"canonicalSlug":"brainiac-contract-code-lookup-5ecf3717"}