---
title: "Polygon API"
description: "Polygon PoS 密钥 Archive RPC，公开路径仅为受限试用"
url: "https://blockreq.com/docs/zh-cn/build/api-reference/polygon/"
---

# Polygon API

Polygon PoS 在带 API 密钥的私有端点上仍是 Archive 产品。公开试用路径 `/v1/rpc/public` 不承诺深层历史、debug 或 trace。

## Endpoint

| Item | Value |
| --- | --- |
| Network | Polygon PoS Mainnet |
| Protocol | EVM JSON-RPC 2.0 |
| Chain ID | `137` (`0x89`) |
| Public HTTPS | `https://polygon-bor-rpc.blockreq.com/v1/rpc/public` |
| Private HTTPS | `https://polygon-bor-rpc.blockreq.com/v1/rpc/BRQ1P0000000000000000000000000000000000000000000000000000000` |
| WSS | `wss://polygon-bor-rpc.blockreq.com/v1/rpc/BRQ1P0000000000000000000000000000000000000000000000000000000`，启用时可用 |

## 访问层级

| 访问 | 提供的能力 |
| --- | --- |
| 密钥 / 私有（`/v1/rpc/BRQ1P0000000000000000000000000000000000000000000000000000000`） | Archive：深层历史、`eth_getProof`，以及支持时的 debug/trace |
| 公开试用（`/v1/rpc/public`） | 受限试用。不承诺深层历史、debug 或 trace。过滤方法会被拒绝。历史窗口大约 1024 个区块，历史 `eth_getProof` 也受同一窗口约束。完整 Archive 请 [创建端点](https://blockreq.com/docs/zh-cn/getting-started/create-endpoint/index.md)。 |

## Core Methods

共享方法目录见 [EVM JSON-RPC 方法表](https://blockreq.com/docs/zh-cn/build/api-reference/evm-methods/index.md)。下表的 Archive、debug、trace 行描述的是密钥产品。

| Capability | Methods | Access |
| --- | --- | --- |
| Latest state | `eth_chainId`, `eth_blockNumber`, `eth_call`, `eth_getBalance` | 公开试用或密钥 |
| All history | 旧区块 `eth_call`, `eth_getCode`, `eth_getStorageAt`, `eth_getProof` | API 密钥 / 私有端点 |
| Logs 和 blocks | `eth_getLogs`, `eth_getBlockByNumber`, `eth_getBlockReceipts` | 公开试用受窗口限制；深层范围需密钥 Archive |
| Trace/debug | `debug_traceCall`, `debug_traceTransaction`, `trace_block`, `trace_filter`, `trace_transaction` | API 密钥 / 私有端点 |

公开试用示例：

```bash
curl -X POST https://polygon-bor-rpc.blockreq.com/v1/rpc/public \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
```

密钥 Archive 示例（`eth_getProof` 需要 API 密钥，不能在 `/v1/rpc/public` 上使用）：

```bash
curl -X POST https://polygon-bor-rpc.blockreq.com/v1/rpc/BRQ1P0000000000000000000000000000000000000000000000000000000 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getProof","params":["0x0000000000000000000000000000000000000000",[],"latest"],"id":1}'
```
