> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/blockchain-apis",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Overview

## 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.

<Check>
  ### Get your own node endpoint today

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

A blockchain API allows developers to build applications that can read or write data to the blockchain or that can execute smart contracts (which are self-executing contracts in which the terms of the agreement between buyer and seller are directly written into lines of code).

<Info>
  A developer can use a blockchain API to build a decentralized exchange, a block explorer, or a supply chain management platform.
</Info>

Blockchain APIs are an essential part of the blockchain ecosystem, enabling developers to build and integrate new applications with existing ones. They allow different software to communicate with the blockchain and with each other.

## About this reference

### Node API

A collection of articles that explain how the most popular API methods work on the following networks:

<CardGroup cols={3}>
  <Card title="Ethereum" icon="ethereum" iconType="solid" href="/reference/ethereum-getting-started" horizontal />

  <Card title="Ethereum Beacon Chain" icon="signal" iconType="solid" href="/reference/beacon-chain" horizontal />

  <Card title="Polygon" icon="layer-group" iconType="solid" href="/reference/polygon-getting-started" horizontal />

  <Card title="BNB Chain" icon="coins" iconType="solid" href="/reference/getting-started-bnb-chain" horizontal />

  <Card title="Base" icon="layer-group" iconType="solid" href="/reference/base-api-reference" horizontal />

  <Card title="Avalanche" icon="snowflake" iconType="solid" href="/reference/avalanche-getting-started" horizontal />

  <Card title="Arbitrum" icon="layer-group" iconType="solid" href="/reference/arbitrum-getting-started" horizontal />

  <Card title="zkSync Era" icon="layer-group" iconType="solid" href="/reference/getting-started-zksync" horizontal />

  <Card title="Polygon zkEVM" icon="layer-group" iconType="solid" href="/reference/zkevm-getting-started" horizontal />

  <Card title="Optimism" icon="layer-group" iconType="solid" href="/reference/optimism-api-reference" horizontal />

  <Card title="Solana" icon="bolt" iconType="solid" href="/reference/solana-getting-started" horizontal />

  <Card title="Ronin" icon="gamepad" iconType="solid" href="/reference/getting-started-ronin" horizontal />

  <Card title="Gnosis Chain" icon="shield" iconType="solid" href="/reference/gnosis-getting-started" horizontal />

  <Card title="Cronos" icon="coins" iconType="solid" href="/reference/getting-started-cronos" horizontal />

  <Card title="Fantom" icon="bolt" iconType="solid" href="/reference/getting-started-fantom" horizontal />

  <Card title="Bitcoin" icon="bitcoin" iconType="solid" href="/reference/bitcoin-api-reference" horizontal />

  <Card title="Starknet" icon="layer-group" iconType="solid" href="/reference/getting-started-starknet" horizontal />
</CardGroup>

Each method has a detailed explanation, a real use case, and an interactive window to try it out.

### Chainstack platform API

The Chainstack platform API allows you to manage:

* Your organization
* Your projects
* Your networks
* Your nodes
* Your identities

To start with the API, you must [create an API key](/reference/platform-api-getting-started#create-api-key).

For all available API operations, see [API reference](/reference/platform-api-getting-started).

## Getting started

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

<Steps>
  <Step>
    [Sign up with Chainstack](https://console.chainstack.com/user/account/create).
  </Step>

  <Step>
    [Deploy a node](/docs/manage-your-networks).
  </Step>

  <Step>
    [View node access and credentials](/docs/manage-your-node#view-node-access-and-credentials).
  </Step>
</Steps>

## 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](https://curl.se/) or [Postman](https://www.postman.com/) 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 theme={"system"}
curl -X POST "CHAINSTACK_NODE_URL" \
  -H 'Content-Type: application/json' \
  --data '{"method":"eth_blockNumber", "jsonrpc":"2.0", "params":[],"id":1}'
```

The request consists of the following:

* `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.

The payload of the request contains the following fields:

* `method` — defines the method that is being called, in this case, [eth\_blockNumber](/reference/bnb-blocknumber).
* `jsonrpc` — defines the version of the JSON-RPC protocol in use; it is set to `2.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 to `1` in this case, and you can use `id` to identify the request the response belongs to.

This request is asking for the latest block number in the blockchain. The method `eth_blockNumber` will return the number of the most recent block in the chain.

Response example:

```shell Shell theme={"system"}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x24655cf"
}
```

<Info>
  Find different ways to interact and retrieve data from the blockchain in the [Web3 libraries and tools guide](/reference/web3-libraries).
</Info>

### 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`

<Info>
  You can find your [username and password credentials](/docs/manage-your-node#view-node-access-and-credentials) in the Chainstack console.
</Info>

For password-protected access, you include the username and password in your `curl` command like so:

```curl cURL theme={"system"}
curl -X POST \
  -u YOUR_USER_NAME:YOUR_PASSWORD \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' \
  https://ethereum-mainnet.core.chainstack.com
```

In this command, `-u YOUR_USER_NAME:YOUR_PASSWORD` includes your username and password for basic authentication. Please replace `YOUR_PASSWORD` with your actual password.
