# Polygon API reference guide

# Start building on Polygon using the JSON-RPC Polygon API

This page is a collection of JSON-RPC API call examples for the Polygon API using:

Information

The management API namespaces admin_ and personal_ are not exposed.

# What is Polygon protocol?

Polygon (opens new window) is an EVM-compatible sidechain, and one of Ethereum's scaling solutions (opens new window) to help reduce costs and increase efficiency.

Polygon runs independently from the Ethereum chain, has its own consensus mechanism, and can bridge assets between the two networks.

# What is the Polygon API

The Polygon API allows developers to communicate with the Polygon blockchain to build applications.

To read data from and send transactions to the Polygon blockchain, an application must connect to a Polygon RPC node.

When communicating with a Polygon RPC node, the Polygon client implements a JSON-RPC specification, a communication protocol allowing one to make remote calls and execute them as if they were made locally.

# How to start using the Polygon API

To use the Polygon API, you need access to a Polygon RPC node.

Follow these steps to sign up on Chainstack, deploy a Polygon RPC node, and find your endpoint credentials:

  1. Sign up with Chainstack.
  2. Deploy a node.
  3. View node access and credentials.

Now you are ready to connect to the Polygon blockchain and use the Polygon API to build.

The best way to use the Polygon API is to use a web3 library such as Web3.js (opens new window) if using JavaScript or Web3.py (opens new window) using Python.

A web3 library makes using the Polygon API to communicate with the Polygon blockchain easy and efficient.

# Install web3 libraries

You will need to install the web3 libraries to be able to use them.

# Install Web3.js

Web3.js (opens new window) is a JavaScript library that allows you to communicate with an EVM node through HTTP and WebSocket.

To install, run:

npm install web3

# Install Web3.py

Web3.py (opens new window) is a Python library that allows you to communicate with an EVM node through HTTP and WebSocket.

To install, run:

pip install web3

# Install Eth.rb

Eth.rb (opens new window) is a Ruby gem that allows you to communicate with an EVM node through HTTP.

To install, run:

gem install eth