Logo
RPC Assistant

Polygon RPC Nodes: Endpoint Settings, Providers, and How to Choose

Resumen

Polygon RPC nodes are remote endpoints that let your dApp communicate with the Polygon blockchain. This article covers chain configuration details (chain ID, RPC/WebSocket URLs), a comparison of free public nodes versus paid providers, and a decision checklist to help you pick the right infrastructure for development, testing, or production use.

Polygon RPC Node Decision Checklist

Before integrating a Polygon RPC node, ask yourself these questions:

CriterionWhat to checkWhy it matters
Workload typeLight reads or heavy archive queries?Public nodes work for low volume; archive and high throughput need dedicated nodes.
Rate limitsWhat are the request-per-second (RPS) and daily caps?Exceeding limits causes errors; production apps need predictable performance.
WebSocket supportDoes the provider offer wss:// endpoints?Required for real-time subscriptions (e.g., pending transactions, logs).
Network coverageMainnet only, or also testnet (Amoy)?You need testnet for development and staging.
Reliability SLAIs there an uptime guarantee?production apps should avoid free public endpoints with no commitment.
Trace and archive methodsAre debug_trace*, eth_getLogs with block range limits?Debugging and data analytics often require archive nodes.
Geographic distributionAre there multiple regions?Low latency for global users improves dApp experience.
Cost modelPay-as-you-go, monthly subscription, or free?Aligns with budget and scaling needs.

Polygon Network Chain Configuration

Polygon (formerly Matic) operates as a sidechain to Ethereum. Here are the essential parameters for connecting:

PropertyMainnetTestnet (Amoy)
Chain ID137 (0x89)80002
Gas tokenPOLPOL
RPC endpointhttps://polygon-rpc.com (public) or provider-specifichttps://rpc-amoy.polygon.technology
WebSocket endpointwss://polygon-rpc.com or provider-specificwss://rpc-amoy.polygon.technology
Explorerpolygonscan.comamoy.polygonscan.com

These values are common across most providers. When you use a service like OnFinality or others, you will receive a unique URL, but the chain ID and network remain the same.


Connecting to Polygon: Basic RPC Calls

Once you have an endpoint, test it with a simple JSON-RPC request. Here is a curl example to get the latest block number:

curl https://polygon.api.onfinality.io/public \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Expected response (hex block number):

{"jsonrpc":"2.0","id":1,"result":"0x55d9a3e"}

For a WebSocket subscription using JavaScript:

const WebSocket = require('ws');
const ws = new WebSocket('wss://polygon.api.onfinality.io/public-ws');

ws.on('open', () => {
  ws.send(JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'eth_subscribe',
    params: ['newHeads']
  }));
});

ws.on('message', (data) => {
  console.log(JSON.parse(data));
});

Always check your provider's documentation for the exact WebSocket URL and any authentication requirements.


Free vs Paid Polygon RPC Nodes

Public (Free) Endpoints

Free endpoints are great for prototyping, hackathons, and low-traffic applications. However, they come with trade-offs:

  • Rate limited – typically 10–100 requests per second.
  • No SLA – uptime not guaranteed.
  • Limited method support – archive and trace methods are often disabled.
  • No dedicated throughput – your traffic shares capacity with others.

Examples of public Polygon RPC endpoints:

ProviderEndpoint
OnFinalityhttps://polygon.api.onfinality.io/public
dRPChttps://polygon.drpc.org
PublicNodehttps://polygon-bor-rpc.publicnode.com
Allnodeshttps://polygon.publicnode.com
Tatumhttps://polygon-mainnet.gateway.tatum.io/

Paid services, including shared API plans and dedicated nodes, offer:

  • Higher or clear rate limits.
  • SLAs with uptime guarantees.
  • Access to archive data and Trace API.
  • Dedicated compute for consistent latency.
  • WebSocket support with higher concurrency.

Leading paid providers for Polygon include Alchemy, Infura, Chainstack, QuickNode, and OnFinality. OnFinality offers both shared RPC API access with transparent pricing and dedicated nodes for high-throughput workloads. You can compare plans on our RPC pricing page and see the full list of supported networks on our networks page.


