Population API

The Population API provides historical, current, and projected future population statistics about every country in the world.

(4.5)

From 8,616 users

3,500+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
317ms366ms414ms700ms1052ms

Didn't find what you were looking for? Suggest an improvement


/v1/population GET

https://api.api-ninjas.com/v1/population

Get population data from given parameters. Returns a list of up to 5 country population statistics that satisfy the parameters. For more results use the offset parameter.

Parameters

At least one of the following parameters must be set: country, min_population, max_population

  • country  optional

    Country name (case-insensitive) or 2-letter ISO-3166 alpha-2 code of the country. E.g. Japan or JP.

  • min_population  optional

    Minimum population of country.

  • max_population  optional

    Maximum population of country.

  • offset  optional

    Offset results for pagination.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

Returns an object containing:

  • country_name

    The name of the country.

  • historical_population

    Array of historical population data objects, each containing the following fields:

    • year

      The year for which the population data is recorded.

    • population

      Total population count for the country in the given year.

    • yearly_change_percentage

      Percentage change in population from the previous year (can be positive or negative).

    • yearly_change

      Absolute change in population from the previous year (can be positive or negative).

    • migrants

      Net number of migrants (immigrants minus emigrants) for the year.

    • median_age

      Median age of the population in years.

    • fertility_rate

      Average number of children born per woman in the population.

    • density

      Population density per square kilometer.

    • urban_population_pct

      Percentage of the total population living in urban areas.

    • urban_population

      Total number of people living in urban areas.

    • percentage_of_world_population

      Percentage of the world's total population represented by this country.

    • rank

      World ranking by population size (1 being the most populous country).

  • population_forecast

    Array of projected future population data objects with the same structure as historical_population.

Sample Request Live Demo!

country
min_population
max_population
offset

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/population?country=Japan

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/population?country=United%20States" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.