api-ninjas-com Population API

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

Operations 1

GET /v1/population Get population data #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-population-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-population-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Population API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Population
  description: The Population API provides historical, current, and projected future population statistics about every country in the world.
paths:
  /v1/population:
    get:
      summary: Get population data
      description: 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.
      operationId: getPopulationData
      parameters:
      - name: country
        in: query
        description: Country name (case-insensitive) or 2-letter ISO-3166 alpha-2 code of the country. E.g. Japan or JP.
        required: false
        schema:
          type: string
      - name: min_population
        in: query
        description: Minimum population of country.
        required: false
        schema:
          type: integer
      - name: max_population
        in: query
        description: Maximum population of country.
        required: false
        schema:
          type: integer
      - name: offset
        in: query
        description: Offset results for pagination.
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PopulationResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      tags:
      - Population
components:
  schemas:
    PopulationData:
      type: object
      properties:
        year:
          type: integer
        population:
          type: integer
        yearly_change_percentage:
          type: number
        yearly_change:
          type: integer
        migrants:
          type: integer
        median_age:
          type: number
        fertility_rate:
          type: number
        density:
          type: integer
        urban_population_pct:
          type: number
        urban_population:
          type: integer
        percentage_of_world_population:
          type: number
        rank:
          type: integer
    PopulationResponse:
      type: object
      properties:
        country_name:
          type: string
        historical_population:
          type: array
          items:
            $ref: '#/components/schemas/PopulationData'
        population_forecast:
          type: array
          items:
            $ref: '#/components/schemas/PopulationData'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api