Use the REST API when you want imibare data from any language or tool that can make HTTP requests.
The base URL is https://api.imibare.org; every route begins with /v1/, returns JSON unless it
downloads a file, allows cross-origin requests, and needs no authentication.
Choose an endpoint
The API separates discovery from data transfer so you do not need to download a whole dataset just to learn its columns. Start with the endpoint that matches the job you have to do.
| If you want to | Request | Why this endpoint |
|---|---|---|
| List or filter catalog records | GET /v1/datasets | Returns public metadata for every matching dataset |
| Inspect 1 dataset | GET /v1/datasets/{id} | Adds schema, source, history, and live update fields |
| Download all current rows | GET /v1/data/{id}/download | Streams Parquet, CSV, or JSON |
| Explore rows or filter them | GET /v1/data/{id}/preview | Returns a bounded JSON page |
| Search the catalog | GET /v1/search?q={query} | Searches names, IDs, institutions, notes, and tags |
| Check scheduled pipelines | GET /v1/status | Returns run history and correction or outage notes |
List datasets
GET /v1/datasets returns all published dataset records. Add query parameters to narrow the list
before you decide which ID to download.
| Parameter | Type | Meaning |
|---|---|---|
country | string | ISO 3166-1 alpha-2 code, such as RW or KE; matching ignores case |
institution | string | Institution slug, such as nisr or knbs |
topic | string | Metadata topic, such as prices |
frequency | string | Frequency slug, such as monthly |
pipeline | string | automated, curated, or stale |
A successful response has a datasets list and a meta object. meta.total is the number of
records after filtering, while meta.filters echoes the filters the request used.
# Every published dataset
curl https://api.imibare.org/v1/datasets
# Kenyan datasets
curl "https://api.imibare.org/v1/datasets?country=KE"
# Monthly price datasets
curl "https://api.imibare.org/v1/datasets?topic=prices&frequency=monthly"
Inspect a dataset
GET /v1/datasets/{id} returns the complete current record for 1 dataset. Use it before analysis
when you need the publisher’s source link, the column definitions, or the version you are citing.
GET /v1/datasets/rw.nisr.cpi.monthly
Read the record
| Field | Meaning |
|---|---|
id | Permanent 4-segment dataset ID |
country, country_name | Country code and display name |
name | Dataset name |
institution, institution_slug | Publishing institution and its slug |
topic, frequency | Metadata category and publication cadence |
coverage_start, coverage_end | First and last published period |
pipeline | automated, curated, or stale |
source_url, source_format | Original publication and its file or service type |
columns | Array of name, type, description, and optional unit |
formats | Available download formats: parquet, csv, and json |
license, license_basis, license_url | What the publisher states about reuse and where we found it |
last_updated | Date the data last changed |
last_checked | Date the pipeline last checked the source, even if the data did not change |
version | Identifier for the newest published data version |
versions | Version history, newest first, with row counts and file sizes |
notes | Source quirks, gaps, or extraction notes |
last_updated and last_checked are deliberately different. A source can be checked today without
publishing new data, and treating the check date as an update would make the record misleading.
A missing ID returns 404 Not Found with an error field. The record may also include catalog-page
presentation fields, such as finding, which can change without altering the data.
curl https://api.imibare.org/v1/datasets/rw.nisr.cpi.monthly
Download the current file
GET /v1/data/{id}/download streams the latest published version. Use it for an analysis or a
local archive, because /preview is designed for inspection rather than bulk transfer.
| Parameter | Type | Default | Meaning |
|---|---|---|---|
format | string | parquet | Choose parquet, csv, or json |
The default Parquet response is application/octet-stream, CSV is text/csv, and JSON is
application/json. Every download carries an ETag, so send it in If-None-Match when you want
the server to reply 304 Not Modified without another file transfer.
# Latest Parquet file
curl -L -o rw.nisr.cpi.monthly.parquet "https://api.imibare.org/v1/data/rw.nisr.cpi.monthly/download"
# Current CSV file
curl -L -o cpi.csv "https://api.imibare.org/v1/data/rw.nisr.cpi.monthly/download?format=csv"
An unsupported format returns 400 Bad Request with the requested format and the allowed formats.
An unknown dataset, or a known dataset without published rows, returns 404 Not Found with an
error field and, where available, the dataset_id.
Preview and filter rows
GET /v1/data/{id}/preview returns the latest rows as JSON. Use it for a chart, a small inspection,
or a filtered result; use the download route when you need the entire dataset.
| Parameter | Type | Default | Meaning |
|---|---|---|---|
limit | integer | 5000 | Maximum rows to return; values above 5000 are capped |
offset | integer | 0 | Number of matching rows to skip |
distinct | string | none | Return sorted distinct text values for this column instead of rows |
| Any column name | string | none | Keep rows with that value; repeat a parameter to match any of several values |
A row response contains id, rows, count, total, offset, and limit. count is the
size of this page, while total is the number of rows that matched before pagination.
# The first 2 rows of the general CPI series
curl "https://api.imibare.org/v1/data/rw.nisr.cpi.monthly/preview?category=general_index_(cpi)&limit=2"
# Every category used by CPI
curl "https://api.imibare.org/v1/data/rw.nisr.cpi.monthly/preview?distinct=category"
With distinct, the response replaces rows with values and reports their count. A filter or
distinct column that the dataset does not have returns 400 Bad Request and names the available
filterable columns.
Search the catalog
GET /v1/search performs case-insensitive full-text search. Pass a non-empty q parameter, and
we search dataset IDs, names, country codes and names, institutions, topics, notes, and tags.
curl "https://api.imibare.org/v1/search?q=exchange+rate"
A successful response contains results, the original query, and total. Each result is a
compact dataset record with its ID, name, country, institution, topic, frequency, and pipeline
state.
A request without q returns 400 Bad Request with {"error": "q parameter is required"}. Search
is for discovery, so use GET /v1/datasets/{id} after you choose a result.
Check pipeline status
GET /v1/status reports the health of scheduled scrapers over a rolling window. It powers the
status page, but it is useful in automated checks too.
| Field | Meaning |
|---|---|
generated_at | When we generated this status record |
window_days | Number of days covered by the run history |
scrapers | Each scheduled pipeline’s ID, institution, schedule, last run, next expected run, and history |
uptime_pct | Share of scheduled runs that succeeded in the window |
fails, degraded | Counts of failed and degraded runs |
incidents | Dated corrections and source-outage notes |
uptime_pct measures whether the source could be read on schedule, not whether the API itself was
available. Read incidents when a series changes unexpectedly, because the note may explain a
source correction or interrupted run.
Handle errors, caching, and limits
All errors use JSON with an error field and may add context such as dataset_id. The status code
tells you whether to change your request, choose another dataset, or retry later.
| Status | Meaning |
|---|---|
400 Bad Request | Invalid dataset ID, format, column, or missing required parameter |
404 Not Found | Dataset is absent, has no published data yet, or the route is unknown |
503 Service Unavailable | The API could not read the data from storage |
Successful catalog and data responses are cacheable for up to 1 hour. Errors are never cached, and the status response uses its own shorter cache policy because the state can change more quickly.
The API is public infrastructure, so download a file once and cache it rather than paging through
/preview for a full dataset. We may rate-limit sustained heavy traffic to keep the service useful
for everyone.