# Q Chain API
> Live on-chain data for Q — an EVM Layer 1 with an on-chain constitution and enforceable governance — via its public Blockscout explorer (no wallet, no key). The stats endpoint returns chain-wide totals (blocks, transactions, addresses, average block time, gas used); gas gives the current gas-price oracle (slow/average/fast). Blocks lists the latest blocks, and a single block resolves by height or by hash with its transaction count, gas, validator and timestamp. The address endpoint returns any account's Q balance, nonce, contract flag and token holdings; transaction resolves a tx by hash with its from/to, value in Q, fee, status and block. The token endpoint returns an ERC-20 token's metadata (name, symbol, decimals, total supply, holders) by contract address, and search runs a universal lookup across addresses, tokens, blocks and transactions. Gas, balances, values and fees are denominated in Q, the native coin. Real on-chain data straight from the explorer, refreshed every call — no key. 9 endpoints. For multi-chain coverage combine with the other oanor chain APIs (Ethereum, Base, Arbitrum and more).

## 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/qblockchain-api/..."
```

## Pricing
- **Free** (Free) — 4,800 calls/Mo, 2 req/s
- **Basic** ($30/Mo) — 140,000 calls/Mo, 8 req/s
- **Pro** ($91/Mo) — 800,000 calls/Mo, 20 req/s
- **Mega** ($305/Mo) — 4,550,000 calls/Mo, 50 req/s

## Endpoints

### Chain

#### `GET /v1/gas` — Gas-price oracle

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

#### `GET /v1/stats` — Chain stats

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

### Blocks

#### `GET /v1/block` — A block by height or hash

**Parameters:**
- `height` (query, optional, string) — Block height Example: `26515327`
- `hash` (query, optional, string) — Block hash (alternative to height)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/qblockchain-api/v1/block?height=26515327"
```

#### `GET /v1/blocks` — Latest blocks

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

### Accounts

#### `GET /v1/address` — Account balance & holdings

**Parameters:**
- `address` (query, required, string) — Account address (0x + 40 hex) Example: `0x101Bf5CefC653A663311368d68cB79FAFB76A25A`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/qblockchain-api/v1/address?address=0x101Bf5CefC653A663311368d68cB79FAFB76A25A"
```

### Transactions

#### `GET /v1/transaction` — A transaction by hash

**Parameters:**
- `hash` (query, required, string) — Transaction hash (0x + 64 hex) Example: `0xc3a1f38f79fc9c7621bd809ba894bf11daaa64271b95de3606cbb0363cb573e2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/qblockchain-api/v1/transaction?hash=0xc3a1f38f79fc9c7621bd809ba894bf11daaa64271b95de3606cbb0363cb573e2"
```

### Tokens

#### `GET /v1/token` — ERC-20 token metadata

**Parameters:**
- `address` (query, required, string) — Token contract address Example: `0xD5029f39E3cd97cb89f306daef9c6ebCEEd7755A`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/qblockchain-api/v1/token?address=0xD5029f39E3cd97cb89f306daef9c6ebCEEd7755A"
```

### Search

#### `GET /v1/search` — Universal search

**Parameters:**
- `q` (query, required, string) — Address, token, block or tx Example: `N2MQ`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/qblockchain-api/v1/search?q=N2MQ"
```

### Meta

#### `GET /v1/meta` — Spec

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


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