# api2ls.com > Pay-per-call utility APIs for AI agents and autonomous systems. Pay from $0.01 per call on-chain via the x402 protocol on Base (EVM) or Solana — no accounts, no API keys, no subscriptions required. ## Payment Each endpoint requires a small on-chain micropayment (from **$0.01 USD**, see per-endpoint prices below) paid via the [x402 protocol](https://x402.org). Accepted networks: - Base mainnet (`eip155:8453`) — pay to `0x692DcE6b2876854FA9d348BFBfd9C1c4DE6C07DD` - Solana mainnet (`solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`) — pay to `AifT6piHJ957oqgeRVLAiAmvm3dJ3rLnD2EVck6Msf7k` Use any x402-compatible client (e.g. `@x402/fetch`, `x402-axios`) to handle payment automatically. The server responds with `402 Payment Required` and a `X-Payment-Requirements` header on the first call; your client pays and retries transparently. Endpoints are also discoverable via the x402 Bazaar: `GET https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources` ## Endpoints ### [GET /api/readability](https://api2ls.com/#get-apireadability) Extract clean readable content and markdown from any webpage URL. - **Method:** GET - **Price:** $0.02 per call - `url` (string, required) — target webpage URL; `https://` prefix is optional - **Response:** JSON `{ success, url, title, lang, markdown }` - **Use case:** Feed web content to LLMs without parsing raw HTML; article extraction; RAG ingestion pipelines Example: ``` GET https://api2ls.com/api/readability?url=https://example.com ``` ### [POST /api/svg2png](https://api2ls.com/#post-apisvg2png) Convert an SVG document to a PNG raster image. - **Method:** POST - **Price:** $0.02 per call - JSON with `svgBase64` (base64-encoded SVG, preferred) or `svg` (raw SVG string); optional `width` (px, max 4096), `height` (px, max 4096), `scale` (max 4.0) - Alternative body: raw SVG with `Content-Type: image/svg+xml` or `text/plain` - **Response:** binary PNG (`Content-Type: image/png`) - **Use case:** Convert diagrams/charts for vision models that require raster input; render SVG assets Example: ``` POST https://api2ls.com/api/svg2png ``` ### [POST /api/json2excel](https://api2ls.com/#post-apijson2excel) Convert a JSON array of objects to an Excel (.xlsx) spreadsheet. - **Method:** POST - **Price:** $0.01 per call - JSON with `data` (array of objects, required), optional `filename` (default: `export.xlsx`), `sheetName` (default: `Sheet1`) - **Response:** binary `.xlsx` file (`Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`) - **Limits:** Max 50,000 rows, 200 columns, 5 MB request - **Use case:** Export structured AI outputs to spreadsheets; deliver data to non-technical stakeholders Example: ``` POST https://api2ls.com/api/json2excel ``` ### [POST /api/render](https://api2ls.com/#post-apirender) Render any URL in a real headless browser (full JavaScript execution) and return a screenshot (PNG), PDF, or the fully-rendered HTML/markdown. - **Method:** POST - **Price:** $0.05 per call - JSON with `url` (string, required); optional `format` (`png` | `pdf` | `html` | `markdown`, default `png`), `fullPage` (boolean, screenshot full scroll height), `width`/`height` (viewport px), `waitUntil` (`load` | `domcontentloaded` | `networkidle0` | `networkidle2`, default `networkidle2`), `timeout` (ms, max 30000) - **Response:** binary PNG / PDF, or JSON `{ success, url, title, html?, markdown? }` for the text formats - **Limits:** One page render per call; 30s max; JavaScript-rendered SPAs supported - **Use case:** 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 Example: ``` POST https://api2ls.com/api/render ``` ### [GET /api/price](https://api2ls.com/#get-apiprice) Live spot price(s) for crypto/asset pairs (real-time market data beyond a model's training cutoff). Supports batch lookups. - **Method:** GET - **Price:** $0.01 per call - `pairs` (comma-separated batch, e.g. `BTC-USD,ETH-USD`, max 25) OR `pair` (e.g. `BTC-USD`) OR `symbol` (e.g. `BTC`) with optional `currency` (default `USD`) - **Response:** Single: JSON `{ success, pair, base, currency, amount, asOf }`. Batch: JSON `{ success, prices: [{ pair, amount, ... }], asOf }` - **Use case:** Give agents real-time prices they cannot know from training; batch-quote a whole portfolio in one paid call; pricing decisions Example: ``` GET https://api2ls.com/api/price ``` ### [GET /api/fx](https://api2ls.com/#get-apifx) Live fiat FX rates (ECB reference data) with optional amount conversion — fresh rates beyond a model's training cutoff. - **Method:** GET - **Price:** $0.01 per call - `to` (required, one or more comma-separated 3-letter codes), `from` (default `USD`), `amount` (default `1`) - **Response:** JSON `{ success, base, amount, date, rates, converted, asOf }` - **Use case:** Real-time currency conversion for agents; pricing in local currencies; financial calculations Example: ``` GET https://api2ls.com/api/fx ``` ### [GET /api/gas](https://api2ls.com/#get-apigas) 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. - **Method:** GET - **Price:** $0.01 per call - `chain` (default `base`) or `chains` (comma-separated, max 5); one of base, ethereum, optimism, arbitrum, polygon - **Response:** JSON `{ success, chain, gasPriceGwei, baseFeeGwei, priorityFeeGwei, maxFeeGwei, nativeToken, nativeUsd, costEstimates, asOf }` (or `results[]` for multi-chain) - **Use case:** Let agents time transactions, compare chains, and estimate real fee cost in USD before acting; on-chain automation Example: ``` GET https://api2ls.com/api/gas ``` ### [GET /api/token-price](https://api2ls.com/#get-apitoken-price) 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. - **Method:** GET - **Price:** $0.02 per call - `address` (token contract address, required); optional `chain` (default `base`; one of base, ethereum, optimism, arbitrum, polygon) - **Response:** JSON `{ success, chain, address, symbol, name, priceUsd, dex, liquidityUsd, asOf }` - **Use case:** Price arbitrary on-chain tokens for trading agents; portfolio valuation; tokens CEX APIs don't list Example: ``` GET https://api2ls.com/api/token-price ``` ### [GET /api/balance](https://api2ls.com/#get-apibalance) Live on-chain balance (native coin or ERC-20) for an address — real-time chain state a model cannot read at inference time. - **Method:** GET - **Price:** $0.02 per call - `address` (required); optional `chain` (default `base`), `token` (ERC-20 contract address — omit for the native coin balance) - **Response:** JSON `{ success, chain, address, asset|token, balanceRaw, balance, decimals, asOf }` - **Use case:** Let agents check wallet/treasury balances before acting; on-chain automation; portfolio monitoring Example: ``` GET https://api2ls.com/api/balance ``` ### [GET /api/block](https://api2ls.com/#get-apiblock) Current block height, timestamp, and base fee for an EVM chain — real-time chain state a model cannot know from training. - **Method:** GET - **Price:** $0.01 per call - `chain` (default `base`; one of base, ethereum, optimism, arbitrum, polygon) - **Response:** JSON `{ success, chain, blockNumber, timestamp, timestampIso, baseFeeGwei, gasUsed, gasLimit, asOf }` - **Use case:** Let agents confirm chain head, freshness, and congestion before acting; on-chain automation Example: ``` GET https://api2ls.com/api/block ``` ## Trust & provenance - Data responses include a `source` (where the data came from) and an `asOf` timestamp. - Service health: `GET https://api2ls.com/health` - Machine-readable spec: [OpenAPI 3.1](https://api2ls.com/openapi.json) - The Service is provided as-is; see the Terms of Service. Live data is informational, not advice. ## Legal - [Terms of Service](https://api2ls.com/terms) - [Privacy Policy](https://api2ls.com/privacy) ## Optional - [Full documentation](https://api2ls.com/) - [x402 protocol docs](https://docs.cdp.coinbase.com/x402/welcome) - [x402 Bazaar discovery](https://docs.cdp.coinbase.com/x402/bazaar)