REST Countries Scraper - Country Data and Flags avatar

REST Countries Scraper - Country Data and Flags

Pricing

from $19.00 / 1,000 results

Go to Apify Store
REST Countries Scraper - Country Data and Flags

REST Countries Scraper - Country Data and Flags

Scrape country data including names, capitals, populations, currencies, languages, and flags from the REST Countries API. Export structured country records.

Pricing

from $19.00 / 1,000 results

Rating

0.0

(0)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

ParseForge Banner

🌍 RestCountries Scraper - Country Data, Flags, Currencies & More

🚀 Export the complete world country database in seconds. Get flags, capitals, populations, languages, currencies, timezones, and calling codes for all 250 countries with zero auth required.

🕒 Last updated: 2026-05-21 · 📊 17 fields per record · 🌍 250 countries · 🗺️ 6 regions · 🆓 No API key required

The RestCountries Scraper pulls from the RestCountries v3.1 public API and returns 17 fields per record, including the country flag image URL, official name, capital, geographic region, population, area, languages, currencies, timezones, international calling codes, and top-level domains. The underlying data is maintained by the open-source community and covers every sovereign state and territory recognized by the United Nations.

The catalog covers all 6 geographic regions (Africa, Americas, Asia, Europe, Oceania, Antarctic), 250 countries, and includes both the common name and the full official name of each country. This Actor returns a clean, structured dataset ready for download as CSV, Excel, JSON, or XML in seconds - no scraping engineering required.

🎯 Target Audience💡 Primary Use Cases
Developers, data scientists, GIS analysts, educators, product teams, market researchers, e-commerce teamsCountry dropdowns, phone validation, currency conversion, language detection, regional analysis, form autofill, academic research

📋 What the RestCountries Scraper does

Four query workflows in a single run:

  • 🌍 Full export. All 250 countries in one shot - flags, capitals, populations, and more.
  • 🗺️ Region filter. Scope to Africa, Americas, Asia, Europe, Oceania, or Antarctic.
  • 🔍 Name search. Find countries matching a full or partial name (e.g. "united" returns USA, UK, UAE, and more).
  • 📦 Controlled batch size. Use maxItems to limit output for testing or tiered data products.

Each record includes the flag image URL, common and official name, capital city, region and subregion, population, area in km², official languages, currencies, timezones, international calling codes, top-level domain extensions, and a landlocked indicator.

💡 Why it matters: country reference data underlies every global product - from phone number validators to e-commerce checkout forms to analytics dashboards. Rolling your own means hardcoding 250 rows and maintaining it manually. This Actor delivers a live, structured export in one click.


🎬 Full Demo

🚧 Coming soon: a 3-minute walkthrough showing how to go from sign-up to a downloaded country dataset.


⚙️ Input

InputTypeDefaultBehavior
maxItemsinteger10Records to return. Free plan caps at 10, paid plan up to 1,000,000.
regionstring"all"One of: all, africa, americas, asia, europe, oceania, antarctic.
searchstring""Optional partial or full country name. Overrides region filter when set.

Example: first 20 African countries.

{
"maxItems": 20,
"region": "africa"
}

Example: search for countries containing "united".

{
"maxItems": 10,
"search": "united"
}

⚠️ Good to Know: when both region and search are provided, the search parameter takes priority. The RestCountries API performs partial name matching, so "ger" will return Germany, Algeria, and Niger. Set maxItems to a higher value if you expect multiple matches.


📊 Output

Each country record contains 17 fields. Download the dataset as CSV, Excel, JSON, or XML.

🧾 Schema

FieldTypeExample
🖼️ imageUrlstring"https://flagcdn.com/w320/de.png"
🏷️ namestring"Germany"
📋 officialNamestring"Federal Republic of Germany"
🏛️ capitalstring"Berlin"
🌍 regionstring"Europe"
🗺️ subregionstring"Western Europe"
👥 populationnumber83491249
📐 areanumber357114
🗣️ languagesarray["German"]
💰 currenciesarray["euro"]
🕐 timezonesarray["UTC+01:00"]
📞 callingCodesarray["+49"]
🌐 tldarray[".de"]
🏔️ landlockedbooleanfalse
🔗 urlstring"https://restcountries.com/v3.1/name/Germany"
🕒 scrapedAtstring"2026-05-21T23:56:19.306Z"
errorstringnull

📄 Sample Records

