> 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/hapi.md).

# Humanitarian API

### Introduction

The HDX Humanitarian API (HAPI) provides access to standardized humanitarian indicators from multiple sources through a single API so you can automate workflows, analysis, and visualizations. Our initial coverage aligns with the data included in the [HDX Data Grids](https://data.humdata.org/dashboards/overview-of-data-grids). HDX HAPI is designed for developers, researchers and anyone interested in accessing a centralized source of humanitarian data for analysis and decision-making.&#x20;

HAPI is a REST API. Like most web-based APIs it follows Representational State Transfer principles, so you can use it from any programming language or tool that can make an HTTP request. HAPI is currently in beta.

### How HAPI relates to the other HDX APIs

HAPI is one of the portfolio of HDX APIs. The [Metadata endpoints](https://docs.humdata.org/build/hdx-apis/metadata-endpoints) return metadata about datasets on HDX, such as who published a dataset and when. HAPI returns the data values inside those datasets in a standard way.

The [Tabular Data Endpoints](https://docs.humdata.org/build/hdx-apis/tabular-data-endpoints) let you query the contents of one tabular resource in detail. HAPI goes a step further by standardizing selected indicators across many HDX sources so they can be combined and compared.

Use HAPI when you want interoperable indicators across multiple sources and locations. This is data maintained by HDX through standardized HAPI pipelines. Use the Tabular Data Endpoints when you want to query a single specific resource which is directly from a contributor, not standardized HAPI data.

### Building a HAPI query

Every HAPI query combines four things: the base URL, a theme, an app identifier, and optional filters that narrow the results.

<figure><img src="/files/y6FSOUp6TQnEYz0tfDJG" alt=""><figcaption></figcaption></figure>

`https://hapi.humdata.org/api/v2/coordination-context/operational-presence?app_identifier={your_app_identifier}&location_code=AFG`

\
The following pages explain where to find the themes and filters, how to generate an app identifier, and how to page through results.

### Full reference and tutorials

This page set is a practical guide. For the complete, always-current list of endpoints and fields, see the API reference page and the interactive sandbox at [hapi.humdata.org/docs](https://hapi.humdata.org/docshttps://hapi.humdata.org/docs).&#x20;

For longer tutorials and per-theme data usage guides, see the full HAPI documentation at [hdx-hapi.readthedocs.io](https://hdx-hapi.readthedocs.io/en/latest/).

### Feedback and support

HAPI is in beta and we are seeking feedback. To report a bug or request a feature or indicator, email <hdx@un.org>.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.humdata.org/build/hdx-apis/hapi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
