example-data.com
Menu
Browse docs and collections

countries

countries

Browse 50 countries records. Explore sample records and fetch JSON over a free REST API for prototypes, tests, and learning.

Overview

Cards

Compact

Detailed

United States

US

Capital: Washington, D.C. · Region: Americas

Canada

CA

Capital: Ottawa · Region: Americas

Mexico

MX

Capital: Mexico City · Region: Americas

Brazil

BR

Capital: Brasília · Region: Americas

Argentina

AR

Capital: Buenos Aires · Region: Americas

Chile

CL

Capital: Santiago · Region: Americas

Showing first 6 of 24 on this page.

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/countries?limit=25"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/countries?limit=25"
);
const { data, meta } = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/countries.d.ts https://example-data.com/types/countries.d.ts
import type { Country, ListEnvelope } from "./types/countries";

const res = await fetch(
  "https://example-data.com/api/v1/countries?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<Country>;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/countries",
    params={"limit": 25},
)
data = res.json()

Response

{
  "data": [
    {
      "id": 1,
      "name": "United States",
      "alpha2": "US",
      "alpha3": "USA",
      "numericCode": "840",
      "capital": "Washington, D.C.",
      "region": "Americas",
      "subregion": "Northern America",
      "currencyCode": "USD",
      "callingCode": "+1",
      "flagEmoji": "🇺🇸"
    },
    {
      "id": 2,
      "name": "Canada",
      "alpha2": "CA",
      "alpha3": "CAN",
      "numericCode": "124",
      "capital": "Ottawa",
      "region": "Americas",
      "subregion": "Northern America",
      "currencyCode": "CAD",
      "callingCode": "+1",
      "flagEmoji": "🇨🇦"
    },
    {
      "id": 3,
      "name": "Mexico",
      "alpha2": "MX",
      "alpha3": "MEX",
      "numericCode": "484",
      "capital": "Mexico City",
      "region": "Americas",
      "subregion": "Central America",
      "currencyCode": "MXN",
      "callingCode": "+52",
      "flagEmoji": "🇲🇽"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 25,
    "total": 50,
    "totalPages": 2
  },
  "links": {
    "self": "/api/v1/countries?page=1",
    "first": "/api/v1/countries?page=1",
    "last": "/api/v1/countries?page=2",
    "next": "/api/v1/countries?page=2",
    "prev": null
  }
}

View full response →