Country Flags Scraper
Pricing
from $9.00 / 1,000 result items
Country Flags Scraper
Fetches country flags from FlagCDN and returns each as a row with a country name, ISO 3166-1 alpha-2 code, and direct PNG URLs at selected widths.
Pricing
from $9.00 / 1,000 result items
Rating
0.0
(0)
Developer
ParseForge
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
6 days ago
Last modified
Categories
Share
Country Flags Scraper
Download the complete country flags collection from FlagCDN, from a single row to a million, as ready-to-use PNG URLs or ISO-coded data. Every flag comes with multi-resolution PNG links and localized country names. No image processing needed. Export to CSV, JSON, Excel, or XML.
Manually hunting down flag images for every country wastes hours of clicking through galleries, and resizing them for your project adds another step you can't automate. The FlagCDN Country Flags Scraper fetches the entire public country flags dataset from FlagCDN in one pass, giving you direct PNG URLs and country metadata in a clean, structured dataset. Pick your resolutions, languages, and the exact countries you need, and walk away with a ready-to-import file.
| Who uses it | What they scrape FlagCDN for |
|---|---|
| Front-end developers | Pre-build a sprite sheet or a CDN-ready flag URL list for a multi-language web application. |
| Data analysts | Construct a country master lookup table with flag identifiers for reports, dashboards, and BI tools. |
| Mobile app developers | Bundle an offline directory of country flags at precise pixel sizes for phone and tablet UIs. |
| E-learning content creators | Download a clean set of flag images to illustrate geography quizzes, language courses, and interactive maps. |
What it does
This Actor collects country flags from FlagCDN and returns each one as a flat row containing a country name, its ISO 3166-1 alpha-2 code, and multiple PNG image URLs at your chosen widths.
- 🏁 Multi-resolution PNG URLs: Choose any subset from 20px up to 2560px wide, and every record receives a link for each selected width.
- 🇺🇳 Targeted country filter: Limit output to a specific list of ISO alpha-2 codes, or leave empty to collect 250+ flags in one run.
- 🗣️ Localized names: Fetch country names in English, Spanish, French, German, Italian, Portuguese, Chinese, Japanese, or Korean.
Results export to CSV, JSON, Excel, or XML, or straight from the API.
What you can do with FlagCDN data
🌐 Build a language switcher with flags.
A front-end developer runs the Actor in codes mode to generate a JSON file that maps each country to its ISO code, then uses the flag URLs to display a visual country selector on the site.
📊 Enrich a country analytics dashboard.
A data analyst fetches all flags at 160px and 640px, joins the dataset with a sales performance table by ISO code, and renders a per-country sales report with accurate flags in Tableau.
📱 Bundle offline assets for a travel app.
A mobile developer selects the 80px and 320px resolutions for 30 target countries, exports the flat file, and writes a script to preload the flag images into the app's asset catalog.
🧑🏫 Create geography flashcards.
A teacher runs the scraper for all 250+ flags with names in Japanese, then prints a CSV of image URLs and names to lay out a complete set of printed flashcards for the classroom.
Why choose this scraper
| What you get | |
|---|---|
| No image scraping or cropping | Receive clean, direct PNG URLs that load immediately, without storing raw image blobs or running server-side resize jobs. |
| Consistent schema | Every row uses identical field names so your downstream scripts and ETL pipelines never break. |
| Nine languages built in | Localize the country name field with a single dropdown, no translation API calls required. |
| Lightning fast runs | Flags are collected from FlagCDN's CDN in parallel; you can pull 200+ flags with multiple resolutions in a few seconds. |
How it compares
No other Store actor targets FlagCDN the same way, so the honest comparison is with the alternatives teams actually weigh.
| Country Flags Scraper | Build it in-house | By hand | |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When FlagCDN 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 an optional ISO alpha-2 country filter and a resolution picker, and every flag arrives in a consistent schema with no extra processing in your code. The Input tab lists every parameter.
A first run with the defaults:
{"maxItems": 10,"mode": "flagUrls","language": "en","resolutions": ["w80","w160","w320","w640"]}
A larger pull:
{"maxItems": 200,"mode": "flagUrls","language": "en","resolutions": ["w80","w160","w320","w640"]}
Pricing
Pay-per-result: $0.012 per result collected. You pay only for the results written to your dataset.
| Results collected | Approximate cost |
|---|---|
| 100 results | $1.20 |
| 1,000 results | $12.00 |
| 10,000 results | $120.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
- Create a free Apify account with $5 in credit.
- Open the Country Flags Scraper.
- Set your inputs and any filters, then click Start.
- 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 FlagCDN 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/flagcdn-country-flags-scraper"
Then prompt it in plain language to run the scraper and read back the results.
Troubleshooting
Why am I getting zero results?
Ensure you have not accidentally filtered the 'Countries' list down to a code that FlagCDN does not serve. Leave the field empty and run again; if you still get nothing, check that the FlagCDN service is reachable from your browser.
The flag URLs return a 404 when I open them.
Confirm that you are using the exact URL from the dataset. FlagCDN uses a case-sensitive path with the lowercase alpha-2 code. Also verify that the selected country code is a valid ISO assignment; some territories may have a flag only under a different code.
My dataset still shows English names even though I selected French.
Double-check the 'Country Name Language' dropdown before starting the run. The language setting is applied at run time, so changing it in the input and re-running will give you the correct localized column.
The exported file is missing some resolution columns.
The output columns correspond exactly to the resolutions you selected in the input. Visit the run's input tab, add the missing widths, and execute a new run to get the full set of PNG links you expect.
I hit the maximum items limit but need more flags.
Raise the 'Maximum flags' slider in the input. The Actor can return up to one million rows, which is more than enough for every flag, but the limit is there to protect you from accidental oversized runs when you only need a sample.
FAQ
| Question | Answer |
|---|---|
| What is FlagCDN? | FlagCDN is a free public content delivery network that serves high-quality PNG flag images for every country and many territories. This Actor reads FlagCDN's standard directory structure and returns the official image URLs directly. |
| Does this Actor download the actual image files, or the URLs? | It returns the PNG image URLs as text fields. You can feed those URLs to your application, a download manager, or another Apify Actor without storing heavy image binaries inside your dataset. |
| How do I get a list of ISO codes without images? | Set the mode to 'Codes only' in the input. The Actor will return a compact dataset with the country name and its ISO 3166-1 alpha-2 code, skipping the resolution array entirely. |
| How many resolutions can I request at once? | You can select any combination of the eight offered widths, from w20 to w2560. Pick the ones that match your design tokens and the Actor includes a dedicated URL for each in every row. |
| Can I filter by a specific set of countries? | Yes. Use the 'Countries' multi-select to pick exactly the ISO alpha-2 codes you need. Leave it empty and the Actor collects every available flag, typically 250+ records. |
| Does this Actor require an API key or an account on FlagCDN? | No. FlagCDN flags are served openly and this Actor reads the same public image paths a browser would use; no API registration is necessary. |
| In which formats can I export the data? | You can export your results in CSV, JSON, Excel, or XML right from the Apify dataset tab. The flat row structure works well with pivot tables, SQL imports, and charting libraries. |
| Is the country name available in languages other than English? | Yes. Choose one of nine languages in the input, and the 'country' field will contain the localized name. The ISO code and flag URLs remain consistent across all language settings. |
| Can I use this for all 195+ UN member states? | The Actor covers every ISO 3166-1 alpha-2 code that FlagCDN hosts, which typically includes over 250 flags including territories and special regions like the European Union. |
| How fast does a full run complete? | Collecting 250+ records with four resolutions finishes in a few seconds on the default infrastructure; the Actor fetches metadata concurrently and writes the dataset as soon as each row is ready. |
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 FlagCDN. 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.
