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

# Affected People

## Get refugees data

> UNHCR's Refugee data provides information about displaced people in a crisis. See the more detailed technical \<a href="[https://hdx-hapi.readthedocs.io/en/latest/data\\\_usage\\\_guides/affected\\\_people/#refugees-persons-of-concern">HDX](https://hdx-hapi.readthedocs.io/en/latest/data\\_usage\\_guides/affected\\_people/#refugees-persons-of-concern">HDX) HAPI documentation\</a>, and the \<a href="[https://data.humdata.org/dataset/unhcr-population-data-for-world">original](https://data.humdata.org/dataset/unhcr-population-data-for-world">original) HDX source\</a> website.

```json
{"openapi":"3.1.0","info":{"title":"HDX HAPI","version":"0.9.13"},"servers":[{"url":"https://hapi.humdata.org","description":"Production"}],"paths":{"/api/v2/affected-people/refugees-persons-of-concern":{"get":{"tags":["Affected People"],"summary":"Get refugees data","description":"UNHCR's Refugee data provides information about displaced people in a crisis. See the more detailed technical <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/affected_people/#refugees-persons-of-concern\">HDX HAPI documentation</a>, and the <a href=\"https://data.humdata.org/dataset/unhcr-population-data-for-world\">original HDX source</a> website.","operationId":"get_refugees_api_v2_affected_people_refugees_persons_of_concern_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":"population_group","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/PopulationGroup","maxLength":32},{"type":"null"}],"description":"Filter the response by the population group, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#population-group\">here.</a>","title":"Population Group"},"description":"Filter the response by the population group, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#population-group\">here.</a>"},{"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":"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":"origin_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":"Origin 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":"origin_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":"Origin 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":"origin_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":"Origin 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":"origin_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":"Origin 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":"asylum_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":"Asylum 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":"asylum_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":"Asylum 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":"asylum_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":"Asylum 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":"asylum_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":"Asylum 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":"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_RefugeesResponse_"}}}},"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":{"PopulationGroup":{"type":"string","enum":["REF","ROC","ASY","OIP","IDP","IOC","STA","OOC","HST","RET","RST","NAT","RDP","RRI","all"],"title":"PopulationGroup"},"Gender":{"type":"string","enum":["f","m","x","u","o","all"],"title":"Gender"},"OutputFormat":{"type":"string","enum":["csv","json"],"title":"OutputFormat"},"HapiGenericResponse_RefugeesResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/RefugeesResponse"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"HapiGenericResponse[RefugeesResponse]"},"RefugeesResponse":{"properties":{"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."},"population_group":{"$ref":"#/components/schemas/PopulationGroup","description":"The population group, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#population-group\">here.</a>"},"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","minimum":0,"title":"Population","description":"The number of people"},"reference_period_start":{"type":"string","format":"date-time","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"},"origin_location_code":{"type":"string","maxLength":128,"title":"Origin Location Code","description":"Location of origin p-code (ISO-3)"},"origin_location_name":{"type":"string","maxLength":512,"title":"Origin Location Name","description":"Location of origin name"},"asylum_location_code":{"type":"string","maxLength":128,"title":"Asylum Location Code","description":"Location of asylum p-code (ISO-3)"},"asylum_location_name":{"type":"string","maxLength":512,"title":"Asylum Location Name","description":"Location of asylum name"}},"type":"object","required":["resource_hdx_id","population_group","gender","age_range","min_age","max_age","population","reference_period_start","reference_period_end","origin_location_code","origin_location_name","asylum_location_code","asylum_location_name"],"title":"RefugeesResponse"},"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"}}}}
```

## Get humanitarian needs data

> OCHA's Humanitarian Needs data, based on the Joint and Intersectoral Analysis Framework (JIAF), provides information about the number of people in need during a crisis. See the more detailed technical \<a href="[https://hdx-hapi.readthedocs.io/en/latest/data\\\_usage\\\_guides/affected\\\_people/#humanitarian-needs">HDX](https://hdx-hapi.readthedocs.io/en/latest/data\\_usage\\_guides/affected\\_people/#humanitarian-needs">HDX) HAPI documentation\</a>, and the \<a href="[https://www.jiaf.info/">original](https://www.jiaf.info/">original) JIAF source\</a> website.

