Thailand
TH
Capital: Bangkok · Region: Asia
Overview
Request
curl example
curl -sS \ "https://example-data.com/api/v1/countries/33" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/countries/33" ); 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/33"
);
const country = (await res.json()) as Country; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/countries/33"
)
countrie = res.json() Response
{
"id": 33,
"name": "Thailand",
"alpha2": "TH",
"alpha3": "THA",
"numericCode": "764",
"capital": "Bangkok",
"region": "Asia",
"subregion": "South-eastern Asia",
"currencyCode": "THB",
"callingCode": "+66",
"flagEmoji": "🇹🇭"
}