REST Countries Scraper
Pricing
Pay per event
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
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 hours ago
Last modified
Categories
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
- Go to the REST Countries Scraper page on Apify
- Choose a Mode: all countries, filter by region, or search by name
- Click Start and wait for the run to finish
- Download your data in JSON, CSV, or Excel format
Input parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
mode | string | No | all | Selection mode: all, region, or search |
region | string | No | Europe | Region filter (Africa, Americas, Asia, Europe, Oceania) |
searchQuery | string | No | — | Country 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
| Field | Type | Description |
|---|---|---|
name | string | Common country name |
officialName | string | Official country name |
nativeNames | array | Native name(s) in local language(s) |
alpha2Code | string | ISO 3166-1 alpha-2 code (e.g., US, DE) |
alpha3Code | string | ISO 3166-1 alpha-3 code (e.g., USA, DEU) |
capital | string | Capital city name |
region | string | Geographic region |
subregion | string | Geographic subregion |
population | number | Total population |
area | number | Area in square kilometers |
currencies | string | Summary of currencies with symbols |
currencyDetails | array | Detailed currency info (code, name, symbol) |
languages | string | Summary of languages |
languageDetails | array | Detailed language info (code, name) |
timezones | array | All timezones |
borders | array | Bordering country codes (alpha-3) |
flagPng | string | PNG flag image URL |
flagSvg | string | SVG flag image URL |
flagEmoji | string | Flag emoji |
coatOfArms | string | Coat of arms image URL |
googleMaps | string | Google Maps link |
openStreetMaps | string | OpenStreetMap link |
independent | boolean | Whether the country is independent |
unMember | boolean | UN member status |
landlocked | boolean | Whether the country is landlocked |
startOfWeek | string | Start day of the week |
carSide | string | Driving side (left/right) |
continents | array | Continent(s) the country belongs to |
scrapedAt | string | ISO 8601 timestamp of extraction |
How much does it cost to scrape country data?
REST Countries Scraper uses pay-per-event pricing:
| Event | Price |
|---|---|
| Run started | $0.001 |
| Country extracted | $0.0005 per country |
Cost examples
| Scenario | Cost |
|---|---|
| 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 ApifyClientclient = 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
- Worldbank Scraper — World Bank economic indicators and statistics
- USAspending Scraper — US federal spending and contract data
- SEC EDGAR Scraper — SEC filings and company disclosures
- Regulations.gov Scraper — US federal regulations and public comments