Overview
What the Data API is, how data is organised into namespaces, tables and files, and a live, hands-on quickstart.
Last updated on
The Data API is a public HTTP interface for reading open data published on the
Lithuanian Data Portal. It exposes the portal's data lake — Apache Iceberg
tables and stored files: browse namespaces and read schemas with GET, then
query or export table rows with POST, returning JSON, NDJSON, CSV, Excel
or Parquet.
Read-only and public
No authentication is required — there are no API keys, tokens or OAuth scopes.
Catalogue and file reads are GET; table queries and exports are POST
with a JSON body (the API is still read-only — POST only carries the query
definition). All examples use the base URL https://api.dataportal.gov.lt and
real, live data.
Throughout these guides we use one real dataset — Toxicological test results in death cases (Higienos institutas) — so every example is copy‑pasteable:
| Parameter | Type | Description |
|---|---|---|
Namespace | 111958286 | The publishing organisation (Higienos institutas company code). |
Table | mirusiuju_toksikologinis_rezultatas | 22,143 rows, 14 columns. |
Try it live
Pick columns, set a filter, sort and page — then Run to call the real API from your browser. The request is proxied by the docs site so it works despite the API not sending CORS headers.
curl -X POST 'https://api.dataportal.gov.lt/namespaces/111958286/tables/mirusiuju_toksikologinis_rezultatas/query' \
-H 'Content-Type: application/json' \
-d '{"limit":5,"select":"pavadinimas,lytis,mirties_metai,amziaus_grupe,mirties_priezastis","sort":"mirties_metai"}'| lytis | amziaus_grupe | mirties_metai | pavadinimas | mirties_priezastis |
|---|---|---|---|---|
| Moteris | 65_69 | 2021 | Etanolis (etilo alkoholis) | Kita |
| Moteris | 65_69 | 2018 | Karboksihemoglobinas | Atsitiktiniai apsinuodijimai |
How data is organised
The API has three kinds of resource:
-
Namespace — a container, identified by a dot-separated path. Here the namespace is the publisher's company code,
111958286. A namespace holds child namespaces, tables and files, so the catalogue forms a tree you can walk from the root down. -
Table — an Iceberg table you can inspect (its schema), query row by row as JSON, or export in bulk as NDJSON, JSON, CSV, Excel or Parquet.
-
File — a stored object (PDF, image, archive, …) served straight from object storage.
111958286- mirusiuju_toksikologinis_rezultatasschemaqueryexport
- gimimasschemaqueryexport
- many more tables
- report.pdfdownload
What you can do
| Parameter | Type | Description |
|---|---|---|
List the root namespaces | GET /namespaces | listNamespaces → |
Browse one namespace | GET /namespaces/{namespace} | getNamespace → |
Inspect a table's schema | .../tables/{table}/schema | getTableSchema → |
Read rows as JSON | POST .../tables/{table}/query | queryTable → |
Export a table | POST .../tables/{table}/export | exportTable → |
Download a file | .../files/{fileName} | downloadFile → |
Quickstart
List the root namespaces
GET/namespacescurl 'https://api.dataportal.gov.lt/namespaces'{ "success": true, "data": { "namespaces": ["111958286", "188774975", "…"] } }Drill into a namespace
See its child namespaces, tables and files.
curl 'https://api.dataportal.gov.lt/namespaces/111958286'{
"success": true,
"data": {
"current_namespace": "111958286",
"child_namespaces": [],
"tables": ["mirusiuju_toksikologinis_rezultatas", "gimimas", "…"],
"files": []
}
}Inspect the table schema
Learn the column names and types before you query.
curl 'https://api.dataportal.gov.lt/namespaces/111958286/tables/mirusiuju_toksikologinis_rezultatas/schema'Query rows
Send a JSON body asking for the first 5 rows, newest first, keeping a few columns:
curl -X POST 'https://api.dataportal.gov.lt/namespaces/111958286/tables/mirusiuju_toksikologinis_rezultatas/query' \
-H 'Content-Type: application/json' \
-d '{"limit":5,"sort":"-mirties_metai","select":"lytis,mirties_metai,pavadinimas"}'{ "data": [ /* … 5 rows … */ ], "total": 22143, "total_pages": 4429, "current_page": 1 }Export in bulk
When you want the whole result set as a file rather than paged JSON — the export
endpoint takes the same body plus a format query parameter:
curl -L -o toksikologija.ndjson \
-X POST 'https://api.dataportal.gov.lt/namespaces/111958286/tables/mirusiuju_toksikologinis_rezultatas/export?format=ndjson' \
-H 'Content-Type: application/json' \
-d '{}'Response format
Catalogue and schema endpoints wrap their payload in a { success, data }
envelope. The query endpoint is different — it returns the rows plus
offset-based pagination metadata, with no success wrapper:
{ "success": true, "data": { "…": "…" } }{ "data": [ /* rows */ ], "total": 22143, "total_pages": 4429, "current_page": 1 }A raw byte stream — NDJSON / JSON / CSV / Parquet, or the file's own content type — not JSON.
Errors carry an error_code and a message. See Errors
for the exact shapes and status codes (400, 404, 502, 503, 504).
Where to next
Concepts
Namespaces, tables, files, Iceberg schemas and snapshots explained.
Querying tables
select, filter, sort and offset pagination — with the real grammar.
Downloading data
NDJSON / JSON / CSV / Excel / Parquet output via the export endpoint.
Recipes
Copy-paste solutions: count, filter, page, export.
Errors
Status codes and the error shapes the API returns.
See also
How is this guide?