Beatae error blanditiis libero
Everything a developer needs to integrate Polygon blockchain data into any application or data pipeline.
This documentation covers the complete Polygon Scan API — authentication, endpoint modules, request parameters, response schemas, pagination, error handling, and rate limits. All examples are provided in cURL, JavaScript (fetch), and Python (requests).
Authentication
All API calls require an API key appended as the apikey query parameter. Obtain your free key at polygonscanapi.com. Without a valid key, requests return a "Missing/Invalid API Key" error.
cURL example:
curl "https://api.polygonscan.com/api?module=account&action=balance&address=0x...&apikey=YOUR_KEY"
Request Format
All requests use the following query parameter structure:
module– The API module: account, contract, transaction, block, logs, token, stats, gastrackeraction– The specific action within the moduleapikey– Your API key- Additional parameters specific to each action (address, txhash, startblock, etc.)
Response Format
All responses are JSON objects with the following top-level structure:
status– "1" for success, "0" for errormessage– "OK" for success, or an error descriptionresult– The actual data payload (string, object, or array depending on action)
Pagination
Endpoints that return lists support pagination via:
page– Page number, starting from 1offset– Number of records per page (max 10,000)sort– "asc" or "desc" — sort by block number
Error Codes & Handling
Common error scenarios and their causes:
- HTTP 200 with status "0": Invalid parameters or no data found — check the message field
- HTTP 429: Rate limit exceeded — implement exponential back-off and retry
- HTTP 403: Invalid or missing API key — verify your key is appended correctly
JavaScript Code Example
const res = await fetch('https://api.polygonscan.com/api?module=account&action=balance&address=0x...&apikey=KEY'); const data = await res.json(); console.log(data.result);