example-data.com
Menu
Browse docs and collections

Overview

countries / #10

Ireland

IE

Capital: Dublin · Region: Europe

Component variants

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/countries/10" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/countries/10"
);
const country = 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 } from "./types/countries";

const res = await fetch(
  "https://example-data.com/api/v1/countries/10"
);
const country = (await res.json()) as Country;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/countries/10"
)
countrie = res.json()

Response

{
  "id": 10,
  "name": "Ireland",
  "alpha2": "IE",
  "alpha3": "IRL",
  "numericCode": "372",
  "capital": "Dublin",
  "region": "Europe",
  "subregion": "Northern Europe",
  "currencyCode": "EUR",
  "callingCode": "+353",
  "flagEmoji": "🇮🇪"
}