Aller au contenu
GET /v1/block

Block by height (or latest)

Essayez-le en direct

10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.

En-têtes personnalisés (facultatif)
api.oanor.com/sapphire-api

Ça marche. Récupérez une clé API et utilisez-la dans votre projet.

Obtenez une clé API

Extraits de code

curl "https://api.oanor.com/sapphire-api/v1/block" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/sapphire-api/v1/block", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/sapphire-api/v1/block");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/sapphire-api/v1/block",
    headers={"x-oanor-key": "oanor_test_..."}
)

Exemple de réponse

Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.

{
    "data": {
        "hash": "0x73078e1484f34ea7282a9b97a3f50ddf82d801f4eb413f0de0a7d4cae70cff45",
        "miner": "0x0000000000000000000000000000000088888888",
        "number": 5000000,
        "gas_used": 520788,
        "gas_limit": 15000000,
        "timestamp": 1723603297,
        "size_bytes": 7033,
        "parent_hash": "0xb7afe26ed828b639bac72c145afdce296d3d15cec79b619ab0346748910fbec5",
        "timestamp_iso": "2024-08-14T02:41:37.000Z",
        "transaction_count": 7,
        "base_fee_per_gas_wei": null
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:13.542Z",
        "request_id": "44950adb-70dc-48f1-b4de-de2c1f76089a"
    },
    "status": "ok",
    "message": "Block retrieved successfully",
    "success": true
}