Polygon chain ID, RPC URL and network config
Last updated:
Polygon network identifiers
| Identifier | Value | Source |
|---|---|---|
| Chain ID | 137 (0x89)eth_chainId returns the hex form. | Polygon docs: RPC endpoints |
| Network ID | 137Returned by net_version (checked on a public mainnet endpoint listed in Polygon's docs, 23.09.2026). | ethereum.org JSON-RPC API (net_version) |
| CAIP-2 ID | eip155:137The chain identifier multichain wallets and WalletConnect use. | CAIP-2 eip155 namespace |
| Currency symbol | POL | Triport chain registry |
The chain ID is signed into every transaction (EIP-155); the network ID is what net_version reports. They are separate values that happen to match on most chains — see chain ID vs network ID and the chain ID glossary entry.
Polygon RPC URLs
| Triport RPC URL (header auth) | https://triport.io/polygon |
|---|---|
| Triport RPC URL (keyed) | https://triport.io/r/<API_KEY>/polygon |
| Triport WebSocket URL (keyed) | wss://triport.io/ws/poly/<API_KEY> |
| Required scope | polygon:rpc |
| Network-run public RPC | Polygon's documentation lists public RPC endpoints run by third-party providers only, and notes they may have rate limits or traffic restrictions. Polygon docs: RPC endpoints |
Public-endpoint limits are as each operator publishes them, checked 23 September 2026.
Plans and per-category rate limits: pricing. Network overview: Polygon RPC; method reference: Polygon documentation.
Add Polygon to MetaMask, viem, Hardhat or Foundry
wallet_addEthereumChain (EIP-3085) requires only chainId, as a hex string — 0x89, not 137. The MetaMask block below also fills chainName, nativeCurrency (name, symbol, decimals) and rpcUrls, which a wallet uses to display and reach the network. A wallet cannot send the x-token header, so rpcUrls holds the keyed URL with your API key in the path — paste your key below; the placeholder URL answers 401 until you do.
MetaMask
{
"method": "wallet_addEthereumChain",
"params": [{
"chainId": "0x89",
"chainName": "Polygon",
"nativeCurrency": { "name": "POL", "symbol": "POL", "decimals": 18 },
"rpcUrls": ["https://triport.io/r/<API_KEY>/polygon"]
}]
}viem
import { createPublicClient, defineChain, http } from "viem";
export const polygon = defineChain({
id: 137,
name: "Polygon",
nativeCurrency: { name: "POL", symbol: "POL", decimals: 18 },
rpcUrls: { default: { http: ["https://triport.io/r/<API_KEY>/polygon"], webSocket: ["wss://triport.io/ws/poly/<API_KEY>"] } },
});
export const client = createPublicClient({ chain: polygon, transport: http() });ethers v6
import { JsonRpcProvider, Network } from "ethers";
const network = Network.from({ name: "polygon", chainId: 137 });
export const provider = new JsonRpcProvider("https://triport.io/r/<API_KEY>/polygon", network, { staticNetwork: network });Hardhat
// hardhat.config.ts
export default {
networks: {
polygon: { url: "https://triport.io/r/<API_KEY>/polygon", chainId: 137 },
},
};Foundry
# foundry.toml
[rpc_endpoints]
polygon = "https://triport.io/r/<API_KEY>/polygon"wagmi
import { createConfig, http } from "wagmi";
import { polygon } from "./polygon-chain";
export const config = createConfig({
chains: [polygon],
transports: { [polygon.id]: http("https://triport.io/r/<API_KEY>/polygon") },
});curl (header auth)
curl https://triport.io/polygon \
-H "x-token: <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'Keys in URLs vs headers
A keyed URL is the same credential as a header, in a less private place: it lands in shell history, CI logs and screenshots. Use it only where a header is impossible (wallets, hardhat.config, foundry.toml), send x-token from server code, and rotate a key that leaked.
Verify you are on Polygon mainnet
Call eth_chainId first. It must return 0x89 — a client whose configured chain ID disagrees with the reply refuses to connect, which explains most failures when adding a network by hand.
curl https://triport.io/polygon \
-H "x-token: <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'Sources: the chain's own documentation and the CAIP-2 namespace specs cited in the tables above; EVM chain IDs come from Triport's chain registry and match them.
FAQ
- What is the Polygon chain ID?
- 137 in decimal, 0x89 in hex — eth_chainId returns the hex form. The CAIP-2 ID is eip155:137.
- What is the Polygon network ID?
- net_version returns 137, the same number as the chain ID. Sign with the chain ID from eth_chainId: under EIP-155 the chain ID is part of the transaction signature, the network ID is not.
- What is the Polygon RPC URL?
- On Triport: https://triport.io/polygon with your API key in the x-token header, or https://triport.io/r/<API_KEY>/polygon where a header is impossible (wallets, config files). WebSocket: wss://triport.io/ws/poly.
- Is there a list of Polygon RPC URLs?
- Polygon's documentation keeps the list of public endpoints, all run by third-party providers and subject to their rate limits. Triport's endpoint is https://triport.io/polygon; every value on this page — chain ID 137, network ID 137, currency POL — is the same whichever endpoint you use.
- How do I add Polygon to MetaMask?
- Call wallet_addEthereumChain (EIP-3085) with chainId "0x89" — a hex string, not the decimal 137 — chainName "Polygon", nativeCurrency POL with 18 decimals, and your keyed RPC URL in rpcUrls. The MetaMask block on this page is the exact request.
- Is my API key sent to Triport when I use this page?
- No. Snippets are generated in your browser: the key is never submitted, never stored and never written into the page URL, which is why this page has no shareable link.