REST Countries Scraper avatar

REST Countries Scraper

Pricing

from $3.00 / 1,000 results

Go to Apify Store
REST Countries Scraper

REST Countries Scraper

Scrape REST Countries, the free public API for country metadata. Get name, capital, population, area, currencies, languages, borders, region/subregion, flags, timezones, calling codes, and more for all 250 ISO countries. HTTP-only, no auth, no proxy.

Pricing

from $3.00 / 1,000 results

Rating

5.0

(21)

Developer

Crawler Bros

Crawler Bros

Maintained by Community

Actor stats

21

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

Scrape REST Countries — the free public API for country metadata. All 250 ISO countries, with name (common + official + native), capital, population, area, currencies, languages, borders, region/subregion, flags (emoji + PNG + SVG), timezones, calling codes, TLDs, lat/lng, and more. HTTP-only via the public restcountries.com/v3.1 API. No auth, no proxy.

What this actor does

  • Seven modes: all, byNames, byAlphaCodes, byRegion, bySubregion, byCurrency, byLanguage
  • Filters: min population, min area (km²), UN members only, independent states only
  • Auto-resolves alpha-2 / alpha-3 / numeric codes
  • Empty fields are omitted

Output per country

  • Names: commonName, officialName, altSpellings[], demonym
  • ISO codes: cca2, cca3, ccn3, cioc, fifaCode
  • Status: independent, unMember, status, landlocked
  • Capital: capital[], capitalPrimary
  • Geography: region, subregion, continents[], borders[], latitude, longitude
  • Demographics: population, areaKm2
  • Symbols: flagEmoji (🇩🇪), flagPng, flagSvg, coatOfArmsPng, coatOfArmsSvg
  • Currency / language: currencies[] (code + name + symbol), currencyCodes[], languageCodes[], languageNames[]
  • Communications: timezones[], callingCodes[], tlds[]
  • Maps: googleMapsUrl, openStreetMapsUrl
  • recordType: "country", scrapedAt

Input

FieldTypeDefaultDescription
modestringallOne of seven modes
namesarrayCountry names (mode=byNames)
alphaCodesarrayAlpha-2/3 codes (mode=byAlphaCodes)
regionstringContinental region
subregionstringSubregion (e.g. Western Europe)
currencystringISO 4217 (mode=byCurrency)
languagestringLanguage name or ISO code
minPopulationintDrop countries below this
minAreaintDrop countries below this km²
unMembersOnlyboolfalse
independentOnlyboolfalseExcludes territories
maxItemsint250Hard cap (1–500)

Example: all UN member states with population > 10M

{
"mode": "all",
"minPopulation": 10000000,
"unMembersOnly": true
}

Example: lookup specific countries

{
"mode": "byAlphaCodes",
"alphaCodes": ["DE", "FR", "ES", "IT", "GB", "PT"]
}

Example: all Eurozone countries

{
"mode": "byCurrency",
"currency": "EUR"
}

Example: all Spanish-speaking countries

{
"mode": "byLanguage",
"language": "spanish"
}

Use cases

  • Geographic dropdowns — populate forms with all countries, sorted by region
  • Lookup tables — alpha-2 ↔ alpha-3 ↔ numeric ISO mappings
  • Phone-number formattingcallingCodes[] for international dialing
  • Flag UIflagEmoji for inline display, flagSvg for high-DPI
  • Currency converter — group countries by currency for FX UIs
  • i18n — group countries by official language

FAQ

Is the REST Countries API free? Yes. Self-hosted, no auth, no rate limits beyond reasonable use.

What's the difference between cca2 / cca3 / ccn3 / cioc? ISO 3166-1 alpha-2 (DE), alpha-3 (DEU), numeric (276), and IOC (GER) codes respectively.

Why does mode=all require many requests of fields? REST Countries v3.1+ requires explicit fields= parameter for /all to keep payloads small. The actor sends a comprehensive list — every field documented above.

How many countries are there? 250 entries (includes territories, dependencies, Antarctic). For sovereign UN states only, set unMembersOnly: true (193 entries).

What's cioc? International Olympic Committee code. Only set for countries that compete in the Olympics.

Why is latitude / longitude sometimes missing? REST Countries returns latlng: ["bad", "data"] for a few entries. The actor handles this gracefully.

How fresh is the data? Updated periodically (manual edits by maintainers). For real-time political changes, supplement with a different source.