Phone inputs need the +code. Here's where to get them without hard-coding a list that goes stale.
One country
curl https://countries.dev/alpha/IN{ "name": "India", "alpha2Code": "IN", "callingCodes": ["91"] }callingCodes is an array — most countries have one, a few have several.
The whole list, for a phone input
Pull only what a country-code selector needs:
curl "https://countries.dev/countries?fields=name,alpha2Code,flag,callingCodes&sort=name"const options = countries.map(
(c) => `${c.flag} ${c.name} +${c.callingCodes[0]}`
);Reverse lookup
Have a +code and want the country?
curl https://countries.dev/callingcode/91Pass the digits without the +. Docs →
Written by
Dov Azencot
At
Tue Jun 23 2026