API GHI v1.0 – Quickstart
Cette page présente la manière la plus simple d’interroger l’API publique GHI. Le moteur actuellement exposé est le Sandbox Engine v0.4.0, qui renvoie des données factices mais stables.
1. Base URL
En local, via le moteur sandbox :
http://127.0.0.1:8000/v1/ghi
2. Endpoints principaux
GET /v1/ghi/indicator: indicateur quotidien global (min / avg / max).GET /v1/ghi/snapshot: snapshot structuré au format GHI v1.0.
3. Exemple – GET /v1/ghi/indicator
curl "http://127.0.0.1:8000/v1/ghi/indicator"
Réponse typique (extrait) :
{
"date": "2025-12-08",
"currency": "USD",
"min_cost": 38000.12,
"avg_cost": 41000.45,
"max_cost": 44000.89,
"hashprice": 0.0654,
"block_subsidy": 3.125,
"total_hashrate_eh_s": 678.4,
"ghi_version": "1.0.0",
"methodology_version": "1.0.0",
"api_version": "v1.0",
"engine_version": "v0.4.0-sandbox",
"data_origin": "sandbox",
"stability_seed": 42,
"status": "ok"
}
4. Exemple – GET /v1/ghi/snapshot
curl "http://127.0.0.1:8000/v1/ghi/snapshot"
Réponse typique (extrait) :
{
"start_date": "2025-12-08",
"end_date": "2025-12-08",
"currency": "USD",
"ghi_version": "1.0.0",
"methodology_version": "1.0.0",
"count": 1,
"data": [
{
"date": "2025-12-08",
"min_cost": 38000.12,
"avg_cost": 41000.45,
"max_cost": 44000.89
}
],
"api_version": "v1.0",
"engine_version": "v0.4.0-sandbox",
"data_origin": "sandbox",
"stability_seed": 42
}
5. Métadonnées moteur (Sandbox Engine v0.4.0)
Toutes les réponses GHI v1.0 exposent les champs de métadonnées suivants :
api_version: version de l’API publique (ex.v1.0).methodology_version: version de la méthodologie (ex.1.0.0).engine_version: version du moteur (ex.v0.4.0-sandbox).data_origin: origine des données (sandboxpour la démo).stability_seed: entier technique garantissant la stabilité des données factices.
6. Documentation complète
GHI API v1.0 – Quickstart
This page explains how to call the public GHI API using the Sandbox Engine v0.4.0, which provides deterministic demo data.
1. Base URL
Locally, using the sandbox engine:
http://127.0.0.1:8000/v1/ghi
2. Main endpoints
GET /v1/ghi/indicator: daily global indicator (min / avg / max).GET /v1/ghi/snapshot: structured snapshot following GHI v1.0.
3. Example – GET /v1/ghi/indicator
curl "http://127.0.0.1:8000/v1/ghi/indicator"
Typical response (excerpt):
{
"date": "2025-12-08",
"currency": "USD",
"min_cost": 38000.12,
"avg_cost": 41000.45,
"max_cost": 44000.89,
"hashprice": 0.0654,
"block_subsidy": 3.125,
"total_hashrate_eh_s": 678.4,
"ghi_version": "1.0.0",
"methodology_version": "1.0.0",
"api_version": "v1.0",
"engine_version": "v0.4.0-sandbox",
"data_origin": "sandbox",
"stability_seed": 42,
"status": "ok"
}
4. Example – GET /v1/ghi/snapshot
curl "http://127.0.0.1:8000/v1/ghi/snapshot"
Typical response (excerpt):
{
"start_date": "2025-12-08",
"end_date": "2025-12-08",
"currency": "USD",
"ghi_version": "1.0.0",
"methodology_version": "1.0.0",
"count": 1,
"data": [
{
"date": "2025-12-08",
"min_cost": 38000.12,
"avg_cost": 41000.45,
"max_cost": 44000.89
}
],
"api_version": "v1.0",
"engine_version": "v0.4.0-sandbox",
"data_origin": "sandbox",
"stability_seed": 42
}
5. Engine metadata (Sandbox Engine v0.4.0)
All GHI v1.0 responses expose a small metadata block:
api_version: public API version (e.g.v1.0).methodology_version: methodology version (e.g.1.0.0).engine_version: engine implementation version (e.g.v0.4.0-sandbox).data_origin: data origin (sandboxfor demo data).stability_seed: technical seed ensuring deterministic fake data.