# Finding and downloading data

## Available data

File download access is available for all public data on HDX. Any dataset resource that exposes a `download_url` can be retrieved programmatically, regardless of whether the data is tabular, geospatial, or provided in another file format like zip folders.

This includes CSV and Excel files, geospatial formats, zipped folders, and other common data files hosted on HDX, as well as redirect you to from resources that have externally hosted data. Availability and structure varies by data contributor, and datasets may include multiple resources with different formats or purposes.

## Finding and downloading data

Data on HDX can be discovered either through the web interface or programmatically via the metadata API endpoint (`package_search`). Both approaches reference the same underlying data.

### Finding the data via the HDX UI

You can identify downloadable files directly from HDX .

Navigate to a dataset page on HDX. Each dataset lists one or more resources which contain the data itself. For each resource, you will see the resource name, file format, and a Download button.

Select the resource you want to work with by clicking the three dots button, screenshot below, and then “**Preview on HDX**”. The first data resource is often a reasonable choice, but this is not guaranteed, especially for datasets with multiple file types or mixed schemas.

<div data-with-frame="true"><figure><img src="/files/I3wOsQnEsvHLy8YK0hd3" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/pjiGCYoCsAx4PY81kuDi" alt=""><figcaption></figcaption></figure></div>

Once on the preview page, the URL listed is the file download endpoint for that particular resource.

<div data-with-frame="true"><figure><img src="/files/Izx0m2EKDNZUb8MgcIZw" alt=""><figcaption></figcaption></figure></div>

### Finding the data via the HDX Metadata API

Downloadable file URLs can also be discovered programmatically using the HDX metadata endpoints.

Query the dataset metadata endpoint (`package_show` or `package_search`) to retrieve the dataset object. In the response, inspect the `resources` array. Each entry represents a single resource and includes metadata such as `id`, `name`, `format`, and `download_url`.

Identify the resource that corresponds to the data file you want to retrieve. Datasets may include multiple resources, such as data files or codebooks. Once identified, use the `download_url` field from that resource object to download the file programmatically.

See example below for the package\_show query using the [Global Pcodes dataset](https://data.humdata.org/dataset/global-pcodes) on HDX. `https://data.humdata.org/api/action/package_show?id=global-pcodes`

<div data-with-frame="true"><figure><img src="/files/krj5olDMTAAPG9WHrtnX" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.humdata.org/build/hdx-apis/file-download-endpoint/finding-and-downloading-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
