NEAR Protocol (NEAR) - NEAR Protocol
GetBlock provides fast and reliable access to NEAR Protocol nodes via JSON-RPC API. Connect to the NEAR Protocol network without running your own infrastructure.
NEAR Protocol is a high-performance, sharded Layer-1 blockchain with human-readable account names (example.near) and a developer-friendly runtime (contracts in Rust and JavaScript).
It is not EVM-compatible: NEAR exposes its own JSON-RPC 2.0 API with NEAR-native methods (query, block, chunk, tx, send_tx, and others) rather than the Ethereum eth_* surface. The native token is NEAR, denominated in yoctoNEAR (1 NEAR = 10^24 yoctoNEAR). This reference documents the NEAR JSON-RPC interface, available over HTTP and WebSocket.
Key Features
Native JSON-RPC: A JSON-RPC 2.0 API with NEAR-specific methods — not
eth_*; account and contract reads go through thequerymethod with arequest_typeSharded Layer-1: Blocks are split into per-shard chunks (Nightshade sharding) — many methods take a
shard_idor return per-chunk dataNamed Accounts: Human-readable account IDs (
example.near) alongside 64-character implicit (hex) accountsyoctoNEAR: Balances and gas are denominated in yoctoNEAR (1 NEAR = 10^24 yoctoNEAR — 24 decimals)
Finality Control: Most read methods accept
finality(optimistic/final) or an explicitblock_id(height or hash)Access Keys: Accounts hold multiple access keys — full-access or function-call keys with allowances — queried over RPC
Network Information
Network Name
NEAR Protocol Mainnet
Chain ID
mainnet
Native Currency
NEAR
Denomination
yoctoNEAR (1 NEAR = 10^24 yoctoNEAR — 24 decimals)
Account Model
Named accounts (example.near) + implicit (hex)
Consensus
Nightshade (sharded Proof-of-Stake)
Finality
Deterministic (doomslug + final)
Block Explorer
Base URL
Supported Networks
Mainnet
mainnet
✅
✅
❌
❌
❌
✅
❌
❌
Testnet
testnet
✅
✅
❌
❌
❌
✅
❌
❌
Quickstart
In this section, you will learn how to make your first call with either:
Axios
Python
Before you begin, you must have already installed npm or yarn on your local machine. If not, check out npm or yarn.
Set up your project using this command:
For npm:
Or yarn:
This creates a project directory named near-api-quickstart and initialises a Node.js project within it.
Install Axios using this command: Using npm:
Using yarn:
Create a new file and name it
index.js. This is where you will make your first call.Set ES module
"type": "module"in yourpackage.json.Add the following code to the file (
index.js):Replace
<ACCESS_TOKEN>with your actual access token from GetBlock.Run the script:
The current gas price will log in the console like this:
Before you begin, you must have installed Python and Pip on your local machine.
Set up your project using this command:
Set up a virtual environment to isolate dependencies:
Install the requests library:
Create a new file called
main.pyand insert the following code:Replace
<ACCESS_TOKEN>with your actual access token from GetBlock.Run the script:
Available API Methods
Network & Node
status
Returns the node's general status: sync status, nearcore and protocol version, latest block hash and height, and the current validator set
network_info
Returns the node's current network connections: active peers, known producers, and sent/received data counts
validators
Returns the active validator set and validation state for an epoch
gas_price
Returns the gas price for a specific block, or the latest price when called with [null]
genesis_config
Returns the network's genesis configuration: the parameters the chain was launched with
EXPERIMENTAL_protocol_config
Returns the protocol configuration for the latest or a specific block: runtime, gas, and economic parameters currently in force
Blocks & Chunks
block
Returns detailed information about a block, selected by finality ("final"/"optimistic") or by block_id (height or hash)
chunk
Returns the details of a chunk, by chunk hash, or by block_id plus shard_id
block_effects
Returns the state changes that occurred in a block — account, access-key, data, and contract-code changes
Accounts & Contracts
query: view_account
Returns the basic account information for a NEAR account: balance, locked stake, storage usage, and the hash of its contract code (if any)
query: view_code
Returns the deployed contract code (WASM, base64-encoded) for an account, with its hash
query: view_state
Returns the key-value state stored under a contract account, optionally filtered by a base64 key prefix
query: call_function
Executes a read-only contract view method and returns its result, without creating a transaction
Access Keys
query: view_access_key
Returns information about a single access key on an account: its nonce and permission (full access or a function-call permission)
query: view_access_key_list
Returns all access keys registered to an account, each with its public key, nonce, and permission
State Changes
changes
Returns fine-grained state changes filtered by a changes_type
Transactions
send_tx
Broadcasts a signed transaction and waits for the requested execution milestone (wait_until: NONE, INCLUDED, EXECUTED_OPTIMISTIC, FINAL, etc
broadcast_tx_async
Broadcasts a signed transaction and returns its hash immediately, without waiting for execution
broadcast_tx_commit
Broadcasts a signed transaction and waits until it is included and executed, returning the full outcome
tx
Returns the status of a previously submitted transaction, by tx_hash plus sender_account_id (or by signed_tx_base64)
tx_status
Returns the transaction status plus the full list of receipts
EXPERIMENTAL_receipt
Fetches a single receipt by its id, returning its predecessor, receiver, and action or data payload
Maintenance
EXPERIMENTAL_maintenance_windows
Returns the upcoming maintenance windows (block-height ranges) for a validator account — the periods in the current epoch when it is neither producing nor validating and can safely restart
Light Client
next_light_client_block
Returns the next light-client block after the given known block hash — the data a light client needs to advance and verify the chain without a full node
EXPERIMENTAL_light_client_proof
Returns an execution-outcome inclusion proof (for a transaction or receipt) against a given light-client head, so a light client can verify the outcome
Support
For technical support and questions:
Support: support@getblock.io
See Also
Last updated
Was this helpful?