ParseForge Scrapers

REST Countries Scraper

parseforge/restcountries-scraper

OtherDeveloper toolsLead generation

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.

Run this scraper See the API call
Total users
2
Monthly active
0
Total runs
109
Bookmarked
0
Rating
Not rated yet
Last modified
12 days ago

Overview

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 it What they scrape REST Countries for
Market researchers Build a dataset of countries by region for demographic analysis
Travel app developers Populate a country picker with names, capitals, and flag images
Data journalists Compare population, area, and language data across countries
Educators Create 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 key REST Countries is free and open, no registration or authentication needed
All 250 countries Covers every sovereign state and dependent territory in one dataset
Flat schema Nested fields like currencies and languages are flattened into simple columns
Export anywhere Download 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 Scraper Build it in-house By hand
Setup Run it now, zero config Days of engineering None, but hours per pull
When REST Countries changes Maintained for you You fix it You re-learn the page
Proxies, retries, anti-bot Built in Your problem Browser only
Output Fixed JSON schema, CSV/Excel export Whatever you build Copy-paste
Cost Pay per result Engineering time Analyst 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 collected Approximate 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

Question Answer
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.

Related actors

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.

Input

FieldTypeWhat it doesDefault
maxItems integer How many countries to collect per run. 10
region string (7 options) Filter countries by region. Select 'all' to scrape all 250 countries. all
search string Optional. Search for a specific country by name (partial match supported, e.g. 'united'). Leave blank to use region filter. not set

Pricing

from $19.00 per 1,000 results

Charged forWhat it isPrice each
result Single result in the default dataset. $0.019 to $0.021

Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.

API

One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.

POST Β· run and get results
curl -X POST "https://api.apify.com/v2/acts/parseforge~restcountries-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "helloWorld": 123
  }'

Examples

Input that runs as-is.

input.json
{
  "helloWorld": 123
}

Reviews

No reviews yet. Be the first.

Issues

We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.

Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.

Related scrapers

Run REST Countries Scraper on Apify All scrapers