Summary
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:
| Criterion | What to check | Why it matters |
|---|---|---|
| Workload type | Light reads or heavy archive queries? | Public nodes work for low volume; archive and high throughput need dedicated nodes. |
| Rate limits | What are the request-per-second (RPS) and daily caps? | Exceeding limits causes errors; production apps need predictable performance. |
| WebSocket support | Does the provider offer wss:// endpoints? | Required for real-time subscriptions (e.g., pending transactions, logs). |
| Network coverage | Mainnet only, or also testnet (Amoy)? | You need testnet for development and staging. |
| Reliability SLA | Is there an uptime guarantee? | production apps should avoid free public endpoints with no commitment. |
| Trace and archive methods | Are debug_trace*, eth_getLogs with block range limits? | Debugging and data analytics often require archive nodes. |
| Geographic distribution | Are there multiple regions? | Low latency for global users improves dApp experience. |
| Cost model | Pay-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:
| Property | Mainnet | Testnet (Amoy) |
|---|---|---|
| Chain ID | 137 (0x89) | 80002 |
| Gas token | POL | POL |
| RPC endpoint | https://polygon-rpc.com (public) or provider-specific | https://rpc-amoy.polygon.technology |
| WebSocket endpoint | wss://polygon-rpc.com or provider-specific | wss://rpc-amoy.polygon.technology |
| Explorer | polygonscan.com | amoy.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:
| Provider | Endpoint |
|---|---|
| OnFinality | https://polygon.api.onfinality.io/public |
| dRPC | https://polygon.drpc.org |
| PublicNode | https://polygon-bor-rpc.publicnode.com |
| Allnodes | https://polygon.publicnode.com |
| Tatum | https://polygon-mainnet.gateway.tatum.io/ |
Paid Providers
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
- 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.
- Check method needs. If you require
eth_getLogswith large block ranges ordebug_traceTransaction, you need an archive node. Some providers offer archive as an add-on. - 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.
- Test WebSocket reliability. Subscribe to new blocks and measure reconnection time. Dropped connections can break real-time features.
- Review the provider's support. For production, you need a way to escalate issues quickly.
- 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_chainIdresponse returns137for 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
| Problem | Possible Cause | Solution |
|---|---|---|
429 Too Many Requests | Rate limit exceeded | Switch to a paid plan or add backoff/retry. |
-32000: out of requests | Daily quota exhausted | Upgrade to a higher tier or wait for reset. |
eth_blockNumber returns stale value | Node not synced | Use a provider that maintains fully synced nodes. |
| WebSocket disconnects frequently | Provider limits or network issue | Check provider's WS documentation and consider a dedicated node. |
| Transaction not mined after hours | Nonce mismatch or low gas | Verify 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.