example-data.com
Menu
Browse docs and collections

Overview

countries / #50

Ethiopia

ET

Capital: Addis Ababa · Region: Africa

Component variants

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/countries/50"
);
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/50"
);
const country = (await res.json()) as Country;

Python example

import requests

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

Response

{
  "id": 50,
  "name": "Ethiopia",
  "alpha2": "ET",
  "alpha3": "ETH",
  "numericCode": "231",
  "capital": "Addis Ababa",
  "region": "Africa",
  "subregion": "Eastern Africa",
  "currencyCode": "ETB",
  "callingCode": "+251",
  "flagEmoji": "🇪🇹"
}