Skip to content

Endpoints

Ali Anwar edited this page Jun 15, 2017 · 2 revisions

Countries

Endpoint: /api/countries

Description:

Returns an array of countries in the database

Params

sort sort the array by either iso3 or name, defaults to name

Country overview

Endpoint: /api/overview

Description:

Returns a country displacement information and includes population and refugee numbers

Params:

iso3 The country iso3 code

Example:

/api/overview?iso3=rus

Conflict displacement data

Endpoint: /api/conflict_data

Description:

Returns all available conflict displacement data

Params:

iso3 The country iso3 code (if neglected then all the countries)

year The year of the records (default all years, it also accept ranges)

range When set to 1 the API expects multiple year values and returns records below to the year range

limit Limit the number of records returned by the endpoint

Examples:

  1. Country by year e.g. /conflict_data?iso3=rus&year=2015
  2. All countries for a year e.g. /conflict_data?year=2015
  3. Country by range of years e.g. /conflict_data?iso3=rus&year=2011&year=2015&range=1

Disaster displacement data

Endpoint: /api/disaster_data

Description

Returns all available disaster displacement data by event and includes hazard type information

Params

iso3 The country iso3 code (if neglected then all the countries)

year The year of the records (default all years, it also accept ranges)

range When set to 1 the API expects multiple year values and returns records below to the year range

limit Limit the number of records returned by the endpoint

Displacement data

Endpoint: /api/displacement_data

Description

Returns all available displacement data for both disaster and conflict by year and country

Params:

iso3 The country iso3 code (if neglected then all the countries)

year The year of the records (default all years, it also accept ranges)

range When set to 1 the API expects multiple year values and returns records below to the year range

limit Limit the number of records returned by the endpoint

Disaster aggregated data

Endpoint: /api/aggregated/disaster_data

Description:

Returns all available disaster displacement data by country aggregating all the events

Params:

iso3 The country iso3 code (if neglected then all the countires)

year The year of the records (one entry for a year, two for a range + range=1)

range When set to 1 the API expect multiple year values and it return a records for each year if available

limit Limit the returned results to a specific number of records

Example:

/api/aggregated/disaster_data?iso3=AFG&year=2009&year=2011&range=1

Conflict stock by latest update

Endpoint: /api/strata_data

Description:

Returns the strata data for a country by type of displacement and fact type

Params:

iso3 The country iso3 code

Example:

/api/strata_data?iso3=AFG

Public figure analysis text

Endpoint:

/api/figure_analysis

Description:

Returns the figure analysis for a country

Example:

/api/figure_analysis?iso3=AFG

Params:

iso3 The country iso3 code

Confidence assessment data

Endpoint: /api/confidence_assessment

Description:

Returns the confidence assessment data for a country by type of displacement and fact type

Params:

iso3 The country iso3 code

Example:

/api/confidence_assessment?iso3=AFG

Disaster Events

Endpoint: /api/disaster_events

Description:

Returns events associated with an iso code

Params:

iso3 The country iso3 code

Example:

/api/disaster_events?iso3=AFG