REST Countries Scraper avatar

REST Countries Scraper

Pricing

Pay per event

Go to Apify Store
REST Countries Scraper

REST Countries Scraper

Extract comprehensive data for 250 countries including population, languages, currencies, capitals, borders, and more. Filter by region or search by name. No API key needed.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 hours ago

Last modified

Share

Get comprehensive data for 250 countries — population, currencies, languages, capitals, flags, timezones, borders, and more. Filter by region or search by name.

What does REST Countries Scraper do?

REST Countries Scraper fetches structured country data from the REST Countries API. Get all 250 countries at once, filter by region (Africa, Americas, Asia, Europe, Oceania), or search by country name. Results are sorted by population for easy analysis.

Each country includes official and native names, ISO codes, capital city, population, area, currencies with symbols, languages, timezones, bordering countries, flag images (PNG and SVG), coat of arms, map links, and more.

Why use REST Countries Scraper?

  • 250 countries — complete global coverage with rich metadata
  • Multiple modes — get all, filter by region, or search by name
  • Flag images — PNG and SVG flag URLs plus emoji flags
  • Currency details — codes, names, and symbols for every currency
  • Language data — all official languages with ISO codes
  • Geographic data — borders, timezones, area, map links, continents

Use cases

  • Educational resources — build geography quizzes, flashcards, or reference tools
  • Data enrichment — add country metadata to your datasets
  • Localization — get currencies, languages, and timezones for i18n
  • Analytics dashboards — visualize population, area, and regional distribution
  • Travel apps — show country info, flags, currencies, and driving side
  • Research — compare countries by population, borders, UN membership

How to scrape country data

  1. Go to the REST Countries Scraper page on Apify
  2. Choose a Mode: all countries, filter by region, or search by name
  3. Click Start and wait for the run to finish
  4. Download your data in JSON, CSV, or Excel format

Input parameters

ParameterTypeRequiredDefaultDescription
modestringNoallSelection mode: all, region, or search
regionstringNoEuropeRegion filter (Africa, Americas, Asia, Europe, Oceania)
searchQuerystringNoCountry name to search for (partial matches work)

Example input

{
"mode": "region",
"region": "Europe"
}

Output example

Each country returns comprehensive structured data:

{
"name": "Germany",
"officialName": "Federal Republic of Germany",
"nativeNames": ["Bundesrepublik Deutschland"],
"alpha2Code": "DE",
"alpha3Code": "DEU",
"capital": "Berlin",
"region": "Europe",
"subregion": "Western Europe",
"population": 83240525,
"area": 357114,
"currencies": "EUR (€)",
"currencyDetails": [{ "code": "EUR", "name": "Euro", "symbol": "€" }],
"languages": "German",
"languageDetails": [{ "code": "deu", "name": "German" }],
"timezones": ["UTC+01:00"],
"borders": ["AUT", "BEL", "CZE", "DNK", "FRA", "LUX", "NLD", "POL", "CHE"],
"flagPng": "https://flagcdn.com/w320/de.png",
"flagSvg": "https://flagcdn.com/de.svg",
"flagEmoji": "🇩🇪",
"coatOfArms": "https://mainfacts.com/media/images/coats_of_arms/de.png",
"googleMaps": "https://goo.gl/maps/mD9FBMq1nvXUBrkv6",
"openStreetMaps": "https://www.openstreetmap.org/relation/51477",
"independent": true,
"unMember": true,
"landlocked": false,
"startOfWeek": "monday",
"carSide": "right",
"continents": ["Europe"],
"scrapedAt": "2026-03-03T05:36:58.638Z"
}

Output fields

FieldTypeDescription
namestringCommon country name
officialNamestringOfficial country name
nativeNamesarrayNative name(s) in local language(s)
alpha2CodestringISO 3166-1 alpha-2 code (e.g., US, DE)
alpha3CodestringISO 3166-1 alpha-3 code (e.g., USA, DEU)
capitalstringCapital city name
regionstringGeographic region
subregionstringGeographic subregion
populationnumberTotal population
areanumberArea in square kilometers
currenciesstringSummary of currencies with symbols
currencyDetailsarrayDetailed currency info (code, name, symbol)
languagesstringSummary of languages
languageDetailsarrayDetailed language info (code, name)
timezonesarrayAll timezones
bordersarrayBordering country codes (alpha-3)
flagPngstringPNG flag image URL
flagSvgstringSVG flag image URL
flagEmojistringFlag emoji
coatOfArmsstringCoat of arms image URL
googleMapsstringGoogle Maps link
openStreetMapsstringOpenStreetMap link
independentbooleanWhether the country is independent
unMemberbooleanUN member status
landlockedbooleanWhether the country is landlocked
startOfWeekstringStart day of the week
carSidestringDriving side (left/right)
continentsarrayContinent(s) the country belongs to
scrapedAtstringISO 8601 timestamp of extraction

How much does it cost to scrape country data?

REST Countries Scraper uses pay-per-event pricing:

EventPrice
Run started$0.001
Country extracted$0.0005 per country

Cost examples

ScenarioCost
All 250 countries$0.126
Europe (53 countries)$0.0275
Search for "united"~$0.003

Use with AI agents via MCP

REST Countries Scraper is available as a tool for AI assistants via the Model Context Protocol (MCP).

Setup for Claude Code

$claude mcp add --transport http apify "https://mcp.apify.com"

Setup for Claude Desktop, Cursor, or VS Code

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com"
}
}
}

Example prompts

  • "Get country data for all European countries"
  • "What is the population and GDP of Japan?"

Learn more in the Apify MCP documentation.

Using the Apify API

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("YOUR_USERNAME/rest-countries-scraper").call(
run_input={"mode": "region", "region": "Europe"}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(f"{item['flagEmoji']} {item['name']}{item['capital']} — pop: {item['population']:,}")

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('YOUR_USERNAME/rest-countries-scraper').call({
mode: 'region',
region: 'Europe',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(item => {
console.log(`${item.flagEmoji} ${item.name}${item.capital} — pop: ${item.population.toLocaleString()}`);
});

cURL

curl "https://api.apify.com/v2/acts/automation-lab~rest-countries-scraper/runs" \
-X POST \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mode": "region", "region": "Europe"}'

Integrations

Connect REST Countries Scraper to your workflow with Apify integrations:

  • Webhooks — trigger actions when extraction completes
  • Google Sheets — export country data to spreadsheets
  • Zapier / Make — connect to 5,000+ apps and services
  • REST API — call the actor programmatically from any language

Tips and best practices

  • Use "all" mode to get the complete dataset of 250 countries in one run
  • Results are sorted by population (largest first) for easy analysis
  • Search mode supports partial matches — searching "united" finds United States, United Kingdom, UAE, etc.
  • Flag URLs are hosted on reliable CDNs and can be used directly in applications
  • Border codes are in alpha-3 format — use with the alpha3Code field to resolve names

Legality

Scraping publicly available data is generally legal according to the US Court of Appeals ruling (HiQ Labs v. LinkedIn). This actor only accesses publicly available information and does not require authentication. Always review and comply with the target website's Terms of Service before scraping. For personal data, ensure compliance with GDPR, CCPA, and other applicable privacy regulations.

FAQ

Search mode returns no results — what should I try? Search uses partial matching on common country names. Try the official English name (e.g., "United States" not "USA", "United Kingdom" not "UK"). The REST Countries API matches against the common name field.

Some countries have empty borders arrays — is this a bug? No. Island nations and territories (e.g., Japan, Australia, Iceland) have no land borders, so the array is empty by design.

Other data scrapers