Peru
PE
Capital: Lima · Region: Americas
curl -sS \
"https://example-data.com/api/v1/countries/8" \
-H "Accept: application/json"const res = await fetch(
"https://example-data.com/api/v1/countries/8"
);
const countrie = await res.json();import type { Countrie } from "https://example-data.com/types/countries.d.ts";
const res = await fetch(
"https://example-data.com/api/v1/countries/8"
);
const countrie = (await res.json()) as Countrie;import requests
res = requests.get(
"https://example-data.com/api/v1/countries/8"
)
countrie = res.json() {
"id": 8,
"name": "Peru",
"alpha2": "PE",
"alpha3": "PER",
"numericCode": "604",
"capital": "Lima",
"region": "Americas",
"subregion": "South America",
"currencyCode": "PEN",
"callingCode": "+51",
"flagEmoji": "🇵🇪"
}