# How catalogue records relate to data (https://guides.dataportal.gov.lt/docs/api/guides/concepts)



## Collections and records [#collections-and-records]

The catalogue groups records into four collections. Call `GET /v1/collections` for their names and current record counts.

<ParamTable
  columns="[&#x22;Collection&#x22;, &#x22;Record ids&#x22;, &#x22;What it holds&#x22;]"
  lang="en"
  params="[
  { name: &#x22;datasets&#x22;, type: &#x22;sd… · od…&#x22;, description: &#x22;Official and experimental statistics (sd000021…) and open data (od000966…).&#x22; },
  { name: &#x22;classifications&#x22;, type: &#x22;cl…&#x22;, description: &#x22;Code lists and statistical classifications, e.g. EVRK (cl000042).&#x22; },
  { name: &#x22;reuses&#x22;, type: &#x22;dr…&#x22;, description: &#x22;Examples of how published data has been used: apps, visualizations, studies.&#x22; },
  { name: &#x22;organizations&#x22;, type: &#x22;company code&#x22;, description: &#x22;The organizations that publish data, e.g. 188600177 (State Data Agency).&#x22; },
]"
/>

Each item in a collection is a record. Search results include its `id`, `title` and a `self` link. Request `GET /v1/{collection}/{id}` to read its metadata. See [Searching the catalogue](https://guides.dataportal.gov.lt/docs/api/guides/searching).

<Callout title="Keep the official code, too">
  Portal and API URLs use the catalogue `id`, such as `sd001920`. An official statistics record also has a statistical code in `other_identifier`, such as `S3R167_M3010203`. That code appears in the table name. Keep both identifiers when storing references. See the [example of a search by statistical code](https://guides.dataportal.gov.lt/docs/api/guides/recipes#find-a-dataset-by-its-official-code).
</Callout>

## Distributions and tables [#distributions-and-tables]

Check the record’s `distribution` array for ways to access the data. In a statistical dataset, each language has its own distribution and table.

<ParamTable
  columns="[&#x22;Field&#x22;, &#x22;Example&#x22;, &#x22;What it is&#x22;]"
  lang="en"
  params="[
  { name: &#x22;identifier&#x22;, type: &#x22;sdr001920_en&#x22;, description: &#x22;The distribution's id, used in the schema routes.&#x22; },
  { name: &#x22;table_id&#x22;, type: &#x22;S3R167_M3010203_en&#x22;, description: &#x22;The table that holds the data.&#x22; },
  { name: &#x22;links.schema&#x22;, type: &#x22;GET&#x22;, description: &#x22;The table's columns as the catalogue describes them.&#x22; },
  { name: &#x22;links.query&#x22;, type: &#x22;POST&#x22;, description: &#x22;The table's rows: /v1/data/organizations/{id}/tables/{table}/query.&#x22; },
  { name: &#x22;access_url&#x22;, type: &#x22;string[]&#x22;, description: &#x22;The same data at the older /namespaces address.&#x22; },
]"
/>

Data reuses often point to an external application or visualisation. Follow `access_url` to open the published resource.

## Organizations hold the data [#organizations-hold-the-data]

Stored tables and files belong to the organization that published them, under its
company code. The same code identifies the organization in the metadata
(`/v1/organizations/188600177`), in the data routes
(`/v1/data/organizations/188600177/…`) and in the older routes (`/namespaces/188600177/…`).

<CatalogueTree
  organization="188600177"
  org="State Data Agency"
  tables="[
  { name: &#x22;S3R167_M3010203_en&#x22; },
  { name: &#x22;S3R167_M3010203_lt&#x22; },
]"
  more="… and the agency's other tables"
/>

Call `GET /v1/data/organizations` to list organisations with stored data. Use `…/{id}/tables` or `…/{id}/files` to see what an organisation holds.

## Two schemas [#two-schemas]

The distribution schema and the storage schema describe the same columns. Choose the schema according to what you need to know about each column.

<EndpointTable
  lang="en"
  heading="Schema"
  endpoints="[
  { task: &#x22;Distribution schema&#x22;, note: &#x22;The catalogue's view: each column's id, human title, data type and number of distinct values, with a link to list those values. Use it to understand a table and to build filters.&#x22;, method: &#x22;GET&#x22;, path: &#x22;/v1/datasets/{id}/distributions/{distribution_id}/schema&#x22; },
  { task: &#x22;Table schema&#x22;, note: &#x22;The storage view: field names and types (string, double, long, …) straight from the table. Use it when you only have a table name.&#x22;, method: &#x22;GET&#x22;, path: &#x22;/v1/data/organizations/{id}/tables/{table}/schema&#x22; },
]"
/>

Statistical tables typically contain the following kinds of column.

<ParamTable
  columns="[&#x22;Column&#x22;, &#x22;Type&#x22;, &#x22;What it holds&#x22;]"
  lang="en"
  params="[
  { name: &#x22;dimensions&#x22;, type: &#x22;string&#x22;, description: &#x22;One column per breakdown, e.g. administrative_territory, sex, age_5_year_groups, time_period. Values are labels, such as Panevėžys c. mun.&#x22; },
  { name: &#x22;…_code&#x22;, type: &#x22;string&#x22;, description: &#x22;The official code beside a label column, e.g. administrative_territory_code.&#x22; },
  { name: &#x22;s3r167&#x22;, type: &#x22;double&#x22;, description: &#x22;The value, named after the indicator code.&#x22; },
  { name: &#x22;unit_of_measurement&#x22;, type: &#x22;string&#x22;, description: &#x22;The unit of the value, e.g. persons.&#x22; },
  { name: &#x22;conventional_symbol&#x22;, type: &#x22;string&#x22;, description: &#x22;Why a value is missing or flagged (confidential, provisional, …).&#x22; },
]"
/>

## Languages [#languages]

Choose the metadata language and the table language separately.

* **Metadata** has a `lang` parameter (`lt`, the default, or `en`). It sets the
  language of titles and descriptions in the response, and the language your
  search words are matched in.
* **Data** comes in separate tables per language, ending in `_lt` and `_en`. Their
  **column names and values differ**: `administrative_territory = 'Panevėžys c. mun.'`
  in the English table is `administracine_teritorija = 'Panevėžio m. sav.'` in the
  Lithuanian one. Pick one table and use its names throughout.

## Response shapes [#response-shapes]

<Tabs items="[&#x22;Metadata search&#x22;, &#x22;Metadata record&#x22;, &#x22;Data query&#x22;, &#x22;Data lists and schema&#x22;, &#x22;Export and files&#x22;]">
  <Tab value="Metadata search">
    ```json
    {
      "data": [ { "id": "…", "collection": "datasets", "title": "…", "links": { "self": "…" } } ],
      "meta": { "page": 1, "limit": 24, "total": 193, "total_pages": 9, "has_next": true, "max_result_window": 10000, "window_exceeded": false },
      "links": { "self": "…" }
    }
    ```

    Set `"facets": true` to include a `facets` object in the response.
  </Tab>

  <Tab value="Metadata record">
    The record itself, with no wrapper: `{ "id": "sd001920", "title": "…", "distribution": [ … ], … }`.
    Missing or empty values are left out.
  </Tab>

  <Tab value="Data query">
    ```json
    { "data": [ { "time_period": "2026", "s3r167": 84319.0 } ], "total": 31, "total_pages": 11, "current_page": 1 }
    ```
  </Tab>

  <Tab value="Data lists and schema">
    ```json
    { "data": { "organization": "188600177", "tables": ["…"] } }
    ```

    The table schema adds a success flag: `{ "success": true, "data": { "table_identifier": "…", "schema": { "fields": [ … ] } } }`.
  </Tab>

  <Tab value="Export and files">
    The file itself — CSV, JSON, NDJSON, Parquet or Excel for exports, the stored
    file's own type for files — with a `Content-Disposition` file name.
  </Tab>
</Tabs>

The metadata and data routes return different error structures. See [Errors](https://guides.dataportal.gov.lt/docs/api/guides/errors).

## See also [#see-also]

* [Searching the catalogue](https://guides.dataportal.gov.lt/docs/api/guides/searching)
* [Querying tables](https://guides.dataportal.gov.lt/docs/api/guides/querying)
* [Errors](https://guides.dataportal.gov.lt/docs/api/guides/errors)
