Skip to main content

FastNEAR API

FastNEAR provides high-performance infrastructure enabling seamless blockchain interactions.

Overview​

FastNEAR exposes low-latency APIs for wallets and explorers. Their API allows you to easily query the NEAR blockchain to get an account's assets, map keys into account IDs, explore a block's transactions, etc.

More info

Find more information about the FastNear API in their services page.

RPC implementation​

Fast-Near aims to provide the fastest RPC implementation for NEAR Protocol using high-performance storage backends:

  • in-memory storage in Redis.
  • SSD optimized storage using LMDB.

It is optimized for view call performance and ease of deploy and scaling.

About data sync

FastNear doesn't sync with the NEAR blockchain on its own. Data needs to be loaded either from NEAR Lake or from Near State Indexer.


Endpoints​

The FastNEAR API server provides a low-latency RPC API for wallets and explorers.

  • Mainnet: https://api.fastnear.com
  • Testnet: https://test.api.fastnear.com

Public Key​

  • Public Key to Account ID mapping.
  • Full Access Public Key to Account ID mapping.
  • Any Public Key to Account ID mapping.

Account ID​

  • Account ID to delegated staking pools (validators).
  • Account ID to fungible tokens (FT contracts).
  • Account ID to non-fungible tokens (NFT contracts).

Token ID​

  • Token ID to top 100 accounts by balance (for FT contracts).
V1 API

Click here to see the complete list of API endpoints and usage examples.

Examples​

Blockchain Data​

  • Query last block produced
# Query last block produced
curl https://mainnet.neardata.xyz/v0/last_block/final
Response
  {
"block": {
"author": "aurora.pool.near",
"header": {
"height": 129311487,
"prev_height": 129311486,
...
}
}
}

User Queries​

  • Query user's FTs
# Query user's FTs
curl https://api.fastnear.com/v1/account/root.near/ft
Response
{"account_id":"root.near","tokens":[{"balance":"199462092","contract_id":"pixeltoken.near","last_update_block_height":null},...

  • Query user's NFTs
# Query user's NFTs
curl https://api.fastnear.com/v1/account/root.near/nft
Response
{"account_id":"root.near","tokens":[{"contract_id":"nft.goodfortunefelines.near","last_update_block_height":null},...

  • Query all user's assets
# Query all user's assets
curl https://api.fastnear.com/v1/account/root.near/full
Response
  {
"account_id": "root.near",
"tokens": [
{ "balance": "199462092", "contract_id": "the-token.near" },
...
]
}
Was this page helpful?