```json
{"openapi":"3.1.0","info":{"title":"HDX HAPI","version":"0.9.13"},"servers":[{"url":"https://hapi.humdata.org","description":"Production"}],"paths":{"/api/v2/affected-people/humanitarian-needs":{"get":{"tags":["Affected People"],"summary":"Get humanitarian needs data","description":"OCHA's Humanitarian Needs data, based on the Joint and Intersectoral Analysis Framework (JIAF), provides information about the number of people in need during a crisis. See the more detailed technical <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/affected_people/#humanitarian-needs\">HDX HAPI documentation</a>, and the <a href=\"https://www.jiaf.info/\">original JIAF source</a> website.","operationId":"get_humanitarian_needs_api_v2_affected_people_humanitarian_needs_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":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"A category combining gender, age range, disability marker and population group information","title":"Category"},"description":"A category combining gender, age range, disability marker and population group information"},{"name":"sector_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"description":"Filter the response by the sector code.","title":"Sector Code"},"description":"Filter the response by the sector code."},{"name":"population_status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/PopulationStatus","maxLength":32},{"type":"null"}],"description":"Filter the response by the population status, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#population-status\">here.</a>","title":"Population Status"},"description":"Filter the response by the population status, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#population-status\">here.</a>"},{"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":"sector_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"description":"Filter the response by the sector name.","title":"Sector Name"},"description":"Filter the response by the sector name."},{"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_HumanitarianNeedsResponse_"}}}},"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":{"PopulationStatus":{"type":"string","enum":["AFF","INN","TGT","REA","all"],"title":"PopulationStatus"},"AdminLevel":{"type":"string","enum":["0","1","2"],"title":"AdminLevel"},"OutputFormat":{"type":"string","enum":["csv","json"],"title":"OutputFormat"},"HapiGenericResponse_HumanitarianNeedsResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/HumanitarianNeedsResponse"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"HapiGenericResponse[HumanitarianNeedsResponse]"},"HumanitarianNeedsResponse":{"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."},"sector_code":{"type":"string","maxLength":32,"title":"Sector Code","description":"The sector code, derived either from the [Global Coordination Groups](https://data.humdata.org/dataset/global-coordination-groups-beta?) dataset, or created for HDX HAPI"},"category":{"type":"string","maxLength":128,"title":"Category","description":"A category combining gender, age range, disability marker and population group information"},"population_status":{"$ref":"#/components/schemas/PopulationStatus","description":"The population status, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#population-status\">here.</a>"},"population":{"type":"integer","minimum":0,"title":"Population","description":"The number of people"},"reference_period_start":{"type":"string","format":"date-time","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"},"sector_name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Sector Name","description":"The name of the sector"}},"type":"object","required":["location_code","location_name","admin1_code","admin1_name","admin2_code","admin2_name","admin_level","resource_hdx_id","sector_code","category","population_status","population","reference_period_start","reference_period_end","sector_name"],"title":"HumanitarianNeedsResponse"},"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"}}}}
```

## GET /api/v2/affected-people/idps

> Get idps data

