> ## Documentation Index
> Fetch the complete documentation index at: https://goldrush.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Polygon Onchain Data API

> Get token balances and transactions for Polygon. 28 endpoints supported.

## Overview

<Tip>
  Polygon PoS is the most battle-tested Ethereum scaling solution with 1.3B+ transactions, 130M wallets, and 2.7M monthly active users. The proven choice for production-grade applications.
</Tip>

GoldRush offers the most comprehensive Polygon Data API suite for developers, analysts, and enterprises. Whether you're
building a DeFi dashboard, a wallet, a trading bot, an AI agent or a compliance platform,
our Polygon Data APIs provide fast, accurate, and developer-friendly access to the essential onchain data you need.

### Supported APIs

<Columns cols={2}>
  <Card title="Foundational API" icon="https://mintcdn.com/goldrush/HCWRKGncxpy71D8p/images/icons/foundational.svg?fit=max&auto=format&n=HCWRKGncxpy71D8p&q=85&s=8a0b97060449218c1b477fe1fffc8a92" href="/docs/goldrush-foundational-api" cta="Read docs" width="24" height="24" data-path="images/icons/foundational.svg">
    Access structured historical blockchain data across 100+ chains using REST APIs.
    Get token balances, transaction histories, decoded event logs, NFT assets, token holders and more.<br /><br />
    <b>Use cases: Wallets, portfolio trackers, crypto accounting & tax tools, and DeFi dashboards.</b>
  </Card>

  <Card title="JSON-RPC" icon="server" href="/docs/goldrush-json-rpc/overview" cta="Read docs">
    Low-latency EVM JSON-RPC with global failover and archive depth.
    Point your existing tooling at the GoldRush endpoint — no code changes required.<br /><br />
    <b>Use cases: dApps, wallets, indexers, bots, and trading infrastructure.</b>
  </Card>
</Columns>

## Mainnet

