{"openapi":"3.1.0","info":{"title":"api2ls.com — Pay-Per-Call APIs for AI Agents","description":"Utility and live-data APIs for autonomous agents. Each call requires a small on-chain micropayment via the x402 protocol (Base/EVM or Solana) — no accounts, no API keys, no subscriptions. Data responses include a `source` and `asOf` for provenance. Provided as-is; see the Terms of Service.","version":"1.0.0","termsOfService":"https://api2ls.com/terms","license":{"name":"Service Terms","url":"https://api2ls.com/terms"},"contact":{"url":"https://api2ls.com/"}},"servers":[{"url":"https://api2ls.com"}],"paths":{"/api/readability":{"get":{"operationId":"getApiReadability","summary":"Extract clean readable content and markdown from any webpage URL.","description":"Feed web content to LLMs without parsing raw HTML; article extraction; RAG ingestion pipelines","tags":["api"],"x-price":"$0.02","x-payment":"x402","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"url":{"type":"string"},"title":{"type":"string"},"lang":{"type":"string"},"markdown":{"type":"string"}},"required":["success","url","title","lang","markdown"]},"example":{"success":true,"url":"https://example.com","title":"Example Domain","lang":"en","markdown":"# Example Domain\n\nExample content in markdown format..."}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required — pay the quoted amount via the x402 protocol and retry. The required amount, networks, and pay-to addresses are returned in the response (see the X-Payment-Requirements header).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"name":"url","in":"query","required":true,"description":"The webpage URL to extract readable content from (https:// prefix optional)","schema":{"type":"string"}}]}},"/api/svg2png":{"post":{"operationId":"postApiSvg2png","summary":"Convert an SVG document to a PNG raster image.","description":"Convert diagrams/charts for vision models that require raster input; render SVG assets","tags":["api"],"x-price":"$0.02","x-payment":"x402","responses":{"200":{"description":"Successful response","content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required — pay the quoted amount via the x402 protocol and retry. The required amount, networks, and pay-to addresses are returned in the response (see the X-Payment-Requirements header).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"svgBase64":{"type":"string","description":"Base64-encoded SVG document (preferred over raw svg field)"},"svg":{"type":"string","description":"Raw SVG string (use svgBase64 to avoid JSON escaping issues)"},"width":{"type":"number","description":"Output width in pixels (max 4096)"},"height":{"type":"number","description":"Output height in pixels (max 4096)"},"scale":{"type":"number","description":"Scale factor / zoom (max 4.0)"}}},"example":{"svgBase64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgZmlsbD0iYmx1ZSIvPjwvc3ZnPg==","width":1024}}}}}},"/api/json2excel":{"post":{"operationId":"postApiJson2excel","summary":"Convert a JSON array of objects to an Excel (.xlsx) spreadsheet.","description":"Export structured AI outputs to spreadsheets; deliver data to non-technical stakeholders\n\nMax 50,000 rows, 200 columns, 5 MB request","tags":["api"],"x-price":"$0.01","x-payment":"x402","responses":{"200":{"description":"Successful response","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required — pay the quoted amount via the x402 protocol and retry. The required amount, networks, and pay-to addresses are returned in the response (see the X-Payment-Requirements header).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Array of objects to convert (or a single object). All objects share the same column headers."},"filename":{"type":"string","description":"Output filename (default: export.xlsx)"},"sheetName":{"type":"string","description":"Worksheet name (default: Sheet1)"}},"required":["data"]},"example":{"data":[{"name":"Alice","age":30,"city":"New York"},{"name":"Bob","age":25,"city":"London"}],"filename":"export.xlsx","sheetName":"Sheet1"}}}}}},"/api/render":{"post":{"operationId":"postApiRender","summary":"Render any URL in a real headless browser (full JavaScript execution) and return a screenshot (PNG), PDF, or the fully-rendered HTML/markdown.","description":"Capture JS-heavy pages that a model cannot execute itself; screenshot for vision models; archive a page as PDF; extract content from client-side-rendered sites that static fetch (readability) cannot see\n\nOne page render per call; 30s max; JavaScript-rendered SPAs supported","tags":["api"],"x-price":"$0.05","x-payment":"x402","responses":{"200":{"description":"Successful response","content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required — pay the quoted amount via the x402 protocol and retry. The required amount, networks, and pay-to addresses are returned in the response (see the X-Payment-Requirements header).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The URL to render in a headless browser (https:// prefix optional)"},"format":{"type":"string","description":"Output format: png (default), pdf, html, or markdown"},"fullPage":{"type":"boolean","description":"For png: capture the full scroll height instead of just the viewport"},"width":{"type":"number","description":"Viewport width in pixels (default 1280, max 3840)"},"height":{"type":"number","description":"Viewport height in pixels (default 800, max 3840)"},"waitUntil":{"type":"string","description":"Navigation wait condition: load, domcontentloaded, networkidle0, or networkidle2 (default)"},"timeout":{"type":"number","description":"Navigation timeout in milliseconds (max 30000)"}},"required":["url"]},"example":{"url":"https://example.com","format":"png","fullPage":true}}}}}},"/api/price":{"get":{"operationId":"getApiPrice","summary":"Live spot price(s) for crypto/asset pairs (real-time market data beyond a model's training cutoff). Supports batch lookups.","description":"Give agents real-time prices they cannot know from training; batch-quote a whole portfolio in one paid call; pricing decisions","tags":["api"],"x-price":"$0.01","x-payment":"x402","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"pair":{"type":"string"},"base":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string"},"asOf":{"type":"string"}},"required":["success","pair","amount"]},"example":{"success":true,"pair":"BTC-USD","base":"BTC","currency":"USD","amount":"64235.18","asOf":"2026-06-17T09:30:00.000Z"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required — pay the quoted amount via the x402 protocol and retry. The required amount, networks, and pay-to addresses are returned in the response (see the X-Payment-Requirements header).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"name":"pairs","in":"query","required":false,"description":"Comma-separated batch of pairs, e.g. BTC-USD,ETH-USD (max 25; returns all in one call)","schema":{"type":"string"}},{"name":"pair","in":"query","required":false,"description":"Single asset pair, e.g. BTC-USD","schema":{"type":"string"}},{"name":"symbol","in":"query","required":false,"description":"Asset symbol, e.g. ETH (used with currency)","schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"description":"Quote currency, e.g. USD (default USD)","schema":{"type":"string"}}]}},"/api/fx":{"get":{"operationId":"getApiFx","summary":"Live fiat FX rates (ECB reference data) with optional amount conversion — fresh rates beyond a model's training cutoff.","description":"Real-time currency conversion for agents; pricing in local currencies; financial calculations","tags":["api"],"x-price":"$0.01","x-payment":"x402","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"base":{"type":"string"},"amount":{"type":"number"},"date":{"type":"string"},"rates":{"type":"object"},"converted":{"type":"object"},"asOf":{"type":"string"}},"required":["success","base","rates"]},"example":{"success":true,"base":"USD","amount":100,"date":"2026-06-16","rates":{"EUR":0.92},"converted":{"EUR":92},"asOf":"2026-06-17T09:30:00.000Z"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required — pay the quoted amount via the x402 protocol and retry. The required amount, networks, and pay-to addresses are returned in the response (see the X-Payment-Requirements header).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"name":"to","in":"query","required":true,"description":"Target currency code(s), comma-separated, e.g. EUR,GBP","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"Base currency code (default USD)","schema":{"type":"string"}},{"name":"amount","in":"query","required":false,"description":"Amount to convert (default 1)","schema":{"type":"number"}}]}},"/api/gas":{"get":{"operationId":"getApiGas","summary":"Live EVM gas pricing — EIP-1559 breakdown (base/priority/max fee) plus estimated USD cost for transfers and swaps, across multiple chains in one call.","description":"Let agents time transactions, compare chains, and estimate real fee cost in USD before acting; on-chain automation","tags":["api"],"x-price":"$0.01","x-payment":"x402","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"chain":{"type":"string"},"gasPriceGwei":{"type":"number"},"baseFeeGwei":{"type":"number"},"priorityFeeGwei":{"type":"number"},"maxFeeGwei":{"type":"number"},"nativeToken":{"type":"string"},"nativeUsd":{"type":"number"},"costEstimates":{"type":"object"},"asOf":{"type":"string"}},"required":["success","chain","gasPriceGwei"]},"example":{"success":true,"chain":"base","nativeToken":"ETH","nativeUsd":3500,"gasPriceGwei":1.5,"baseFeeGwei":1.2,"priorityFeeGwei":0.3,"maxFeeGwei":2.7,"costEstimates":{"transfer":{"gasUnits":21000,"nativeAmount":"0.0000315","usd":0.1103}},"asOf":"2026-06-17T09:30:00.000Z"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required — pay the quoted amount via the x402 protocol and retry. The required amount, networks, and pay-to addresses are returned in the response (see the X-Payment-Requirements header).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"name":"chain","in":"query","required":false,"description":"EVM network: base (default), ethereum, optimism, arbitrum, or polygon","schema":{"type":"string"}},{"name":"chains","in":"query","required":false,"description":"Comma-separated list of chains (max 5) to compare in one call","schema":{"type":"string"}}]}},"/api/token-price":{"get":{"operationId":"getApiTokenPrice","summary":"Live USD price of any ERC-20 token from on-chain DEX liquidity — covers Base/EVM tokens not listed on centralized exchanges, which a model cannot know.","description":"Price arbitrary on-chain tokens for trading agents; portfolio valuation; tokens CEX APIs don't list","tags":["api"],"x-price":"$0.02","x-payment":"x402","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"chain":{"type":"string"},"address":{"type":"string"},"symbol":{"type":"string"},"priceUsd":{"type":"string"},"liquidityUsd":{"type":"number"},"asOf":{"type":"string"}},"required":["success","priceUsd"]},"example":{"success":true,"chain":"base","address":"0x4200000000000000000000000000000000000006","symbol":"WETH","name":"Wrapped Ether","priceUsd":"3502.11","dex":"uniswap","liquidityUsd":1820000,"asOf":"2026-06-17T09:30:00.000Z"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required — pay the quoted amount via the x402 protocol and retry. The required amount, networks, and pay-to addresses are returned in the response (see the X-Payment-Requirements header).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"name":"address","in":"query","required":true,"description":"ERC-20 token contract address (0x…)","schema":{"type":"string"}},{"name":"chain","in":"query","required":false,"description":"EVM network: base (default), ethereum, optimism, arbitrum, or polygon","schema":{"type":"string"}}]}},"/api/balance":{"get":{"operationId":"getApiBalance","summary":"Live on-chain balance (native coin or ERC-20) for an address — real-time chain state a model cannot read at inference time.","description":"Let agents check wallet/treasury balances before acting; on-chain automation; portfolio monitoring","tags":["api"],"x-price":"$0.02","x-payment":"x402","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"chain":{"type":"string"},"address":{"type":"string"},"balanceRaw":{"type":"string"},"balance":{"type":"string"},"decimals":{"type":"number"},"asOf":{"type":"string"}},"required":["success","balance"]},"example":{"success":true,"chain":"base","address":"0x0000000000000000000000000000000000000000","asset":"ETH","balanceRaw":"1500000000000000000","balance":"1.5","decimals":18,"asOf":"2026-06-17T09:30:00.000Z"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required — pay the quoted amount via the x402 protocol and retry. The required amount, networks, and pay-to addresses are returned in the response (see the X-Payment-Requirements header).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"name":"address","in":"query","required":true,"description":"Account address to check (0x…)","schema":{"type":"string"}},{"name":"chain","in":"query","required":false,"description":"EVM network: base (default), ethereum, optimism, arbitrum, or polygon","schema":{"type":"string"}},{"name":"token","in":"query","required":false,"description":"Optional ERC-20 contract address; omit for the native coin balance","schema":{"type":"string"}}]}},"/api/block":{"get":{"operationId":"getApiBlock","summary":"Current block height, timestamp, and base fee for an EVM chain — real-time chain state a model cannot know from training.","description":"Let agents confirm chain head, freshness, and congestion before acting; on-chain automation","tags":["api"],"x-price":"$0.01","x-payment":"x402","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"chain":{"type":"string"},"blockNumber":{"type":"number"},"baseFeeGwei":{"type":"number"},"asOf":{"type":"string"}},"required":["success","blockNumber"]},"example":{"success":true,"chain":"base","blockNumber":18250431,"timestamp":1781000000,"timestampIso":"2026-06-17T09:30:00.000Z","baseFeeGwei":1.2,"gasUsed":12000000,"gasLimit":30000000,"asOf":"2026-06-17T09:30:00.000Z"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required — pay the quoted amount via the x402 protocol and retry. The required amount, networks, and pay-to addresses are returned in the response (see the X-Payment-Requirements header).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"name":"chain","in":"query","required":false,"description":"EVM network: base (default), ethereum, optimism, arbitrum, or polygon","schema":{"type":"string"}}]}}},"externalDocs":{"description":"Documentation","url":"https://api2ls.com/"}}