```json
{"openapi":"3.1.0","info":{"title":"HDX HAPI","version":"0.9.13"},"servers":[{"url":"https://hapi.humdata.org","description":"Production"}],"paths":{"/api/v2/affected-people/idps":{"get":{"tags":["Affected People"],"summary":"Get idps data","operationId":"get_idps_api_v2_affected_people_idps_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":"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_IdpsResponse_"}}}},"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":{"AdminLevel":{"type":"string","enum":["0","1","2"],"title":"AdminLevel"},"OutputFormat":{"type":"string","enum":["csv","json"],"title":"OutputFormat"},"HapiGenericResponse_IdpsResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/IdpsResponse"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"HapiGenericResponse[IdpsResponse]"},"IdpsResponse":{"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."},"reporting_round":{"type":"integer","title":"Reporting Round","description":"Data collection round number"},"assessment_type":{"$ref":"#/components/schemas/DTMAssessmentType","description":"Either baseline assessment (BA),site assessment (SA) or event track (ETT)"},"operation":{"type":"string","title":"Operation","description":"Name of DTM Operation for which the data was collected"},"population":{"type":"integer","title":"Population","description":"The number of people"},"reference_period_start":{"type":"string","format":"date-time","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","reporting_round","assessment_type","operation","population","reference_period_start","reference_period_end"],"title":"IdpsResponse"},"DTMAssessmentType":{"type":"string","enum":["BA","ETT","SA"],"title":"DTMAssessmentType"},"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"}}}}
```

## GET /api/v2/affected-people/returnees

> Get returnees data

```json
{"openapi":"3.1.0","info":{"title":"HDX HAPI","version":"0.9.13"},"servers":[{"url":"https://hapi.humdata.org","description":"Production"}],"paths":{"/api/v2/affected-people/returnees":{"get":{"tags":["Affected People"],"summary":"Get returnees data","operationId":"get_returnees_api_v2_affected_people_returnees_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":"population_group","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/PopulationGroup"},{"type":"null"}],"description":"Filter the response by the population group, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#population-group\">here.</a>","title":"Population Group"},"description":"Filter the response by the population group, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#population-group\">here.</a>"},{"name":"gender","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Gender"},{"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":"min_age","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"The minimum age from `age_range`, set to `null` if `age_range` is \"all\" and there is no age disaggregation","title":"Min Age"},"description":"The minimum age from `age_range`, set to `null` if `age_range` is \"all\" and there is no age disaggregation"},{"name":"max_age","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"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","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"},{"name":"origin_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":"Origin 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":"origin_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":"Origin 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":"origin_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":"Origin 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":"origin_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":"Origin 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":"asylum_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":"Asylum 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":"asylum_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":"Asylum 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":"asylum_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":"Asylum 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":"asylum_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":"Asylum 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":"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_ReturneesResponse_"}}}},"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":{"PopulationGroup":{"type":"string","enum":["REF","ROC","ASY","OIP","IDP","IOC","STA","OOC","HST","RET","RST","NAT","RDP","RRI","all"],"title":"PopulationGroup"},"Gender":{"type":"string","enum":["f","m","x","u","o","all"],"title":"Gender"},"OutputFormat":{"type":"string","enum":["csv","json"],"title":"OutputFormat"},"HapiGenericResponse_ReturneesResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ReturneesResponse"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"HapiGenericResponse[ReturneesResponse]"},"ReturneesResponse":{"properties":{"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."},"population_group":{"$ref":"#/components/schemas/PopulationGroup","description":"The population group, available values are described <a href=\"https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/enums/#population-group\">here.</a>"},"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","minimum":0,"title":"Population","description":"The number of people"},"reference_period_start":{"type":"string","format":"date-time","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"},"origin_location_code":{"type":"string","maxLength":128,"title":"Origin Location Code","description":"A location (typically a country). The location codes use the ISO-3 (ISO 3166 alpha-3) codes."},"origin_location_name":{"type":"string","maxLength":512,"title":"Origin 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>."},"asylum_location_code":{"type":"string","maxLength":128,"title":"Asylum Location Code","description":"A location (typically a country). The location codes use the ISO-3 (ISO 3166 alpha-3) codes."},"asylum_location_name":{"type":"string","maxLength":512,"title":"Asylum 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>."}},"type":"object","required":["resource_hdx_id","population_group","gender","age_range","min_age","max_age","population","reference_period_start","reference_period_end","origin_location_code","origin_location_name","asylum_location_code","asylum_location_name"],"title":"ReturneesResponse"},"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/affected-people.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.