How to Choose the Right Polygon RPC Node

  1. Assess your volume. If your dApp makes fewer than 100,000 requests per day, a public endpoint may suffice. For anything larger, consider a paid shared or dedicated plan.
  2. Check method needs. If you require eth_getLogs with large block ranges or debug_traceTransaction, you need an archive node. Some providers offer archive as an add-on.
  3. Evaluate latency. Run a simple ping test from your server location to the endpoint. Many providers have points of presence in multiple regions; choose one geographically close to your users or backend.
  4. Test WebSocket reliability. Subscribe to new blocks and measure reconnection time. Dropped connections can break real-time features.
  5. Review the provider's support. For production, you need a way to escalate issues quickly.
  6. Plan for scaling. Start with a shared plan, but ensure the provider offers a clear migration path to dedicated nodes without changing your integration code.

Common Pitfalls When Using Polygon RPC Nodes

  • Using public nodes in production: Public nodes are often rate-limited and may throttle or block excessive usage. Your app can become unavailable during peak times.
  • Ignoring WS limitations: Not all public endpoints support WebSocket. Even if they do, they may limit the number of concurrent subscriptions.
  • Forgetting chain ID validation: Some providers serve multiple chains; always verify that the eth_chainId response returns 137 for mainnet.
  • Overlooking testnet differences: Amoy testnet (chain ID 80002) uses a different RPC endpoint. Ensure your deployment scripts and environments are configured correctly for each network.
  • Not handling rate limits gracefully: Implement exponential backoff and retry logic, even when using paid endpoints, to handle occasional spikes.

Troubleshooting Polygon RPC Issues

ProblemPossible CauseSolution
429 Too Many RequestsRate limit exceededSwitch to a paid plan or add backoff/retry.
-32000: out of requestsDaily quota exhaustedUpgrade to a higher tier or wait for reset.
eth_blockNumber returns stale valueNode not syncedUse a provider that maintains fully synced nodes.
WebSocket disconnects frequentlyProvider limits or network issueCheck provider's WS documentation and consider a dedicated node.
Transaction not mined after hoursNonce mismatch or low gasVerify nonce and gas price; use eth_sendRawTransaction carefully.

If you encounter persistent problems, test with a different endpoint. OnFinality provides both public and private endpoints; you can sign up for free to get a dedicated API key and higher limits.


Key Takeaways

  • Polygon mainnet uses chain ID 137 and token POL; testnet Amoy uses chain ID 80002.
  • Public RPC nodes are suitable for development and low-traffic apps, but production apps need paid services with SLAs.
  • Evaluate providers based on throughput, archive data availability, WebSocket support, and geographic coverage.
  • Always test your integration on testnet first and handle rate limits in your code.
  • OnFinality offers both shared and dedicated Polygon RPC nodes with flexible pricing. See our RPC pricing and supported networks.

Frequently Asked Questions

What is a Polygon RPC node? A Polygon RPC node is a server that processes remote procedure calls, allowing external applications to interact with the Polygon blockchain. It exposes an endpoint that accepts standard JSON-RPC requests.

Can I run my own Polygon node? Yes. You can run your own Polygon node using the official client (bor + heimdall). However, maintaining sync, storage, and uptime requires operational effort. Many teams prefer managed services.

What is the difference between a full node and an archive node? A full node stores only recent state and can recreate historical data up to a configurable prune limit. An archive node stores all historical data, enabling queries like eth_getBalance at any past block. Archive nodes require more storage.

How do I add Polygon to MetaMask? MetaMask often auto-detects Polygon; if not, go to Settings > Networks > Add Network and enter:

  • Network Name: Polygon
  • RPC URL: (your provider's endpoint)
  • Chain ID: 137
  • Symbol: POL
  • Explorer: https://polygonscan.com

Does OnFinality support Polygon testnet? Yes. OnFinality provides endpoints for Polygon Amoy testnet. Check our networks page for current availability and URLs.

Base de conocimiento RPC

Detalles RPC relacionados

Nunca te preocupes por la infraestructura nuevamente

OnFinality elimina la carga pesada de DevOps para que puedas construir de forma más inteligente y rápida.

Comenzar