← Back to API Ninjas
GET/v1/population

Get population data

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.

API Ninjas·$0.001 per call

Example code

// Using @orth/sdk - The simplest way to call APIs // Install: npm install @orth/sdk import Orthogonal from "@orth/sdk"; const orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY, }); const output = await orthogonal.run({ api: "api-ninjas", path: "/v1/population" }); console.log(output);

Query parameters

country
string

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

min_population
number

Minimum population of country.

max_population
number

Maximum population of country.

offset
number

Offset results for pagination.

    Orthogonal - Giving AI agents the tools they need.