Logo

What is a Polygon RPC endpoint and how do you choose the right one?

Key Takeaways

  • Polygon RPC endpoints allow you to interact with the Polygon blockchain using standard JSON-RPC methods.
  • Polygon mainnet uses chain ID 137 and the native token POL (formerly MATIC).
  • Amoy testnet (chain ID 80002) is the recommended testnet for Polygon development.
  • Public RPC endpoints are free but often rate-limited and less reliable for production.
  • Private or dedicated RPC endpoints offer higher throughput, lower latency, and better uptime guarantees.
  • When choosing a Polygon RPC provider, evaluate factors like rate limits, geographic coverage, and support for archive data.
  • OnFinality provides both public and dedicated Polygon RPC endpoints with scalable infrastructure.

Polygon Network Overview and RPC Basics

Polygon (formerly Matic Network) is a layer-2 scaling solution that runs alongside Ethereum, offering faster and cheaper transactions. It is EVM-compatible, meaning developers can use the same tools and languages (Solidity, Hardhat, etc.) as on Ethereum. The native token is POL (previously MATIC), and the mainnet chain ID is 137.

An RPC endpoint is the gateway for sending requests to the Polygon blockchain. Every interaction—whether querying a balance, sending a transaction, or calling a smart contract—is done via JSON-RPC calls. Developers typically use libraries like ethers.js or web3.js, which abstract the raw RPC calls.

  • Polygon mainnet: Chain ID 137, native token POL, RPC endpoint example: https://polygon.api.onfinality.io/public
  • Polygon Amoy testnet: Chain ID 80002, native token POL (testnet), RPC endpoint example: https://polygon-amoy.api.onfinality.io/public
  • Standard JSON-RPC methods include eth_blockNumber, eth_getBalance, eth_sendRawTransaction, and eth_call.
  • WebSocket (WSS) endpoints are available for real-time event subscriptions.

Public vs Private Polygon RPC Endpoints

Public RPC endpoints are freely accessible but come with limitations. They are often rate-limited (e.g., 100 requests per second), may have lower uptime guarantees, and can be slower during peak usage. They are suitable for development, testing, and low-traffic applications.

Private or dedicated RPC endpoints offer higher throughput, dedicated resources, and better reliability. Providers like OnFinality offer scalable plans with configurable rate limits, geographic distribution, and priority support. For production dApps with high transaction volumes, a private endpoint is strongly recommended.

  • Public RPC: Free, rate-limited, shared infrastructure, best for prototyping.
  • Private RPC: Paid, higher limits, dedicated nodes, lower latency, SLA-backed.
  • Dedicated nodes: Full control over node configuration, ideal for high-throughput or archive data needs.

How to Choose a Polygon RPC Provider

Selecting the right RPC provider depends on your application's requirements. Key factors include throughput (requests per second), latency, geographic coverage, support for archive data, and pricing model. For EVM-compatible chains like Polygon, you should also verify that the provider supports the JSON-RPC methods your dApp relies on.

OnFinality offers both public and dedicated Polygon RPC endpoints, with support for mainnet and Amoy testnet. Their infrastructure is designed for scalability, and they provide detailed network documentation to help you get started quickly.

CriterionWhat to checkWhy it matters
Throughput (RPS)Maximum requests per second allowedDetermines how many concurrent users your dApp can support.
LatencyAverage response time from different regionsLow latency improves user experience, especially for time-sensitive operations.
Uptime SLAGuaranteed uptime percentage (e.g., 99.9%)Ensures your dApp remains available; critical for production.
Archive Data SupportAvailability of historical state and trace methodsNeeded for analytics, explorers, and certain DeFi applications.
Pricing ModelPay-as-you-go vs. subscription vs. dedicated node pricingImpacts cost predictability and scalability.
Geographic DistributionNumber and location of data centersReduces latency for global user base and provides redundancy.

Polygon Mainnet and Amoy Testnet RPC Details

Below are the essential network parameters for Polygon mainnet and Amoy testnet. Always verify the latest details from official documentation or your RPC provider's network page.

  • Polygon Mainnet: Chain ID 137, Currency POL, RPC endpoint https://polygon.api.onfinality.io/public, WSS endpoint wss://polygon.api.onfinality.io/public
  • Polygon Amoy Testnet: Chain ID 80002, Currency POL, RPC endpoint https://polygon-amoy.api.onfinality.io/public, WSS endpoint wss://polygon-amoy.api.onfinality.io/public
  • Block explorers: polygonscan.com (mainnet), amoy.polygonscan.com (testnet)
  • Gas station: gasstation.polygon.technology

Common Use Cases for Polygon RPC Endpoints

Polygon RPC endpoints are used in a wide variety of Web3 applications. Here are some typical scenarios:

  • DeFi dApps: Querying token balances, submitting swap transactions, reading pool data.
  • NFT marketplaces: Minting, transferring, and querying metadata of NFTs.
  • Gaming: Handling in-game transactions, verifying ownership, and updating game state.
  • Analytics platforms: Indexing on-chain data using archive nodes.
  • Wallets: Displaying balances, transaction history, and sending transactions.

Best Practices for Using Polygon RPC

To ensure optimal performance and reliability when interacting with Polygon via RPC, follow these best practices:

  • Use a dedicated or private RPC endpoint for production applications to avoid rate limits and downtime.
  • Implement retry logic with exponential backoff to handle transient failures.
  • Cache frequently accessed data (e.g., token prices, contract metadata) to reduce RPC calls.
  • Monitor your RPC usage and set up alerts for unusual spikes or errors.
  • Choose a provider with multiple geographic endpoints to reduce latency for your users.
  • For real-time updates, use WebSocket connections instead of polling.

Frequently Asked Questions

What is a Polygon RPC endpoint?

A Polygon RPC endpoint is a URL that allows external applications to communicate with the Polygon blockchain using JSON-RPC. It is used to query data, send transactions, and interact with smart contracts.

What is the RPC URL for Polygon mainnet?

The RPC URL for Polygon mainnet is typically https://polygon-rpc.com or https://polygon.api.onfinality.io/public. The chain ID is 137 and the native currency is POL.

What is the Polygon Amoy testnet RPC URL?

The Polygon Amoy testnet RPC URL is https://rpc-amoy.polygon.technology or https://polygon-amoy.api.onfinality.io/public. The chain ID is 80002.

Is there a free Polygon RPC endpoint?

Yes, public RPC endpoints like https://polygon-rpc.com and https://polygon.api.onfinality.io/public are free to use, but they have rate limits and are not recommended for high-traffic production applications.

How do I choose a Polygon RPC provider?

Consider factors like throughput (RPS), latency, uptime SLA, archive data support, pricing, and geographic distribution. For production, a dedicated or private endpoint is recommended.

polygon rpc endpointpolygon rpc providerpolygon mainnet rpcpolygon amoy rpcpolygon rpc url
RPC Knowledge Base

Related RPC details

Background

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started