2

I'm looking for data containing the name of the country, the phone country code, and the phone digits length (without the phone country code) like this

[{"name": "United States", "code": "+1", "length": 10},
  {"name": "China", "code": "+86", "length": 11}]

I don't need the landline number length, just the mobile number length. if a country can have multiple number lengths, like 7 and 8, then the dataset should have the max length, in this case, 8.

It would be great if I can get this data in JSON, but any format would do. I'm only finding this data on Wikipedias and such, with no reliable sources, and hard to work with, I need to copy and paste from webpages.

I need this data to validate input field phone numbers. I currently have 80 countries already, I'd like to have the complete list though.

1 Answer 1

1

I think this website globalcallforwarding.com/international-call-prefixes has the right data for you. It includes 242 Countries. To generate the JSON data from this, you can use this website https://tableconvert.com/html-to-json

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.