Skip to main content

Using the Node API

info

After creating your app, you can immediately use the Figment APIs.

The following sections explain accessing the APIs.

The Node APIs are used to communicate with nodes running on a given blockchain protocol. For example, if you want to get information about a specific block on Polygon, you can send a request to the Polygon endpoint to run the method eth_getBlockByNumberwhich returns a JSON object containing the data you have requested.

You can see the endpoint URLs on the protocol's detail page:

  1. From the Dashboard, select your app. Choose the Overview tab. Click on the protocol you want to access.
  2. On the protocol's detail page, you can see a list of all available services and networks for that protocol on the right side of the page. Next to each endpoint URL is a link to an example.
  3. From the example, you can see the full URL for this service as well as some sample requests to get you started.
Endpoint Example

Authentication

Read about the authentication HERE

Example Requests

info

In example requests, the text API-KEY must be replaced with your actual credentials for it to function. Similarly, you would need to replace the value of the constant API_KEY in any code examples.

Example curl request with API key sent via Authorization header
curl -X POST 'https://ethereum-mainnet--rpc.datahub.figment.io' \
-H 'Content-Type: application/json' \
-H 'Authorization: API-KEY' \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'
Example JSON response from Ethereum node
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1d43bd1"
}

API Reference

View the full Node API reference HERE