ParseForge Scrapers

REST Countries Info Scraper

parseforge/restcountries-info-scraper

Developer toolsEducationOther

Scrapes country information from the REST Countries API. Filter by name, region, language, or currency code, and return each country as a flat row with fields like capital, population, and flags.

Run this scraper See the API call
Total users
1
Monthly active
0
Total runs
108
Bookmarked
0
Rating
Not rated yet
Last modified
8 days ago

Overview

ParseForge

REST Countries Info Scraper

Scrape country data for any nation, region, language, or currency, up to a million records per run. Each country comes with its capital, population, area, currencies, languages, borders, and flags. No API key required. Export to CSV, JSON, Excel, or XML.

The REST Countries API provides free, structured data on every country in the world, but querying it programmatically still requires writing HTTP requests and parsing nested JSON. This Actor reads the public dataset directly, filters by name, region, language, or currency code, and returns each match in one flat schema. You can also limit the output to only the fields you need.

Who uses it What they scrape REST Countries for
Data analysts Building a reference table of country attributes for a dashboard or report.
Market researchers Segmenting countries by region, language, or currency for a market entry study.
Educators Gathering up-to-date country facts for a geography quiz or teaching material.
Travel app developers Populating a destination database with flags, capitals, and timezones.

What it does

This Actor collects country information from the REST Countries API by name, region, language, currency, or independence status, and returns each country as a flat row.

  • 🌍 All Countries: fetch every country in the dataset in one run.
  • πŸ” Search by Name: find a country by its full or partial common name.
  • πŸ—ΊοΈ Filter by Region: restrict results to Africa, Americas, Asia, Europe, Oceania, or Antarctic.
  • πŸ—£οΈ Filter by Language: get every country where a given language is spoken.
  • πŸ’± Filter by Currency Code: list countries that use a specific ISO 4217 currency.
  • βœ… Independent Countries Only: return only sovereign states, excluding territories.

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

What you can do with REST Countries data

πŸ“Š Build a country reference table.

A data analyst runs the Actor in 'All Countries' mode, exports to CSV, and loads the file into a BI tool to join with sales data by country code.

🌐 Segment markets by language.

A market researcher filters by 'spanish' to get every Spanish-speaking country, then reviews populations and currencies to prioritize launch regions.

πŸ’± Audit currency usage.

A financial analyst filters by 'EUR' to list all countries using the Euro, then checks borders and landlocked status for logistics planning.

🏫 Create a geography quiz dataset.

An educator fetches all countries with only the name, capital, flag, and population fields, then imports the JSON into a quiz app.

Why choose this scraper

What you get
No API key The REST Countries API is public and requires no authentication.
Flat output Nested objects like currencies and languages are normalized into a consistent row.
Field projection Pick exactly which fields to include, keeping datasets small and focused.
Up to 1M rows Collect every country or a filtered subset in a single run.

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 Info 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 from a name search, region, language, currency code, or independence status, and apply a field projection so only the columns you need reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

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

A larger pull:

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

Pricing

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

Results collected Approximate cost
100 results $1.60
1,000 results $16.00
10,000 results $160.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 Info 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-info-scraper"

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

Troubleshooting

Why am I getting no results when I search by name?

Check the spelling of the country name. The search is case-insensitive and matches partial strings, so 'united' will find 'United States' and 'United Kingdom'. Try a shorter substring if the full name fails.

The currency filter returns an empty dataset.

Make sure you are using the correct three-letter ISO 4217 currency code, such as 'USD' or 'EUR'. Common names like 'Dollar' will not work.

Some fields are missing in the output.

If you used the Fields Projection, only the selected fields are returned. Clear the projection to get the full record. Some fields like 'gini' may be empty for certain countries.

The run takes a long time with 'All Countries' mode.

The dataset contains about 250 countries, so a full fetch is fast. If you experience slowness, check your Apify plan limits or reduce the 'Maximum countries' value.

FAQ

Question Answer
Do I need an API key to use this Actor? No. The REST Countries API is a free, public dataset that requires no authentication or API key.
What fields are available for each country? The full record includes name, capital, population, area, currencies, languages, borders, flags, timezones, and many more. You can select a subset using the Fields Projection input.
Can I search for a country by its native name? The name search uses the common English name. For native names, fetch the full record and check the 'translations' or 'altSpellings' fields.
How do I filter by language? Set the mode to 'Filter by Language' and type the language name in English, such as 'spanish', 'french', or 'arabic'.
What currency code format should I use? Use the three-letter ISO 4217 code, like 'USD', 'EUR', or 'JPY'. The Actor matches countries where that currency is official.
Does this Actor include dependent territories? Yes, by default. Use the 'Independent Countries Only' mode to exclude territories and return only sovereign states.
Can I limit the number of countries returned? Yes. Set the 'Maximum countries' input to cap the result set, even when using 'All Countries' mode.
What output formats are supported? You can export the dataset to CSV, JSON, Excel, or XML from the Apify platform.
How often is the country data updated? The Actor reads from the live REST Countries API on each run, so you always get the latest available data.
Can I get only the flag image URLs? Yes. Use the Fields Projection to select only 'flags' and 'name', and the output will contain those columns.

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 Maximum number of countries to collect per run. 10
mode string (6 options) How to query the dataset. all
nameQuery string Used when mode is 'Search by Name'. Full or partial country name (e.g. 'germany', 'united'). not set
region string (6 options) Used when mode is 'Filter by Region'. not set
language string Used when mode is 'Filter by Language'. Language name (e.g. 'spanish', 'french', 'arabic'). not set
currencyCode string Used when mode is 'Filter by Currency Code'. ISO 4217 code (e.g. 'USD', 'EUR', 'JPY'). not set
fields array Optional. Only include the selected fields. Leave empty to return the full record. not set

Pricing

from $12.00 per 1,000 results

Charged forWhat it isPrice each
Result Item Charged once per result collected. $0.012 to $0.016

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-info-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 Info Scraper on Apify All scrapers