← LMGNT Exchange
API CONTRACT · V1

Seven days. Six fields.

Use your existing Bearer credential. Each organization may make two successful new exports per Bangkok calendar day. JSON and CSV share the limit.

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.

Response

JSON is a bare array of rows. CSV uses the same six columns, in this order:

price_date,country_code,country_name,product_code,thb_per_liter,fx_date

Prices are numeric THB per litre. JSON has no schema/metadata wrapper or extra row properties. Unavailable, inapplicable or withheld prices and FX dates are null in JSON and empty in CSV. EX does not fill missing dates or change source/FX rules.

Quota and retries

Quota, reset time, dates, revision and replay status remain in HTTP headers. Detailed operational metadata is Base64-encoded UTF-8 JSON in X-LMGNT-Metadata for either format; it is not included in the downloaded data body.

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

Status checks do not consume export quota. Reuse the same Idempotency-Key and format for retries. Successful requests can be replayed for 24 hours without a new charge. Existing request keys and cached datasets are projected to the same six-field output after this update.

Access

Source approval, expiry, revocation and organization quotas still apply. Credentials stay out of URLs. Admin access requires the separately verified Cloudflare Access identity.

Errors

Error responses retain their structured error code and request ID: 400/406 invalid input, 401 credential, 403 denied access, 404 no authorized data, 409 idempotency conflict, 429 quota/rate limit, 503 data or operational dependency unavailable.