REST Countries Scraper avatar

REST Countries Scraper

Pricing

from $19.00 / 1,000 results

Go to Apify Store
REST Countries Scraper

REST Countries Scraper

Scrapes country data from REST Countries API by region or name search. Returns each country as a flat row with name, capital, region, population, area, currencies, languages, and flag URL.

Pricing

from $19.00 / 1,000 results

Rating

0.0

(0)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

0

Monthly active users

6 days ago

Last modified

Share

ParseForge

REST Countries Scraper

Scrape country data and flags from REST Countries, up to 250 countries per run. Every country comes with its name, capital, region, population, area, currencies, languages, and flag image URL. No API key or login. Export to CSV, JSON, Excel, or XML.

REST Countries is a free public API that provides detailed information about every country in the world, but querying it manually means writing code, handling pagination, and parsing nested JSON. This Actor reads the API directly, filters by region or country name, and returns each country as one flat row. You get clean, structured data without any setup.

Who uses itWhat they scrape REST Countries for
Market researchersBuild a dataset of countries by region for demographic analysis
Travel app developersPopulate a country picker with names, capitals, and flag images
Data journalistsCompare population, area, and language data across countries
EducatorsCreate geography quizzes and reference tables for students

What it does

This Actor collects country data from REST Countries by region or name search, and returns each country as a flat row with fields like name, capital, region, population, area, currencies, languages, and flag URL.

  • 🌍 Region filter: Select Africa, Americas, Asia, Europe, Oceania, or Antarctic, or scrape all 250 countries.
  • 🔍 Name search: Enter a partial country name like 'united' to get matching countries.
  • 📊 Flat output: Each country is returned as a single row, ready for spreadsheets or databases.
  • 🖼️ Flag URLs: Every record includes a direct link to the country's flag image.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with REST Countries data

📈 Build a regional country dataset.

A market researcher selects the Europe region and scrapes all 50 countries to compare population and area for a report.

🗺️ Populate a travel app's country selector.

A developer scrapes all countries with their flag URLs and capital names to seed a mobile app's destination picker.

📰 Fact-check country statistics.

A journalist searches for 'united' to quickly pull data on the United States, United Kingdom, and United Arab Emirates for an article.

🎓 Create geography teaching materials.

An educator scrapes all countries in Africa to generate a worksheet with capitals, populations, and flags.

Why choose this scraper

What you get
No API keyREST Countries is free and open, no registration or authentication needed
All 250 countriesCovers every sovereign state and dependent territory in one dataset
Flat schemaNested fields like currencies and languages are flattened into simple columns
Export anywhereDownload as CSV, JSON, Excel, or XML for your workflow

How it compares

No other Store actor targets REST Countries the same way, so the honest comparison is with the alternatives teams actually weigh.

REST Countries ScraperBuild it in-houseBy hand
SetupRun it now, zero configDays of engineeringNone, but hours per pull
When REST Countries changesMaintained for youYou fix itYou re-learn the page
Proxies, retries, anti-botBuilt inYour problemBrowser only
OutputFixed JSON schema, CSV/Excel exportWhatever you buildCopy-paste
CostPay per resultEngineering timeAnalyst hours

Configure the run

Drive the Actor with a region filter or a country name search, and set a maximum number of countries to collect per run. The Input tab lists every parameter.

A first run with the defaults:

{
"maxItems": 10,
"region": "all"
}

A larger pull:

{
"maxItems": 200,
"region": "all"
}

Pricing

Pay-per-result: $0.021 per result collected. You pay only for the results written to your dataset.

Results collectedApproximate cost
100 results$2.10
1,000 results$21.00
10,000 results$210.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the REST Countries Scraper.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to REST Countries through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

$claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/restcountries-scraper"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting no results?

Check your region filter and country name search. If you set a region and also enter a country name that is not in that region, you will get zero results. Try clearing the search field or setting region to 'All Regions'.

Why is the run slow?

The REST Countries API may be rate-limited. Reduce the maxItems value or run during off-peak hours. The Actor processes countries sequentially to avoid hitting limits.

Why are some fields empty?

Some countries may not have data for certain fields, such as capital or area. This is normal for dependent territories. Check the REST Countries documentation for field availability.

Why did I get fewer countries than maxItems?

The total number of countries returned depends on your filters. If you set maxItems to 100 but only 50 countries match your region, you will get 50 results.

Why is the flag URL not working?

Flag URLs are provided by REST Countries and may change. If a URL is broken, try re-running the Actor to get the latest data, or check the REST Countries website for updates.

FAQ

QuestionAnswer
Is the REST Countries API free?Yes, REST Countries is a free public API with no authentication or API key required. This Actor uses the public endpoint directly.
How many countries can I scrape in one run?You can scrape up to 250 countries, which is the full list available from REST Countries. Use the maxItems input to limit the number if you need fewer.
Can I filter by region?Yes, select from Africa, Americas, Asia, Europe, Oceania, or Antarctic. Choose 'All Regions' to scrape every country.
Can I search for a specific country?Yes, use the country name search field. It supports partial matches, so entering 'united' returns the United States, United Kingdom, and United Arab Emirates.
What data fields are returned for each country?Each country record includes name, capital, region, subregion, population, area, currencies, languages, flag URL, and more. The exact fields are shown in the sample output.
Does the output include flag images?Yes, every country record includes a direct URL to its flag image in PNG or SVG format, which you can download or embed.
What export formats are supported?You can export the scraped data as CSV, JSON, Excel, or XML from the Apify dataset.
Is there a rate limit on the REST Countries API?The public API is generally rate-limited, but this Actor handles requests efficiently. For large runs, the maxItems input lets you control the volume.
Can I schedule this Actor to run regularly?Yes, you can set up a schedule in Apify to run this Actor daily, weekly, or at any interval to keep your country data up to date.
Does this Actor work with Apify's integrations?Yes, you can connect the output dataset to Google Sheets, Slack, Zapier, or any other Apify integration for automated workflows.

Browse the full ParseForge collection for more scrapers.

🆘 Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by REST Countries. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.