Country Flags API
API documentation for fetching and managing global country flag data using the JSONly API.
🌍 🏳️ Country Flags API
The Country Flags API provides detailed information about country flags, including each country's name, ISO code, and flag image URL — all served in a fast and structured JSON format.
🔗 Base URL
https://jsonly.vercel.app/api/countries/flag⚙️ Query Parameters (GET)
Prop
Type
Search by Name or Code
Endpoint:
GET /api/countries/flag?country=inOutput Example
{
"success": true,
"total": 1,
"data": [
{
"flag": "https://twemoji.maxcdn.com/2/svg/1f1ee-1f1f3.svg",
"country": "India",
"code": "in"
}
]
}List with Pagination
Endpoint:
GET /api/countries/flag?limit=5&offset=20By default, the API returns 10 results. Use limit and offset for high-performance pagination across 260+ countries.
🛠️ Mutations (Full CRUD)
Mutations are currently in-memory and will revert to the original state upon server restart.
1. Add a Country Flag (POST)
Register a new country flag entry.
POST /api/countries/flag
Content-Type: application/json
{
"country": "Imagination Land",
"code": "IL",
"flag": "https://example.com/flag.svg"
}2. Update Entry (PUT/PATCH)
Update country name, flag URL, or ISO code by finding the existing entry by its ISO code.
PATCH /api/countries/flag
Content-Type: application/json
{
"code": "IL",
"country": "Dream Land",
"flag": "https://example.com/new-flag.svg"
}3. Remove Entry (DELETE)
Delete an entry using its ISO country code.
DELETE /api/countries/flag?code=ILBuilding a country selector? Check out our Country Dial Codes API to get the complete dataset.