Iceland
IS
Capital: Reykjavík · Region: Europe
Overview
Request
curl example
curl -sS \ "https://example-data.com/api/v1/countries/23" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/countries/23" ); 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/23"
);
const country = (await res.json()) as Country; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/countries/23"
)
countrie = res.json() Response
{
"id": 23,
"name": "Iceland",
"alpha2": "IS",
"alpha3": "ISL",
"numericCode": "352",
"capital": "Reykjavík",
"region": "Europe",
"subregion": "Northern Europe",
"currencyCode": "ISK",
"callingCode": "+354",
"flagEmoji": "🇮🇸"
}