API Reference

The AbiaGateway API

A clean, predictable REST API over Abia State’s official statistics. Every endpoint speaks JSON by default, supports CSV/XML/SDMX, and is authenticated with a single header.

🔗

Base URL: https://api.sdh.central.abiastatistics.com/v1  •  Auth header: X-API-Key: your_key  •  Default format: JSON (add ?format=csv for CSV)

Step 1

Authentication

Every request must include your API key in the X-API-Key header. Keys are issued instantly on registration and are scoped to your subscription tier.

Authenticated request
curl -X GET "https://api.sdh.central.abiastatistics.com/v1/datasets" \ -H "X-API-Key: asbs_fre_your_key"
import requests session = requests.Session() session.headers["X-API-Key"] = "asbs_fre_your_key" r = session.get("https://api.sdh.central.abiastatistics.com/v1/datasets") r.raise_for_status() data = r.json()
const api = (path) => fetch("https://api.sdh.central.abiastatistics.com/v1" + path, { headers: { "X-API-Key": "asbs_fre_your_key" } }).then(r => r.json());
🔐

Keep your key secret. Never expose it in client-side code or public repositories. For browser apps, proxy requests through your own backend, or use OAuth 2.0 (Professional+).

Step 2

Core endpoints

Six endpoints cover discovery, search and metadata. All are GET except registration.

MethodEndpointDescription
GET/v1/datasetsList all datasets (paginated)
GET/v1/datasets/{id}Retrieve a single dataset
GET/v1/datasets/searchFull-text search across datasets
GET/v1/organisationsGovernment organisations & MDAs
GET/v1/topicsBrowse by sector / topic
GET/v1/statsGateway-wide statistics
POST/v1/registerRegister a developer account
Step 3

Pagination & filtering

List endpoints accept page, per_page (max 100), sector and format. Responses include a total and page for easy iteration.

Paginated + filtered
# Page 2, 50 per page, agriculture only, as CSV curl "https://api.sdh.central.abiastatistics.com/v1/datasets?sector=agriculture&page=2&per_page=50&format=csv" \ -H "X-API-Key: asbs_fre_your_key" # JSON response shape { "data": [ ... 50 items ... ], "total": 63, "page": 2, "per_page": 50 }
💡

Tip — iterate safely. Loop while page * per_page < total. Respect your tier’s rate limit by adding a short delay between pages, or request per_page=100 to minimise round-trips.

Step 4

Errors & rate limits

The API uses conventional HTTP status codes. Errors return a JSON body with a machine-readable error and human-readable message.

StatusMeaningWhat to do
200OKSuccess
400Bad requestCheck your query parameters
401UnauthorisedMissing or invalid API key
403ForbiddenDataset not in your tier
404Not foundUnknown dataset / endpoint
429Too many requestsBack off; check Retry-After

Handling 429s. When rate-limited, the response includes a Retry-After header (seconds). Implement exponential backoff, or upgrade your plan for higher limits.

Build your first integration

Follow the step-by-step Quickstart, or jump straight in with a free key.

📚 Open the Quickstart