[
{
"imageUrl": "https://flagcdn.com/w320/si.png",
"name": "Slovenia",
"officialName": "Republic of Slovenia",
"capital": "Ljubljana",
"region": "Europe",
"subregion": "Central Europe",
"population": 2130638,
"area": 20273,
"languages": ["Slovene"],
"currencies": ["euro"],
"timezones": ["UTC+01:00"],
"callingCodes": ["+386"],
"tld": [".si"],
"landlocked": false,
"url": "https://restcountries.com/v3.1/name/Slovenia",
"scrapedAt": "2026-05-21T23:56:19.306Z"
},
{
"imageUrl": "https://flagcdn.com/w320/se.png",
"name": "Sweden",
"officialName": "Kingdom of Sweden",
"capital": "Stockholm",
"region": "Europe",
"subregion": "Northern Europe",
"population": 10605098,
"area": 450295,
"languages": ["Swedish"],
"currencies": ["Swedish krona"],
"timezones": ["UTC+01:00"],
"callingCodes": ["+46"],
"tld": [".se"],
"landlocked": false,
"url": "https://restcountries.com/v3.1/name/Sweden",
"scrapedAt": "2026-05-21T23:56:19.306Z"
}
]

✨ Why choose this Actor

  • 🆓 Zero auth. No API keys, no registration, no billing setup - just run it.
  • 🌍 Complete coverage. All 250 countries in a single API call - no pagination loops.
  • 🖼️ Flag images included. Direct PNG URLs from flagcdn.com, ready to embed in any UI.
  • 🔍 Flexible filtering. Scope by region or search by name - one input field each.
  • 📦 Structured arrays. Languages, currencies, timezones, and calling codes returned as proper arrays, not comma-delimited strings.
  • Sub-second collection. Entire 250-country dataset collected in under 2 seconds.
  • 💾 4 export formats. CSV, Excel, JSON, XML - download or connect via API.
  • 🔌 Webhook ready. Trigger downstream workflows the moment data lands in the dataset.

📈 How it compares to alternatives

FeatureThis ActorManual CSVREST API directCompetitors
Flag image URLs-✅ rawvaries
Region filtervaries
Name searchvaries
Clean array fields✗ raw objectsvaries
CSV / Excel exportvaries
Webhook integrationrarely
Free plan available-rarely
Zero engineeringvaries

🚀 How to use

  1. Create a free account w/ $5 credit on Apify (no credit card required).
  2. Open the RestCountries Scraper actor page and click Try for free.
  3. Set region (or search) and maxItems in the input form.
  4. Click Start and wait a few seconds.
  5. Download your dataset as CSV, Excel, JSON, or XML from the Results tab.

💼 Business use cases

🛒 E-commerce and checkout

Build international checkout forms that auto-populate country names, phone prefixes, and currency symbols. Use the callingCodes field to validate phone number inputs client-side and the currencies field to display localized pricing. Feed the tld array into email domain validation logic.

📊 Market research and analytics

Segment global survey data by region or subregion without manual tagging. Join country records to your sales database using the name field as a key. Rank markets by population and area to prioritize expansion regions. Build choropleth maps using the structured country data with zero geocoding overhead.

🖥️ Developer tools and reference APIs

Seed your database with a canonical country list on first deploy instead of maintaining a static JSON file. Build country picker dropdowns with flag images, official names, and ISO-compatible data. Power autocomplete endpoints that handle partial name searches across 250 countries. Validate user-submitted country names against the official dataset.

🎓 Education and research

Build interactive world atlases with population and area data. Create geography quizzes using capitals and flags. Analyze language distribution across regions for computational linguistics work. Map landlocked countries for economics research on trade route dependencies.


🔌 Automating RestCountries Scraper

Connect this Actor to your favorite automation tools:

  • Make (Integromat): Trigger a scenario when the dataset updates - push country data to Google Sheets, Notion, or Airtable automatically.
  • Zapier: Send new country records to Slack, Salesforce, HubSpot, or any Zapier-connected app.
  • Webhooks: Configure a webhook to POST dataset results to your own API the moment a run completes.
  • Apify API: Schedule daily refreshes, download datasets programmatically, or integrate with your CI/CD pipeline.
  • n8n: Chain the Actor output into transformation nodes and route country data to dozens of downstream services.

🌟 Beyond business use cases

🔬 Research and academia

Linguists use the languages field to study which countries share official languages. Economists correlate landlocked status with GDP data. Demographers track population trends across subregions. Political scientists map regional bloc memberships using the region and subregion fields.

🎨 Creative projects

Artists and designers build generative flag galleries using the imageUrl field. Game developers seed their world-builder databases with real country names and capitals. Writers building alternate-history fiction use the official country names and territories as a canonical baseline.

🤝 Non-profit and civic tech

