FlagCDN Flag Size & Format Variants Scraper
Pricing
from $3.62 / 1,000 results
FlagCDN Flag Size & Format Variants Scraper
Scrapes FlagCDN country codes and names, then returns each one with a flag image URL built from your chosen width and file format. Export the full list to CSV, JSON, Excel, or XML.
Pricing
from $3.62 / 1,000 results
Rating
0.0
(0)
Developer
Acquisition Automation Co.
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Share
FlagCDN Flag Size & Format Variants Scraper
Scrape flag image size and format variants from FlagCDN for every country code, up to a million rows per run. Each row returns the country code, country name, and the direct image URL built from your chosen dimensions and file type. Export to CSV, JSON, Excel, or XML.
FlagCDN serves flag images in many sizes and formats, but there is no single download that lists every variant for every country. This actor reads the public country codes API, then constructs the exact image URL for the size and format you pick, so you get a complete dataset in one run.
| Who uses it | What they scrape FlagCDN for |
|---|---|
| Frontend developers | Generate a full list of flag image URLs to embed in a country picker or language selector. |
| Data analysts | Build a reference table of country codes and their flag assets for a reporting dashboard. |
| Designers | Pull every flag in a consistent size and format for a UI mockup or icon set. |
| Educators | Collect flag images for geography quizzes or classroom materials. |
What it does
This Actor collects FlagCDN country codes and names, then returns each one with a flag image URL built from your selected width and file format.
- š Country code and name: every row includes the ISO 3166-1 alpha-2 code and the official country name from FlagCDN.
- š Size selection: pick from 16, 24, 32, 48, 64, 128, 256, 512, 1024, or 2048 pixels wide.
- š¼ļø Format selection: choose PNG, SVG, WebP, AVIF, or JPEG XL for the output image URL.
- š Direct image URL: each record contains the fully constructed FlagCDN URL you can use immediately.
Results export to CSV, JSON, Excel, or XML, or straight from the API.
What you can do with FlagCDN data
š Populate a country selector.
A frontend developer runs the actor with size 32 and format PNG to get every flag URL, then feeds the dataset into a React country dropdown.
š Build a flag reference table.
A data analyst scrapes all country codes with 256px WebP URLs and joins them to a sales table so the BI dashboard shows a flag next to each country.
šØ Create a design asset pack.
A UI designer pulls every flag as SVG at 512px, then batches them into a Figma library for a travel app redesign.
š Prepare classroom materials.
An educator collects 128px PNG flags for every country and prints them as flash cards for a geography lesson.
Why choose this scraper
| What you get | |
|---|---|
| One run, all countries | Get every flag variant without writing a loop or manually constructing URLs. |
| Consistent output | Every row follows the same flat schema, ready for your database or frontend. |
| No API key needed | FlagCDN's public codes endpoint requires no authentication. |
| Flexible formats | Switch between raster and vector formats by changing one input field. |
What a FlagCDN record looks like
Every record returns as one flat JSON row. Here is a real one from a run:
{"imageUrl": "https://flagcdn.com/256/ad.png","countryCode": "ad","countryName": "Andorra","size": "256","format": "png","scrapedAt": "2026-09-26T12:20:42.452Z"}
Every value above comes from a real run. A field a record does not have comes back as null.
Configure the run
Drive the Actor by setting a maximum item count, a flag width in pixels, and an image format. The actor reads the full country list and builds one URL per country. The Input tab lists every parameter.
A first run with the defaults:
{"maxItems": 10,"size": "256","format": "png"}
A larger pull:
{"maxItems": 200,"size": "256","format": "png"}
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 FlagCDN Flag Size & Format Variants 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=acquistion-automation/flagcdn-flag-size-format-scraper"
Then prompt it in plain language to run the scraper and read back the results.
Troubleshooting
Why am I getting only 10 results?
Free Apify accounts are limited to 10 items per run. Upgrade to a paid plan to increase the max items limit and get all country codes.
The image URL returns a 404 error.
Check that the size and format you selected are valid. FlagCDN may not have every combination for every country. Try a common size like 256 and format PNG first.
Can I get the flag in a custom size not in the dropdown?
The actor supports only the sizes listed in the input. For a custom width, you can take the SVG URL and scale it in your application, or download the nearest PNG size and resize it.
The actor runs but the dataset is empty.
Make sure you have not set maxItems to 0. Also confirm that the FlagCDN codes endpoint is reachable from your network. A quick test is to open https://flagcdn.com/en/codes.json in a browser.
FAQ
| Question | Answer |
|---|---|
| Does this actor download the flag images themselves? | No. It returns the direct image URL for each country. You can use those URLs in your application or download the files separately. |
| What sizes can I request? | You can choose from 16, 24, 32, 48, 64, 128, 256, 512, 1024, and 2048 pixels wide. The height is determined automatically by the aspect ratio. |
| Which image formats are supported? | PNG, SVG, WebP, AVIF, and JPEG XL. SVG gives you a vector flag that scales to any size without losing quality. |
| Do I need a FlagCDN API key? | No. The actor uses the public codes.json endpoint, which requires no authentication or registration. |
| How many items can I scrape? | Free Apify users can scrape up to 10 items as a preview. Paid users can scrape up to 1,000,000 items, which covers every country code many times over. |
| Can I filter by specific countries? | The actor returns all available country codes. You can filter the output dataset afterward using a tool like Excel or a short script. |
| What does the output look like? | Each row contains the country code, the country name, and the full flag image URL built from your chosen size and format. |
| Is the country list up to date? | The actor reads the live codes.json file from FlagCDN on each run, so you always get the current list of country codes and names. |
Related actors
Browse the full Acquisition Automation collection for more scrapers.
š Need help? Open an issue in the Issues tab of this Actor with your run ID, your input, and what you expected.
Pricing
This Actor uses pay-per-result pricing: $0.004 per result collected. You are billed only for the results you receive, so a run that returns nothing costs nothing.
ā ļø 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.
