Polygon PoS API FAQ

Frequently asked questions about the Polygon API

What is Polygon?

Polygon is a sidechain, one type of Ethereum scaling solution, that runs parallel to the Ethereum Mainnet. Polygon improves transaction speeds and cost compared to the mainnet, making it an excellent solution for Ethereum developers. Originally known as the Matic network, Jaynti Kanani, Sandeep Nailwal, and Anurag Arjun founded Polygon in late 2017.

What is the Polygon API?

The Polygon API allows applications to connect to a Polygon node that is part of the Polygon network. Developers can interact with on-chain data and send different types of transactions to the network by utilizing the endpoints provided by the API. The API follows a JSON-RPC standard. JSON-RPC is a stateless, lightweight, remote procedure call (RPC) protocol encoded in JSON.

How can I get started using the Polygon API?

Explained in the Polygon API Quickstart Guide.

Is Polygon EVM compatible?

Yes! Polygon is fully EVM-compatible with all Solidity smart contracts and Ethereum libraries. The Ethereum Virtual Machine is the distributed state machine that allows developers to make smart contracts on Ethereum. Because Polygon is an sidechain scaling solution, operating in conjunction with the Ethereum blockchain, it is fully compatible with EVM and benefits from its functionality.

What API does Polygon use?

Polygon uses the JSON-RPC API standard as its API. The Polygon JSON-RPC API serves as the backbone for the Polygon network and powers any blockchain interaction.

In aggregate, this API suite allows users to read block/transaction data, query chain information, execute smart contracts, store data on-chain, etc. Developers and consumers alike interact with Polygon’s base JSON-RPC APIs to communicate with its decentralized network of nodes.

What is a Polygon API key?

When accessing the Polygon network via a node provider like Alchemy, Polygon developers use an API key to send and receive transactions from the network.

While many Polygon development tools like MetaMask have a set of default Polygon RPC endpoints, they are often throttled during periods of high usage leading to slower response times and a higher likelihood of request failures.

For the best development experience, we recommend that you sign up for a free API key! With a dedicated API key, developers can:

  • access higher request throughput and increased concurrent requests
  • query enhanced APIs, gaining access to free archive data, logs, and API abstractions
  • leverage individualized usage metrics

Which libraries support Polygon?

Three libraries support Polygon: Alchemy-web3, Web3.js, and Ethers. Of these three, Alchemy is an improvement over Web3 and Ethers libraries, providing enhanced API calls, upgraded WebSockets, and many other benefits.

What programming languages work with Polygon?

Many programming languages work with Polygon including Go, Javascript, Solidity, Typescript, and Shell. Javascript and Solidity are some of the best languages to use, Solidity for smart contracts and Javascript for off-chain requests.

How do I add Polygon to MetaMask Mainnet?

To connect Polygon to MetaMask, create a Polygon app in Alchemy. To get a dedicated Polygon RPC endpoint, add a new network to MetaMask, and enter the following details:

What testnet should I use for Polygon?

You should use the Mumbai testnet for testing Polygon applications. Mumbai is the testnet of Polygon, and Polygon developers can use a Mumbai faucet to get test MATIC tokens.

If you sign in with your Alchemy account, you’ll get 5x more test MATIC tokens. On Mumbai, developers can get one token in a twenty-four-hour period, and use that on the testnet to make sure their Polygon applications are working properly before putting them on the mainnet.

How do I build an app on Polygon?

Simply sign up for Alchemy, click the “Apps” tab, “Create App”, and then you can start building your new app for either the Polygon mainnet or the Mumbai test network!

What wallets can be used on Polygon?

Developers can use many wallets on Polygon. Some of the most popular wallets include Metamask, Ledger Nano X, and SafePal S1. We give details on many of these wallets in our Web3 wallet overview.

What does Polygon use for gas?

Polygon uses MATIC tokens for gas, as MATIC is Polygon’s native token. To check the current price of Polygon Gas, use the Polygon Gas Tracker.

How do you bridge Polygon to Ethereum?

For bridging, use the Polygon PoS Bridge. When you connect your Metamask wallet, you will be able to send and receive tokens between Polygon and Ethereum.

Alchemy’s overview on cross-chain bridges can further help you understand how bridging works and how these bridges allow chains to interact with each other.

How do you withdraw ETH from Polygon?

To withdraw ETH from Polygon, go to a Polygon Bridge, click “Withdraw”, enter your desired amount, and then click “Transfer”.

What projects are on Polygon?

Some of the most popular dApps on Polygon include KyberSwap, QuickSwap, ZED RUN, and EasyFi. Currently, there are over 19,000 unique dApps running on the Polygon network.

What methods does Alchemy support for the Polygon API?

You can find the list of all the methods Alchemy support for the Polygon API on the Polygon API Endpoints page.

My question isn't here, where can I get help?

Don't worry, we got you. Check out our feel free to post in discord with any questions you have!