About blockchain APIs
A blockchain API is a set of programming interfaces that allow developers to access the functionality of a blockchain from within their applications. It enables external programs to interact with the blockchain, read or write data, and execute smart contracts.Get you own node endpoint today
Start for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.A developer can use a blockchain API to build a decentralized exchange, a block explorer, or a supply chain management platform.
About this reference
Node API
A collection of articles that explain how the most popular API methods work on the following networks:Ethereum
Ethereum Beacon Chain
Polygon
BNB Chain
Base
Avalanche
Arbitrum
zkSync Era
Polygon zkEVM
Optimism
Solana
Ronin
Gnosis Chain
Cronos
Fantom
Bitcoin
Starknet
Chainstack platform API
The Chainstack platform API allows you to manage:- Your organization
- Your projects
- Your networks
- Your nodes
- Your identities
Getting started
Follow these steps to sign up on Chainstack, deploy a node, and find your endpoint credentials:Make your first request
Chainstack’s infrastructure allows you to access and retrieve data from a blockchain using JSON-RPC and the command line. To make manual requests, it’s recommended to use tools such as curl or Postman and send POST requests via JSON-RPC. The following is an example of a curl request that interacts with a Chainstack node’s JSON-RPC API.cURL
curl -X POST
which is used to initiate a POST request to the specified URL, a Chainstack node in this case;CHAINSTACK_NODE_URL
.-H 'Content-Type: application/json'
specifies that the request’s content type is in JSON format.--data '{"method":"eth_blockNumber", "jsonrpc":"2.0", "params":[],"id":1}'
is the request’s payload, which contains the JSON-RPC request data.
method
— defines the method that is being called, in this case, eth_blockNumber.jsonrpc
— defines the version of the JSON-RPC protocol in use; it is set to2.0
.params
— is used to pass any additional parameters required by the method; in this case, it is empty.id
— is used to identify the request. It is set to1
in this case, and you can useid
to identify the request the response belongs to.
eth_blockNumber
will return the number of the most recent block in the chain.
Response example:
Shell
Find different ways to interact and retrieve data from the blockchain in the Web3 libraries and tools guide.
Password-protected access
For the blockchain API requests, you can also use basic authentication:- HTTPS endpoint:
https://ethereum-mainnet.core.chainstack.com
- WSS endpoint:
wss://ethereum-mainnet.core.chainstack.com/ws
- Username:
YOUR_USER_NAME
- Password:
YOUR_PASSWORD
You can find your username and password credentials in the Chainstack console.
curl
command like so:
cURL
-u YOUR_USER_NAME:YOUR_PASSWORD
includes your username and password for basic authentication. Please replace YOUR_PASSWORD
with your actual password.