# Decred On-Chain & Staking API
> Live on-chain data from the Decred (DCR) blockchain via the public dcrdata explorer — clean JSON, no cache. Decred is a hybrid proof-of-work / proof-of-stake cryptocurrency with on-chain governance: blocks are mined by PoW but validated by PoS tickets bought from a ticket pool, so stakeholders directly control the chain. Read the network head (best block, PoW difficulty, stake difficulty, live ticket pool); the staking layer (ticket-pool size and value, the current and next ticket price and next-price estimates); the coin supply (mined vs the 21M ultimate cap and percent issued); any block by height or hash; and any address's received, sent and unspent DCR. Read live from Decred, nothing stored. This is Decred's own hybrid PoW/PoS, ticket-staking and on-chain-governance layer — distinct from the Bitcoin, EOS, Internet Computer and other on-chain APIs and from price feeds.

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

## Pricing
- **Free** (Free) — 1,000 calls/Mo, 3 req/s
- **Starter** ($10/Mo) — 35,000 calls/Mo, 12 req/s
- **Pro** ($29/Mo) — 180,000 calls/Mo, 28 req/s
- **Business** ($70/Mo) — 900,000 calls/Mo, 55 req/s

## Endpoints

### Network

#### `GET /v1/network` — Chain head — best block, PoW + stake difficulty, ticket pool

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

**Response:**
```json
{
    "data": {
        "chain": "decred",
        "source": "Decred (dcrdata)",
        "consensus": "hybrid PoW/PoS",
        "best_block": 1087582,
        "block_hash": "fdc25cd4ec3d4bb43e59604d2f0bb775592523a4f598ec90083fea0b0f5a6e7b",
        "block_time": "2026-06-10T13:53:11.000Z",
        "pow_difficulty": 1741175.4701,
        "block_size_bytes": 35140,
        "ticket_pool_size": 40122,
        "stake_difficulty_dcr": 282.57389518,
        "ticket_pool_value_dcr": 11078660.3303
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:11.808Z",
        "request_id": "31c41142-49e2-4af0-bb69-5821058543a5"
    },
    "status": "ok",
    "message": "Network state retrieved successfully",
    "success": true
}
```

### Staking

#### `GET /v1/staking` — Ticket pool size/value, current + next ticket price, estimates

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

**Response:**
```json
{
    "data": {
        "height": 1087582,
        "source": "Decred (dcrdata)",
        "consensus": "hybrid PoW/PoS",
        "window_number": 7552,
        "ticket_pool_size": 40122,
        "window_block_index": 95,
        "next_ticket_price_dcr": 282.57389518,
        "ticket_pool_value_dcr": 11078660.3303,
        "next_price_estimate_dcr": {
            "max": 286.369369,
            "min": 273.186192,
            "expected": 276.34589
        },
        "current_ticket_price_dcr": 282.57389518,
        "ticket_pool_avg_price_dcr": 276.124329
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:12.207Z",
        "request_id": "1282eee3-235c-4183-a067-b1fa9eaf8ffb"
    },
    "status": "ok",
    "message": "Staking state retrieved successfully",
    "success": true
}
```

### Supply

#### `GET /v1/supply` — Mined and ultimate DCR supply and percent issued

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

**Response:**
```json
{
    "data": {
        "source": "Decred (dcrdata)",
        "block_height": 1087582,
        "percent_issued": 83.1424,
        "supply_mined_dcr": 17459894.91222925,
        "supply_ultimate_dcr": 20999999.9839432
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:12.428Z",
        "request_id": "70a46a4b-f9b7-489f-85c0-5d51c6b8ae6e"
    },
    "status": "ok",
    "message": "Supply retrieved successfully",
    "success": true
}
```

### Block

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

**Parameters:**
- `height` (query, optional, string) — Block height Example: `1087000`
- `hash` (query, optional, string) — Block hash (64 hex)

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

**Response:**
```json
{
    "data": {
        "hash": "d439d0349f228398c2c533c705b96c7291a1db3b92053c36acbf1977d377db42",
        "time": "2026-06-08T15:12:23.000Z",
        "height": 1087000,
        "source": "Decred (dcrdata)",
        "tx_count": 0,
        "size_bytes": 8076,
        "pow_difficulty": 1563701.5464,
        "ticket_pool_size": 40510,
        "stake_difficulty_dcr": 306.96731843,
        "ticket_pool_value_dcr": 11111941.3326
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:12.714Z",
        "request_id": "a509a43f-dbaa-498b-a1b0-c80c8fd219ab"
    },
    "status": "ok",
    "message": "Block retrieved successfully",
    "success": true
}
```

### Address

#### `GET /v1/address` — An address's received, sent and unspent DCR

**Parameters:**
- `address` (query, required, string) — Decred address (mainnet starts with D) Example: `Dcur2mcGjmENx4DhNqDctW5wJCVyT3Qeqkx`

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

**Response:**
```json
{
    "data": {
        "source": "Decred (dcrdata)",
        "address": "Dcur2mcGjmENx4DhNqDctW5wJCVyT3Qeqkx",
        "spent_dcr": 1089357.22118773,
        "utxo_count": 20254,
        "balance_dcr": 40472.13133726,
        "block_height": 1087582,
        "received_dcr": 1129829.35252499,
        "spent_outputs": 534482
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:12.974Z",
        "request_id": "a09ce627-f015-46f2-9e5c-24992a78b670"
    },
    "status": "ok",
    "message": "Address retrieved successfully",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "source": "dcrdata explorer API (dcrdata.decred.org, live)",
        "service": "decred-api",
        "consensus": "hybrid PoW/PoS",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/block": "A block by height or hash (height=1087000 or hash=64 hex).",
            "GET /v1/supply": "Mined and ultimate DCR supply and percent issued.",
            "GET /v1/address": "An address's received, sent and unspent DCR (address=Dcur2mcGjmENx4DhNqDctW5wJCVyT3Qeqkx).",
            "GET /v1/network": "Chain head — best block, PoW + stake difficulty, ticket pool.",
            "GET /v1/staking": "Ticket pool size/value, current + next ticket price, estimates."
        },
        "best_block": 1087582,
        "description": "Live on-chain data from the Decred (DCR) blockchain via the public dcrdata explorer API. Decred is a hybrid proof-of-work / proof-of-stake cryptocurrency with on-chain governance: blocks are mined by PoW but validated by PoS tickets bought from a ticket pool. The network endpoint returns the chain head (best block, PoW difficulty, stake difficulty, ticket pool); the staking endpoint returns ticket-pool size and value, the current and next ticket price (stake difficulty) and next-price estimates; the supply endpoint returns the mined and ultimate DCR supply and percent issued; the block endpoint returns any block by height or hash; the address endpoint returns an address's received, sent and unspent DCR. L
…(truncated, see openapi.json for full schema)
```


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