Country Dial Codes API
API documentation for fetching and managing international country dial codes using JSONly API.
🌍 📞 Country Dial Codes API
The Country Dial Codes API provides accurate and up-to-date information about international dialing codes, including each country's name, ISO code, and calling prefix.
🔗 Base URL
https://jsonly.vercel.app/api/countries/dial⚙️ Query Parameters (GET)
Prop
Type
Search by Name or Code
Endpoint:
GET /api/countries/dial?country=indiaOutput Example
{
"success": true,
"total": 1,
"data": [
{
"name": "India",
"dial_code": "+91",
"code": "IN"
}
]
}List with Pagination
Endpoint:
GET /api/countries/dial?limit=5&offset=10By default, the API returns 10 results. Use limit and offset for high-performance pagination across 240+ countries.
🛠️ Mutations (Full CRUD)
Mutations are currently in-memory and will revert to the original state upon server restart. Note that these changes are distinct from the Flag API.
1. Add a Dial Code (POST)
Register a new dial code entry.
POST /api/countries/dial
Content-Type: application/json
{
"name": "Atlantis",
"dial_code": "+000",
"code": "AT"
}2. Update Entry (PUT/PATCH)
Update name, dial code, or ISO code by finding the existing entry by its ISO code.
PATCH /api/countries/dial
Content-Type: application/json
{
"code": "AT",
"name": "New Atlantis",
"dial_code": "+999"
}3. Remove Entry (DELETE)
Delete an entry using its ISO country code.
DELETE /api/countries/dial?code=ATBuilding a phone number validator? Pair this with our Country Flags API for a complete UI.