# Download or export data (https://guides.dataportal.gov.lt/docs/guide/browsing-data/downloading)



Select **Export** in the table header. In the same window, you can download a file or copy an API request to use in your own program.

![The Export dataset window on the Download tab, numbered 1–4: 1 Download and API endpoint tabs; 2 export format list (JSON selected); 3 scope — All data (390 rows) or Filtered data (13 rows); 4 Download button](https://guides.dataportal.gov.lt/guide/atsisiuntimas-eksportas-v2-en.png)

1. The **Download** and **API endpoint** tabs.
2. **Export format** — *JSON* is selected to start with.
3. **Scope** — **All data** or **Filtered data**; the row count is in brackets.
4. The **Download** button.

## Formats [#formats]

| Format      | When to choose it                                                                                                                          |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **CSV**     | The most universal. Opens in *Excel*, *LibreOffice*, *Google Sheets*.                                                                      |
| **XLSX**    | A native *Excel* workbook — opens straight in *Microsoft Excel*. Capped at 1,000,000 rows: filter larger tables, or choose CSV or Parquet. |
| **JSON**    | When a program or script will process the data.                                                                                            |
| **NDJSON**  | Newline-delimited JSON — one record per line, handy for streaming or reading large files line by line.                                     |
| **Parquet** | For large volumes and analysis with *Python*, *R* or data tooling.                                                                         |

The default format is **JSON**. Choose **CSV** or **XLSX** if you plan to open the file in a spreadsheet.

## Downloading a file [#downloading-a-file]

<Steps>
  <Step>
    ### Open export [#open-export]

    Select **Export** to open the **Export dataset** window on the **Download** tab.
  </Step>

  <Step>
    ### Pick the format [#pick-the-format]

    Under **Export format**, choose JSON, NDJSON, CSV, Parquet or XLSX. The table above explains when to use each format.
  </Step>

  <Step>
    ### Pick the scope [#pick-the-scope]

    The default option, **All data**, includes every row. If you have applied [filters](https://guides.dataportal.gov.lt/docs/guide/browsing-data/table#row-filters) and want only the matching rows, select **Filtered data**.
  </Step>

  <Step>
    ### Download [#download]

    Select **Download** to save the file to your computer.
  </Step>
</Steps>

<span id="fetching-it-through-the-api" className="ldp-anchor" />

## Copy an API request [#copy-an-api-request]

Open **API endpoint** in the same window to copy a request you can run locally.

![The API endpoint tab, numbered 1–4: 1 language choice, cURL or Python; 2 the ready-made request to api.dataportal.gov.lt with limit and offset; 3 scope — Filtered data (13 rows) selected; 4 Copy button](https://guides.dataportal.gov.lt/guide/atsisiuntimas-api-en.png)

1. **Language** — *cURL* (for the command line) or *Python* (with the `requests` library).
2. **The request** — the address and the request body.
3. **Scope** — with **Filtered data** selected, the table's filters are written into the request.
4. **Copy** — copies the request.

This example selects 2024 data from the table of gross monthly earnings of employees paid from budgets, broken down by county.

```bash
curl -X POST "https://api.dataportal.gov.lt/namespaces/188600177/tables/S3R640_M3060807_1_en/query" \
  -H "Content-Type: application/json" \
  -d '{
  "limit": 24,
  "offset": 0,
  "filter": "time_period._co=2024"
}'
```

* `188600177` is the publisher's code and `S3R640_M3060807_1_en` the table name (the `_en` or `_lt` ending sets the language).
* `filter` holds the table's filters; it appears only with **Filtered data** selected. It uses the columns' API names, which differ by language: `time_period` in the English table, `laikotarpis` in the Lithuanian one.
* `limit` and `offset` set how many rows to return and where to start.
* The portal writes the original `/namespaces/…` address. The same request also works at `/v1/data/organizations/188600177/tables/…/query`, the address used in the [Public API documentation](https://guides.dataportal.gov.lt/docs/api/guides/migrating).

<Callout title="The request returns only one page">
  The generated request uses `"limit": 24`, so it returns at most 24 rows. Read `total` for the number of matching rows (13 in this example). For larger results, increase `limit` (up to 100,000), for example to `1000`, or request successive pages with `offset`. To get every matching row as a file, change `query` to `export` at the end of the address and remove `limit` ([Export data](https://guides.dataportal.gov.lt/docs/api/guides/downloading)).
</Callout>

In the JSON response, `data` contains the rows. The keys are the columns’ [API names](https://guides.dataportal.gov.lt/docs/guide/browsing-data/table#structure). The fields `total`, `total_pages` and `current_page` describe pagination.

<Tips>
  * **For regular use, reach for the API.** The full set of query options — filtering, sorting, column selection and paging — is covered in the [Public API documentation](https://guides.dataportal.gov.lt/docs/api).
</Tips>
