> 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/api-reference/geography-and-infrastructure.md).

# Geography & Infrastructure

## Get baseline population data

> Baseline population data sourced and maintained by UNFPA (UN Population Fund). See the more detailed technical \<a href="[https://hdx-hapi.readthedocs.io/en/latest/data\\\_usage\\\_guides/population\\\_and\\\_socio-economy/#baseline-population">HDX](https://hdx-hapi.readthedocs.io/en/latest/data\\_usage\\_guides/population\\_and\\_socio-economy/#baseline-population">HDX) HAPI documentation\</a>, and the \<a href="[https://data.humdata.org/organization/unfpa">UNFPA](https://data.humdata.org/organization/unfpa">UNFPA) on HDX\</a>.

```json
{"openapi":"3.1.0","info":{"title":"HDX HAPI","version":"0.9.13"},"servers":[{"url":"https://hapi.humdata.org","description":"Production"}],"paths":{"/api/v2/geography-infrastructure/baseline-population":{"get":{"tags":["Geography & Infrastructure"],"summary":"Get baseline population data","description":"Baseline population data sourced and maintained by UNFPA (UN Population Fund). See the more detailed technical <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/population_and_socio-economy/#baseline-population\">HDX HAPI documentation</a>, and the <a href=\"https://data.humdata.org/organization/unfpa\">UNFPA on HDX</a>.","operationId":"get_population_api_v2_geography_infrastructure_baseline_population_get","parameters":[{"name":"app_identifier","in":"query","required":true,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"description":"base64 encoded application name and email, as in `base64(\"app_name:email\")`. This value can also be passed in the `X-HDX-HAPI-APP-IDENTIFIER` header. See the *encoded_app_identifier* endpoint.","title":"App Identifier"},"description":"base64 encoded application name and email, as in `base64(\"app_name:email\")`. This value can also be passed in the `X-HDX-HAPI-APP-IDENTIFIER` header. See the *encoded_app_identifier* endpoint."},{"name":"gender","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Gender","maxLength":3},{"type":"null"}],"description":"Filter the response by the gender, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#gender\">here.</a>","title":"Gender"},"description":"Filter the response by the gender, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#gender\">here.</a>"},{"name":"age_range","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"description":"Filter the response by the age range. These are expressed as [start age]-[end age], or [start age]+ for an age range starting at [start age] or above. The end age is assumed to be inclusive, though that is not always explicit in the source data.","title":"Age Range"},"description":"Filter the response by the age range. These are expressed as [start age]-[end age], or [start age]+ for an age range starting at [start age] or above. The end age is assumed to be inclusive, though that is not always explicit in the source data."},{"name":"population_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter the response by a lower bound for the population.","title":"Population Min"},"description":"Filter the response by a lower bound for the population."},{"name":"population_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter the response by a upper bound for the population.","title":"Population Max"},"description":"Filter the response by a upper bound for the population."},{"name":"has_hrp","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter the response by the has_hrp flag. The has_hrp flag indicates whether a country has a Humanitarian Response Plan.","title":"Has Hrp"},"description":"Filter the response by the has_hrp flag. The has_hrp flag indicates whether a country has a Humanitarian Response Plan."},{"name":"in_gho","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter the response by the in_gho flag. The in_gho flag indicates whether a country is in the <a href=\"https://humanitarianaction.info/\">Global Humanitarian Overview</a>.","title":"In Gho"},"description":"Filter the response by the in_gho flag. The in_gho flag indicates whether a country is in the <a href=\"https://humanitarianaction.info/\">Global Humanitarian Overview</a>."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter entries to include rows where the reference period overlaps with or extends beyond this date, e.g. 2020, 2020-01, 2020-01-01 or 2020-01-01T00:00:00","title":"Start Date"},"description":"Filter entries to include rows where the reference period overlaps with or extends beyond this date, e.g. 2020, 2020-01, 2020-01-01 or 2020-01-01T00:00:00"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter entries to include rows where the reference period overlaps with or begins prior to this date, e.g. 2020, 2020-01, 2020-01-01, 2020-01-01 or 2020-01-01T23:59:59","title":"End Date"},"description":"Filter entries to include rows where the reference period overlaps with or begins prior to this date, e.g. 2020, 2020-01, 2020-01-01, 2020-01-01 or 2020-01-01T23:59:59"},{"name":"location_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"Filter the response by a location (typically a country). The location codes use the ISO-3 (ISO 3166 alpha-3) codes. See the <a href=\"/docs#/Metadata/get_locations_api_v1_metadata_location_get\" target=\"_blank\">location endpoint</a> for details.","title":"Location Code"},"description":"Filter the response by a location (typically a country). The location codes use the ISO-3 (ISO 3166 alpha-3) codes. See the <a href=\"/docs#/Metadata/get_locations_api_v1_metadata_location_get\" target=\"_blank\">location endpoint</a> for details."},{"name":"location_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"description":"Filter the response by a location (typically a country). The location names are based on the \"short name\" from the <a href=\"https://unstats.un.org/unsd/methodology/m49/#fn2\">UN M49 Standard</a>. See the <a href=\"/docs#/Metadata/get_locations_api_v1_metadata_location_get\" target=\"_blank\">location endpoint</a> for details.","title":"Location Name"},"description":"Filter the response by a location (typically a country). The location names are based on the \"short name\" from the <a href=\"https://unstats.un.org/unsd/methodology/m49/#fn2\">UN M49 Standard</a>. See the <a href=\"/docs#/Metadata/get_locations_api_v1_metadata_location_get\" target=\"_blank\">location endpoint</a> for details."},{"name":"admin1_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"Filter the response by the 1st subnational administrative divisions. The admin1 codes refer to the p-codes in the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a>. See the <a href=\"/docs#/Metadata/get_admin1_api_v1_metadata_admin1_get\" target=\"_blank\">admin1 endpoint</a> for details.","title":"Admin1 Code"},"description":"Filter the response by the 1st subnational administrative divisions. The admin1 codes refer to the p-codes in the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a>. See the <a href=\"/docs#/Metadata/get_admin1_api_v1_metadata_admin1_get\" target=\"_blank\">admin1 endpoint</a> for details."},{"name":"admin1_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"description":"Filter the response by the 1st subnational administrative divisions. The admin1 names refer to either the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a> or those provided in the original data source. See the <a href=\"/docs#/Metadata/get_admin1_api_v1_metadata_admin1_get\" target=\"_blank\">admin1 endpoint</a> for details.","title":"Admin1 Name"},"description":"Filter the response by the 1st subnational administrative divisions. The admin1 names refer to either the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a> or those provided in the original data source. See the <a href=\"/docs#/Metadata/get_admin1_api_v1_metadata_admin1_get\" target=\"_blank\">admin1 endpoint</a> for details."},{"name":"admin2_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"Filter the response by the 2nd subnational administrative divisions. The admin2 codes refer to the p-codes in the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a>. See the <a href=\"/docs#/Metadata/get_admin2_api_v1_metadata_admin2_get\" target=\"_blank\">admin2 endpoint</a> for details.","title":"Admin2 Code"},"description":"Filter the response by the 2nd subnational administrative divisions. The admin2 codes refer to the p-codes in the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a>. See the <a href=\"/docs#/Metadata/get_admin2_api_v1_metadata_admin2_get\" target=\"_blank\">admin2 endpoint</a> for details."},{"name":"admin2_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"description":"Filter the response by the 2nd subnational administrative divisions. The admin2 names refer to either the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a> or those provided in the original data source. See the <a href=\"/docs#/Metadata/get_admin2_api_v1_metadata_admin2_get\" target=\"_blank\">admin2 endpoint</a> for details.","title":"Admin2 Name"},"description":"Filter the response by the 2nd subnational administrative divisions. The admin2 names refer to either the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a> or those provided in the original data source. See the <a href=\"/docs#/Metadata/get_admin2_api_v1_metadata_admin2_get\" target=\"_blank\">admin2 endpoint</a> for details."},{"name":"admin_level","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/AdminLevel"},{"type":"null"}],"description":"Filter the response by admin level.","title":"Admin Level"},"description":"Filter the response by admin level."},{"name":"output_format","in":"query","required":false,"schema":{"$ref":"#/components/schemas/OutputFormat","default":"json"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":0,"description":"Maximum number of records to return. The system will not return more than 10,000 records.","default":10000,"title":"Limit"},"description":"Maximum number of records to return. The system will not return more than 10,000 records."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of records to skip in the response. Use in conjunction with the limit parameter to paginate.","default":0,"title":"Offset"},"description":"Number of records to skip in the response. Use in conjunction with the limit parameter to paginate."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HapiGenericResponse_PopulationResponse_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseValidationResponse"}}},"description":"Internal Server Error"}}}}},"components":{"schemas":{"Gender":{"type":"string","enum":["f","m","x","u","o","all"],"title":"Gender"},"AdminLevel":{"type":"string","enum":["0","1","2"],"title":"AdminLevel"},"OutputFormat":{"type":"string","enum":["csv","json"],"title":"OutputFormat"},"HapiGenericResponse_PopulationResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PopulationResponse"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"HapiGenericResponse[PopulationResponse]"},"PopulationResponse":{"properties":{"location_code":{"type":"string","maxLength":128,"title":"Location Code","description":"A location (typically a country). The location codes use the ISO-3 (ISO 3166 alpha-3) codes."},"location_name":{"type":"string","maxLength":512,"title":"Location Name","description":"A location (typically a country). The location names are based on the \"short name\" from the <a href=\"https://unstats.un.org/unsd/methodology/m49/#fn2\">UN M49 Standard</a>."},"admin1_code":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Admin1 Code","description":"The 1st subnational administrative divisions. The admin1 codes refer to the p-codes in the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a>."},"admin1_name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Admin1 Name","description":"The 1st subnational administrative divisions. The admin1 names refer to either the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a> or those provided in the original data source."},"admin2_code":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Admin2 Code","description":"The 2nd subnational administrative divisions. The admin2 codes refer to the p-codes in the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a>."},"admin2_name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Admin2 Name","description":"The 2nd subnational administrative divisions. The admin2 names refer to either the <a href=\"https://data.humdata.org/dashboards/cod?\">Common Operational Datasets</a> or those provided in the original data source."},"admin_level":{"type":"integer","title":"Admin Level","description":"Admin level."},"resource_hdx_id":{"type":"string","maxLength":36,"title":"Resource Hdx Id","description":"The resource ID, which is a unique and fixed identifier of a resource on HDX. A URL in the pattern of `https://data.humdata.org/dataset/[dataset_hdx_id]/resource/[resource_hdx_id]` will load the resource page on HDX."},"gender":{"$ref":"#/components/schemas/Gender","description":"The gender, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#gender\">here.</a>"},"age_range":{"type":"string","maxLength":32,"title":"Age Range","description":"The age range. These are expressed as [start age]-[end age], or [start age]+ for an age range starting at [start age] or above. The end age is assumed to be inclusive, though that is not always explicit in the source data."},"min_age":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Min Age","description":"The minimum age from `age_range`, set to `null` if `age_range` is \"all\" and there is no age disaggregation"},"max_age":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Max Age","description":"The maximum age from `age_range`, set to `null` if `age_range` is \"all\" and there is no age disaggregation, or if there is no upper limit to the age range"},"population":{"type":"integer","title":"Population","description":"The number of people"},"reference_period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reference Period Start","description":"The start date for which the data are applicable"},"reference_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reference Period End","description":"The end date for which the data are applicable"}},"type":"object","required":["location_code","location_name","admin1_code","admin1_name","admin2_code","admin2_name","admin_level","resource_hdx_id","gender","age_range","min_age","max_age","population","reference_period_start","reference_period_end"],"title":"PopulationResponse"},"BadRequestResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"BadRequestResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ResponseValidationResponse":{"properties":{"error_sample_list":{"items":{},"type":"array","title":"Error Sample List"},"error":{"type":"string","title":"Error"}},"type":"object","required":["error_sample_list","error"],"title":"ResponseValidationResponse"}}}}
```


---

# 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/api-reference/geography-and-infrastructure.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.