NGOs building humanitarian response tools need a reliable country list with calling codes for field communication. Open data projects use the dataset to enrich their own databases with language and currency metadata. Civic tech teams build multilingual government portals using the official country names.

🧪 Experimentation and prototyping

Frontend developers prototype country picker components in minutes using live flag URLs and structured name data. Backend engineers test their internationalization stack against all 250 countries before launch. QA teams generate comprehensive test matrices for currency and timezone edge cases.


🤖 Ask an AI assistant about this scraper

Want to know how to integrate this data into your project? Ask your favorite AI:

  • ChatGPT: "How do I use the RestCountries Scraper Apify actor to build a country dropdown with flags?"
  • Claude: "What fields does the RestCountries Scraper return and how can I join them to my database?"
  • Perplexity: "How do I automate country data collection with Apify's RestCountries Scraper?"
  • GitHub Copilot: "Generate TypeScript types for the RestCountries Scraper output schema."

❓ Frequently Asked Questions

🆓 Is this Actor free to use?

Free plan users get up to 10 records per run as a preview. Upgrade to a paid plan to unlock up to 1,000,000 records. Create a free account w/ $5 credit.

🔑 Do I need an API key for RestCountries?

No. The RestCountries v3.1 API is fully public and requires no authentication. This Actor handles all the API calls for you.

🌍 How many countries does it cover?

The RestCountries API covers 250 countries and territories. This includes all UN member states plus territories and dependencies like Puerto Rico, Hong Kong, and French Guiana.

🗺️ Can I filter by region?

Yes. Use the region input to filter by africa, americas, asia, europe, oceania, or antarctic. Set it to all (default) to fetch every country.

🔍 How does the name search work?

The search field passes your input to the RestCountries /name/{query} endpoint, which performs a case-insensitive partial match. Searching "united" returns the United States, United Kingdom, United Arab Emirates, and United Republic of Tanzania. When search is set, it overrides the region filter.

🖼️ Are the flag images usable in production?

Yes. The flag URLs point to flagcdn.com, a public CDN that serves high-quality PNG flags at 320px width. They can be embedded directly in any web or mobile application.

💰 What format are currencies returned in?

Currencies are returned as an array of currency names (e.g. ["euro", "United States dollar"]). Currency symbols and ISO codes are available in the raw API but normalized to names for readability.

📞 How are calling codes formatted?

Calling codes are returned as E.164-style prefixes (e.g. ["+1"] for the US, ["+49"] for Germany). Countries with multiple suffixes (e.g. US territories) will have multiple entries in the array.

⏱️ How fast does it run?

The entire 250-country dataset is collected in under 2 seconds. The API returns all data in a single HTTP call with no pagination.

🔄 How often should I run it?

Country data is stable - capitals rarely change, populations update annually. For most use cases, a monthly or quarterly refresh is sufficient. For production applications seeding a database, a weekly run ensures currency names and territory data stay current.

🧩 Can I export to Excel or CSV?

Yes. Once the run completes, click the Export button in the dataset view and choose CSV, Excel, JSON, or XML.

❌ What happens if a country has no capital?

Some territories (like Antarctica) have no capital city. In those cases, the capital field returns null rather than an empty string, making it easy to handle in downstream processing.


🔌 Integrate with any app

Connect your country dataset to hundreds of tools instantly:

Spreadsheets: Google Sheets, Microsoft Excel, Airtable
Databases: PostgreSQL, MySQL, MongoDB, Supabase, PlanetScale
BI tools: Tableau, Power BI, Metabase, Looker, Grafana
Automation: Make, Zapier, n8n, Pipedream, Activepieces
Storage: AWS S3, Google Cloud Storage, Azure Blob, Dropbox
CRMs: Salesforce, HubSpot, Pipedrive, Zoho
Communication: Slack, Discord, Microsoft Teams, email via SendGrid
Dev tools: REST API, Webhook, JavaScript SDK, Python SDK


ActorWhat it does
OurAirports Scraper85,000+ global airports with ICAO, IATA codes, coordinates, and elevation
Open-Meteo Weather ScraperFree historical and forecast weather data for any coordinates worldwide
World Bank Data ScraperEconomic indicators, GDP, population data from the World Bank open API

💡 Pro Tip: browse the complete ParseForge collection for 50+ structured data actors covering aviation, finance, weather, government data, and more - all zero-auth, production-ready, and free to preview.


This Actor is not affiliated with or endorsed by RestCountries or flagcdn.com. It uses only publicly available, unauthenticated API endpoints. Use responsibly and in accordance with the RestCountries terms of service.