Learn how to access NEAR API.
Step 1: To access NEAR, use the following native access endpoint:
- Network: NEAR Mainnet
- Request Type: POST
https://svc.blockdaemon.com/near/mainnet/native
Step 2: You should authorize your request. Learn more: Authentication Guide
Step 3: Specify a NEAR method in the request body:
{
"jsonrpc": "2.0",
"id": 1,
"method": "YOUR_METHOD",
"params": []
}
Example Request
Here is a cURL example for using status to get status information for nodes and validators in NEAR Mainnet:
curl -X POST \
https://svc.blockdaemon.com/near/mainnet/native \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "id": 1, "method": "status", "params": []}'
The following is a typical response you will get:
{
"jsonrpc": "2.0",
"result": {
"chain_id": "mainnet",
"latest_protocol_version": 55,
"protocol_version": 55,
"rpc_addr": "0.0.0.0:3030",
"sync_info": {
"earliest_block_hash": "9VCLy3EaCokgrnqeQNyNcY7B4bdLVk5LM2vvHRQYuEJE",
"earliest_block_height": 71915612,
"earliest_block_time": "2022-08-13T12:51:39.002561384Z",
"epoch_id": "HF8QqSZs3LGsTg625y8MBEqbFwjHd8daM9hrgDb4QVUL",
"epoch_start_height": 72114690,
"latest_block_hash": "6gKCRSq9y3SErvbvmJ1dSMKjxb2JpL3g69j3eR4f7G8m",
"latest_block_height": 72123152,
"latest_block_time": "2022-08-16T10:04:45.200886611Z",
"latest_state_root": "HLryscwpjBMsVvBeoAHpVq3ZbYHSJG2djL6HmY9psRLZ",
"syncing": false
},
"validator_account_id": null,
"validators": [
{
"account_id": "bzam6yjpnfnxsdmjf6pw.poolv1.near",
"is_slashed": false
},
{ ...more validators... }
],
"version": {
"build": "crates-0.14.0-149-gef8862918-modified",
"rustc_version": "1.61.0",
"version": "1.28.0"
}
},
"id": 1
}
👋 Need Help?
Contact us through email or our support page for any issues, bugs, or assistance you may need.