| Property | Value |
| - | - |
| **Chain Name** | `matic-mainnet` |
| **Chain ID** | `137` |
| **Network Type** | Foundational Chain |
| **Support Level** | foundational |
| **Block Explorer** | [PolygonScan](https://polygonscan.com/) |
| **Official Website** | [Polygon Website](https://polygon.technology/) |
| **Native Gas Token** | MATIC |

## API Usage

To use this blockchain network in GoldRush API calls, use:

#### Chain Name

* `matic-mainnet` (mainnet)

#### Example API Calls

<CodeGroup>
  ```bash Chain Name (Mainnet) theme={null}
  curl -X GET "https://api.covalenthq.com/v1/matic-mainnet/address/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/balances_v2/?key=<GOLDRUSH_API_KEY>"
  ```
</CodeGroup>

#### SDK Usage

<CodeGroup>
  ```typescript TypeScript SDK (Mainnet) theme={null}
  import { GoldRushClient } from "@covalenthq/client-sdk";

  const client = new GoldRushClient("<GOLDRUSH_API_KEY>");
  const resp = await client.BalanceService.getTokenBalancesForWalletAddress({
      chainName: "matic-mainnet",
      walletAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
  });
  ```
</CodeGroup>

## Foundational API Support

This chain supports **28**  GoldRush Foundational APIs:

#### Wallet API

* **[Token Holders API on Polygon](/docs/api-reference/foundational-api/balances/get-token-holders-as-of-any-block-height-v2/)**
* **[Historical Token Balance API on Polygon](/docs/api-reference/foundational-api/balances/get-historical-token-balances-for-address/)**
* **[ERC-20 Token Balance API on Polygon](/docs/api-reference/foundational-api/balances/get-token-balances-for-address/)**
* **[Native Token Balance API on Polygon](/docs/api-reference/foundational-api/balances/get-native-token-balance/)**
* **[Historical Portfolio Value API on Polygon](/docs/api-reference/foundational-api/balances/get-historical-portfolio-value-over-time/)**
* **[ERC-20 Token Transfers API on Polygon](/docs/api-reference/foundational-api/balances/get-erc20-token-transfers-for-address/)**

#### NFT API

* **[NFT Wallet API on Polygon](/docs/api-reference/foundational-api/nft/get-nfts-for-address/)**
* **[NFT Ownership Check API on Polygon](/docs/api-reference/foundational-api/nft/check-ownership-in-nft-collection/)**
* **[NFT Token Ownership API on Polygon](/docs/api-reference/foundational-api/nft/check-ownership-in-nft-collection-token/)**

#### Pricing API

* **[DEX Pool Spot Price API on Polygon](/docs/api-reference/foundational-api/utility/get-pool-spot-prices/)**
* **[Historical Token Price API on Polygon](/docs/api-reference/foundational-api/utility/get-historical-token-prices/)**

#### Security API

* **[Token Approvals API on Polygon](/docs/api-reference/foundational-api/security/get-token-approvals-for-address/)**

#### Transactions API

* **[Transaction API on Polygon](/docs/api-reference/foundational-api/transactions/get-a-transaction/)** `with-input-data` `with-internal`
* **[Wallet Transaction Summary API on Polygon](/docs/api-reference/foundational-api/transactions/get-transaction-summary-for-address/)**
* **[Earliest Wallet Transactions API on Polygon](/docs/api-reference/foundational-api/transactions/get-earliest-transactions-for-address-v3/)** `with-input-data` `with-internal`
* **[Wallet Transaction History API on Polygon](/docs/api-reference/foundational-api/transactions/get-recent-transactions-for-address-v3/)** `with-input-data` `with-internal`
* **[Paginated Wallet Transactions API on Polygon](/docs/api-reference/foundational-api/transactions/get-paginated-transactions-for-address-v3/)** `with-input-data` `with-internal`
* **[Time Bucket Transactions API on Polygon](/docs/api-reference/foundational-api/transactions/get-time-bucket-transactions-for-address-v3/)**
* **[Block Transactions API on Polygon](/docs/api-reference/foundational-api/transactions/get-all-transactions-in-a-block/)**
* **[Block Transactions API by Page on Polygon](/docs/api-reference/foundational-api/transactions/get-all-transactions-in-a-block-by-page/)**

#### Block Explorer API

* **[Block API on Polygon](/docs/api-reference/foundational-api/utility/get-a-block/)**
* **[Block Heights API on Polygon](/docs/api-reference/foundational-api/utility/get-block-heights/)**
* **[Chain Status API on Polygon](/docs/api-reference/foundational-api/utility/get-all-chain-statuses/)**
* **[Contract Event Logs API on Polygon](/docs/api-reference/foundational-api/utility/get-log-events-by-contract-address/)**
* **[Event Logs API on Polygon](/docs/api-reference/foundational-api/utility/get-logs/)**
* **[Event Logs by Topic Hash API on Polygon](/docs/api-reference/foundational-api/utility/get-log-events-by-topic-hash/)**
* **[Gas Price API on Polygon](/docs/api-reference/foundational-api/utility/get-gas-prices/)**
* **[Supported Chains API on Polygon](/docs/api-reference/foundational-api/utility/get-all-chains/)**

## Internal Transactions (`with-internal`)

Polygon supports **internal transactions** (traces). The Transactions API endpoints marked `with-input-data` `with-internal` above accept the `with-internal=true` query parameter, which includes internal transactions (the value transfers triggered by contract execution that are not recorded as standalone onchain transactions) in the response.

<Info>
  Internal transactions are included in the response by passing `with-internal` and cost `0.05` credits/item.
</Info>

#### Example API Call

```bash Recent transactions with internal transactions theme={null}
curl -X GET "https://api.covalenthq.com/v1/matic-mainnet/address/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/transactions_v3/?with-internal=true&key=<GOLDRUSH_API_KEY>"
```

## JSON-RPC

Polygon is available on the GoldRush JSON-RPC service. Point your existing EVM tooling (ethers.js, viem, web3.js, or raw HTTP) at the GoldRush endpoint — the standard `eth_*`, `net_*`, `web3_*`, `debug_*`, and `trace_*` methods are supported.

#### Endpoint

```
https://rpc.goldrushdata.com/v1/matic-mainnet
```

#### Example JSON-RPC Calls

<CodeGroup>
  ```bash eth_blockNumber theme={null}
  curl https://rpc.goldrushdata.com/v1/matic-mainnet \
    -H "Authorization: Bearer <GOLDRUSH_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
  ```

  ```bash eth_getBalance theme={null}
  curl https://rpc.goldrushdata.com/v1/matic-mainnet \
    -H "Authorization: Bearer <GOLDRUSH_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","latest"]}'
  ```
</CodeGroup>

#### Sample Methods

* **[eth\_blockNumber on Polygon](/docs/api-reference/json-rpc/polygon/eth-blocknumber)**
* **[eth\_getBalance on Polygon](/docs/api-reference/json-rpc/polygon/eth-getbalance)**
* **[eth\_call on Polygon](/docs/api-reference/json-rpc/polygon/eth-call)**
* **[eth\_getLogs on Polygon](/docs/api-reference/json-rpc/polygon/eth-getlogs)**
* **[eth\_getTransactionReceipt on Polygon](/docs/api-reference/json-rpc/polygon/eth-gettransactionreceipt)**

See the [full method list and per-method examples for Polygon](/docs/api-reference/json-rpc/chains/polygon).

## Additional Resources

* [GoldRush API Documentation](https://goldrush.dev/docs/)
* [Supported Chains List](https://goldrush.dev/chains/)
* [API Reference](https://goldrush.dev/docs/api-reference/)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.