# Gravity API
> Real-time on-chain data for Gravity (Gravity Alpha Mainnet, chain-id 1625) — the high-performance chain by Galxe built on the Arbitrum Nitro stack, using G as its native gas token. Query live network status (latest block height, network id, client version), fetch any block by height or the latest one (timestamp, transaction count, gas used / limit, base fee, miner), read the current gas price in wei and gwei, and look up the native G balance and transaction count of any address. A keyless, no-account JSON wrapper over the canonical Gravity JSON-RPC node — decoded from hex into plain decimals and human-readable G so you do not have to. Ideal for explorers, wallets, dashboards, gas estimators and analytics on the Gravity chain.

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

## Pricing
- **Free** (Free) — 4,400 calls/Mo, 3 req/s
- **Basic** ($13/Mo) — 56,000 calls/Mo, 10 req/s
- **Pro** ($34/Mo) — 217,000 calls/Mo, 25 req/s
- **Mega** ($74/Mo) — 902,000 calls/Mo, 60 req/s

## Endpoints

### Network

#### `GET /v1/status` — Network status (latest block, chain id, client version)

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

**Response:**
```json
{
    "data": {
        "chain": "Gravity Alpha Mainnet",
        "chain_id": 1625,
        "network_id": 1625,
        "rpc_healthy": true,
        "latest_block": 128858928,
        "native_symbol": "G",
        "client_version": "nitro/vdevelopment/linux-amd64/go1.25.10"
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:18.976Z",
        "request_id": "19bd5cff-63bc-435c-86b0-ae60f89134d3"
    },
    "status": "ok",
    "message": "Chain status retrieved successfully",
    "success": true
}
```

### Blocks

#### `GET /v1/block` — Block by height (or latest)

**Parameters:**
- `number` (query, optional, string) — Block height (decimal or 0x-hex), or "latest" Example: `10000000`

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

**Response:**
```json
{
    "data": {
        "hash": "0x1544983c82f62ea82579153f59edd6d93050f56a2e93163ef04c510b4b84a7a1",
        "miner": "0xa4b000000000000000000073657175656e636572",
        "number": 10000000,
        "gas_used": 54452,
        "gas_limit": 1125899906842624,
        "timestamp": 1728470060,
        "size_bytes": 1069,
        "parent_hash": "0xe74d3d53bea729f5037f0d27cd05d5721c2e518c07beda1ac01d0c13c144a6f8",
        "timestamp_iso": "2024-10-09T10:34:20.000Z",
        "transaction_count": 2,
        "base_fee_per_gas_wei": "1800000000000"
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:19.236Z",
        "request_id": "aa3e1164-f844-4e40-8cfa-e396ed169c45"
    },
    "status": "ok",
    "message": "Block retrieved successfully",
    "success": true
}
```

### Gas

#### `GET /v1/gas` — Current gas price (wei + gwei)

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

**Response:**
```json
{
    "data": {
        "at_block": 128858928,
        "gas_price_wei": "1800000000000",
        "native_symbol": "G",
        "gas_price_gwei": 1800
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:19.513Z",
        "request_id": "e4b4caab-3623-4d43-93ad-1c529fd9687d"
    },
    "status": "ok",
    "message": "Gas price retrieved successfully",
    "success": true
}
```

### Accounts

#### `GET /v1/balance` — Native G balance and transaction count of an address

**Parameters:**
- `address` (query, required, string) — 0x-prefixed 40-hex EVM address Example: `0x000000000000000000000000000000000000dEaD`

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

**Response:**
```json
{
    "data": {
        "address": "0x000000000000000000000000000000000000dEaD",
        "balance": "114.941578232676099975",
        "balance_wei": "114941578232676099975",
        "native_symbol": "G",
        "transaction_count": 0
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:19.775Z",
        "request_id": "a50da059-0597-4288-948d-dc6bd7eeeba5"
    },
    "status": "ok",
    "message": "Balance retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service metadata

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

**Response:**
```json
{
    "data": {
        "type": "Arbitrum-Orbit L1 (Nitro stack)",
        "chain": "Gravity Alpha Mainnet",
        "network": "mainnet",
        "chain_id": 1625,
        "decimals": 18,
        "ecosystem": "Gravity — chain by Galxe, native gas token G",
        "endpoints": [
            "/v1/status",
            "/v1/block",
            "/v1/gas",
            "/v1/balance",
            "/v1/meta"
        ],
        "description": "Gravity (Gravity Alpha Mainnet) is a high-performance chain by Galxe built on the Arbitrum Nitro stack, using G as its native gas token.",
        "documentation": "https://gravity-api.oanor.dev",
        "native_symbol": "G"
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:19.832Z",
        "request_id": "02858bb0-309d-4be1-8478-95cdbac1e99b"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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