# Tools and notebook

## Integration with tools

The Tabular Data Endpoints can be integrated into various tools to enable automated, repeatable data retrieval and analysis workflows. See examples below.&#x20;

Don’t see your tool listed but want help? Let us know by emailing [hdx@un.org](mailto:undefined)!

### Power BI

Follow this section to connect HDX’s Tabular Data endpoints to PowerBI as a data source. This can also be used as a Power Query in other Microsoft tools, such as Fabric

1. **Open PowerBI Desktop.** Within the PowerBI Desktop application (not the web version), go to Home → Get data. Select “Blank Query”. This will open the Power Query Editor window.

   <figure><img src="/files/olGurlQilE3vOXq2T8Zj" alt=""><figcaption></figcaption></figure>
2. **Open Blank Query.** Click “Advanced Editor” in the top rail.

   <figure><img src="/files/HFHFUr0rA3vf2n9kdzVe" alt=""><figcaption></figcaption></figure>
3. **Paste PowerQuery with Custom Fields.** In the editor, copy and paste this[ PowerQuery](https://github.com/OCHA-DAP/hdx-tabular-data-endpoints-notebook/blob/main/power_query.txt) M script. You must replace the following with your own information.

   1. `BaseUrl` (Endpoint)
   2. `ResourceID`
   3. `ApiToken` (Your own HDX API token)

   <figure><img src="/files/vTeIrGwRsDgtTs3kd81D" alt=""><figcaption></figcaption></figure>
4. **Set the connection to Anonymous.** If prompted for credentials, choose “Anonymous”. If no prompt appears but there is an error, ensure you go to File → Options and settings → Data source settings. Find the entry for your data and clear permissions. Re-run the query which should prompt you to choose Anonymous.
5. **Apply the Query.** Once the preview loads in the Power Query Editor, click “Close & Apply”. Power BI should fetch the full dataset using the pagination logic and filters.

   <figure><img src="/files/EKIfEjW4FNFSLixYNC9U" alt=""><figcaption></figcaption></figure>
6. **\[Optional] Add a Filter.** If you would like to apply a filter, you need to update the PowerQuery to include the filter in the config. See example [here](https://gist.github.com/nadineisabel/4b624edb55763883c28149c795b58030) for an organization filter to IOM. Note this will need to be configured per the resource schema.&#x20;
   1. `OrgFilter` (Param filter)

### Python notebook

We provide a ready-to-run Python `ipynb` notebook showing how to query the Tabular Data endpoints (schema information, native and SQL) for Python scripts and pipelines. You can open it directly in your browser via GitHub and test queries without needing to install anything locally.

**Open the Python notebook** [**here**](https://github.com/OCHA-DAP/hdx-tabular-data-endpoints-notebook/tree/main)**.**

**Important:**

* You must provide your own HDX API token in the notebook.
* Never commit your token or share it publicly! Treat it like a password.

**The notebook covers:**

* Searching for resources using the HDX metadata API (`package_search` endpoint)
* Making a minimal native query “probe” call with  `limit=1`&#x20;
* Use SQL query to join two resources with a common column
* Filter in both native and SQL queries
* Fetching data with filters and pagination


---

# 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/tabular-data-endpoints/tools-and-notebook.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.
