← LMGNT Exchange
API CONTRACT · V1

Seven calendar days.
One controlled request.

Bearer credentials have the prices:read scope. Each organization may make two successful new exports per Bangkok calendar day. JSON and CSV share that limit, across all credentials and portal/API access.

Download OpenAPI 3.1 JSON

Export

GET /api/v1/prices/latest?days=7&format=json
Authorization: Bearer <EX_TOKEN>
Idempotency-Key: <CLIENT_GENERATED_UUID>

Use format=csv for CSV. The latest approved canonical date ends the seven-calendar-day window. Missing dates and products have explicit statuses and null prices; EX never silently forward-fills.

Quota and recent request status

GET /api/v1/quota
GET /api/v1/requests/recent

These authenticated endpoints do not consume export quota. The quota endpoint includes client identity, remaining requests, reset time, and dataset availability dates—not protected price values.

Safe retries

Send a unique Idempotency-Key for each intended new export. Reuse the same key, format, and client identity for a retry. A successful response can be replayed for 24 hours without charging again, including across midnight and credential rotation. Changing format or approval policy with the same key returns 409. Without a key, EX creates one and returns it in the response header; it cannot deduplicate retries that arrive with a new key.

A charged request means the server prepared and committed an HTTP 200 response. Network delivery cannot be confirmed. After an uncertain network or commit error, retry the original key; do not invent a new one.

Response metadata

JSON contains dataset_start, dataset_end, latest_available_date, generated_at, data_revision, snapshot_id, seven-date coverage, quota_remaining and quota_reset_at. CSV carries the same metadata as Base64-encoded UTF-8 JSON in X-LMGNT-Metadata; date/revision/quota headers are also provided. CSV null fields are empty cells.

Observation semantics

OBSERVED_CANONICAL is a saved, approved canonical observation. CANONICAL_PRIOR_SOURCE_DATE indicates that the canonical row refers to an earlier source effective date; EX did not fill it. DATE_NOT_APPROVED and MISSING have no price values. NOT_APPLICABLE identifies a product that was not yet available under the existing canonical policy. WITHHELD_SOURCE_UNIDENTIFIED means neither the stored source key nor the canonical country/name/URL tuple can be identified by the EX registry. WITHHELD_SOURCE_NOT_APPROVED means redistribution has not been approved for that source.

Source identity in v1.0.1

source_key always preserves the canonical database value and may remain null. The added distribution_source_key is the identifier checked against the EX source allowlist. When the native key is absent, EX requires a matching country, source name and publication URL in its versioned registry. source_resolution states whether the identity came from the native key or canonical source metadata. Recognition does not approve redistribution; the explicit allowlist and release flags still apply. No canonical source key, fuel price or FX record is updated.

Errors

HTTPMeaning
400 / 406Invalid request, window, key or format
401Missing, invalid, expired or revoked credential
403Suspended organization, forbidden origin, or admin authorization denied
404No approved data or unsupported endpoint
409Idempotency conflict or expired request
429Daily quota or edge abuse limit; inspect Retry-After
503Release approval, upstream or operational dependency unavailable

Security

Never put credentials in URLs. Use HTTPS. Admin privileges require a separately verified Cloudflare Access identity and operator allowlist. Consumer credentials never authorize administration. Do not redistribute third-party source data without permission.