> For the complete documentation index, see [llms.txt](https://docs.humdata.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.humdata.org/build/hdx-apis/file-download-endpoint/finding-and-downloading-data.md).

# Finding and downloading data

Many data resources can be accessed through the file download endpoint

## 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, a More Information button and a Download button.

Select the resource you want to work with by clicking the More Information button, screenshot below. Here you can see, where available, the resource preview, data dictionary and API access information.

<div align="left" data-with-frame="true"><figure><img src="https://1756329736-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYX6VfEjVd6ssH4AU60M%2Fuploads%2FBGVGGAru90DHuL4LzQY6%2FWP%20dataset%20page-data%20and%20resources.png?alt=media&amp;token=08c1fac5-f856-4c12-a48d-03b831520b53" alt="" width="563"><figcaption><p>More Information button location</p></figcaption></figure></div>

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

<div align="left" data-with-frame="true"><figure><img src="https://1756329736-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYX6VfEjVd6ssH4AU60M%2Fuploads%2Fk5waYU5nuGuywW8Ln6fw%2FBuild-resource-preview.png?alt=media&amp;token=14544d06-046b-412a-ae7e-449b62043a9c" alt="" width="563"><figcaption><p>Resource preview</p></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 align="left" data-with-frame="true"><figure><img src="https://1756329736-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPYX6VfEjVd6ssH4AU60M%2Fuploads%2FXN4Q91KzMvrbyQdIjKvz%2Funknown.png?alt=media&amp;token=ca59f345-6f0f-4ccd-8219-c539ac0daf13" alt="" width="563"><figcaption><p>Global Pcodes example</p></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
