# NEAR Protocol API
> Live on-chain data from the NEAR Protocol (NEAR), a sharded proof-of-stake Layer 1 known for its human-readable named accounts and its access-key permission model, via a public NEAR RPC endpoint. On NEAR an account is a name like "aurora" or "example.near", not a hash, and each account authorises actions through access keys that are either full-access or function-call-scoped. Resolve an account's NEAR balance, the portion locked for staking, its storage usage and whether it holds a deployed contract. Read the account's access keys with each key's permission — full access, or a function-call key with its allowance, the contract it may call and the methods it is limited to. Get the current validator set ranked by stake, with each validator's blocks produced versus expected. Read the live chain state — the chain id, protocol version, latest block height, gas price, validator count and total stake. Live, no key, nothing stored. Distinct from the XRP Ledger, Stellar, TRON, Aptos, Algorand, Tezos, Cardano, Hedera, Kaspa, Cosmos, Sui, Solana and EVM on-chain APIs and from price feeds — this is NEAR's named-account state, access keys, staking validators and chain economics. Perfect for wallets, explorers and analytics apps.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/near-api/..."
```

## Pricing
- **Free** (Free) — 8,000 calls/Mo, 2 req/s
- **Starter** ($14/Mo) — 152,000 calls/Mo, 5 req/s
- **Pro** ($40/Mo) — 905,000 calls/Mo, 15 req/s
- **Business** ($86/Mo) — 4,650,000 calls/Mo, 40 req/s

## Endpoints

### Account

#### `GET /v1/account` — Account balance + contract flag

**Parameters:**
- `account` (query, required, string) — NEAR named account Example: `aurora`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/near-api/v1/account?account=aurora"
```

**Response:**
```json
{
    "data": {
        "source": "NEAR",
        "code_hash": "2axCgM1hmJWemwiGH8YuhXzvzodSjfP34X4TzcLRUM76",
        "account_id": "aurora",
        "is_contract": true,
        "locked_near": 0,
        "balance_near": 137816.804812,
        "block_height": 202119376,
        "balance_yocto": "137816804812407026912072052518",
        "storage_usage": 13619243575
    },
    "meta": {
        "timestamp": "2026-06-10T14:02:26.370Z",
        "request_id": "0b82bbf0-6b33-4d95-8fa1-9139e4ea4bde"
    },
    "status": "ok",
    "message": "Account retrieved successfully",
    "success": true
}
```

#### `GET /v1/keys` — Account access keys + permissions

**Parameters:**
- `account` (query, required, string) — NEAR named account Example: `aurora`
- `limit` (query, optional, string) — Max 1-200 Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/near-api/v1/keys?account=aurora&limit=50"
```

**Response:**
```json
{
    "data": {
        "keys": [
            {
                "type": "FullAccess",
                "nonce": 195119959000001,
                "public_key": "ed25519:CAAuuVUijdewX2ktgCDvXfxCrtUmNCvs8CBFhaZEJWoh"
            }
        ],
        "count": 1,
        "source": "NEAR",
        "key_count": 1,
        "account_id": "aurora",
        "full_access_keys": 1,
        "function_call_keys": 0
    },
    "meta": {
        "timestamp": "2026-06-10T14:02:28.547Z",
        "request_id": "4d0483a4-7523-41e3-a1f3-d15706e56a6f"
    },
    "status": "ok",
    "message": "Access keys retrieved successfully",
    "success": true
}
```

### Staking

#### `GET /v1/validators` — Validator set ranked by stake

**Parameters:**
- `limit` (query, optional, string) — Max 1-200 Example: `25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/near-api/v1/validators?limit=25"
```

**Response:**
```json
{
    "data": {
        "count": 25,
        "source": "NEAR",
        "validators": [
            {
                "account_id": "bisontrails2.poolv1.near",
                "stake_near": 30373378.213582,
                "uptime_pct": 100,
                "blocks_expected": 920,
                "blocks_produced": 920
            },
            {
                "account_id": "astro-stakers.poolv1.near",
                "stake_near": 28949888.903461,
                "uptime_pct": 100,
                "blocks_expected": 935,
                "blocks_produced": 935
            },
            {
                "account_id": "figment.poolv1.near",
                "stake_near": 28708578.688383,
                "uptime_pct": 100,
                "blocks_expected": 876,
                "blocks_produced": 876
            },
            {
                "account_id": "binancenode1.poolv1.near",
                "stake_near": 23810404.769558,
                "uptime_pct": 100,
                "blocks_expected": 732,
                "blocks_produced": 732
            },
            {
                "account_id": "bitwise_1.poolv1.near",
                "stake_near": 22342878.769397,
                "uptime_pct": 100,
                "blocks_expected": 674,
                "blocks_produced": 674
            },
            {
                "account_id": "zavodil.poolv1.near",
                "stake_near": 19627718.552601,
                "uptime_pct": 100,
                "blocks_expecte
…(truncated, see openapi.json for full schema)
```

### Network

#### `GET /v1/network` — Live chain state

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/near-api/v1/network"
```

**Response:**
```json
{
    "data": {
        "source": "NEAR",
        "chain_id": "mainnet",
        "epoch_height": 4451,
        "gas_price_yocto": "100000000",
        "validator_count": 421,
        "protocol_version": 84,
        "total_stake_near": 560734095,
        "latest_block_time": "2026-06-10T14:02:31.933634156Z",
        "latest_block_height": 202119389
    },
    "meta": {
        "timestamp": "2026-06-10T14:02:37.153Z",
        "request_id": "c70e2d65-f24b-430c-b69a-428bdb573624"
    },
    "status": "ok",
    "message": "Network state retrieved successfully",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/near-api
OpenAPI spec: https://www.oanor.com/api/near-api/openapi.json
