dr5hn / countries-states-cities-database

🌍 Discover our global repository of countries, states, and cities! 🏙️ Get comprehensive data in JSON, SQL, PSQL, XML, YAML, and CSV formats. Access ISO2, ISO3 codes, country code, capital, native language, timezones (for countries), and more. #countries #states #cities
https://dr5hn.github.io/countries-states-cities-database/
Open Data Commons Open Database License v1.0
7.38k stars 2.56k forks source link

For countries, `phone_code` sometimes include area code and sometimes does not. #457

Closed MaybeThisIsRu closed 1 month ago

MaybeThisIsRu commented 2 years ago

For example, for the US, the phone code is 1 which is correct if we consider country codes.

For the Dominican Republic, the phone code in the countries-states-cities-database is listed as 1809 and 1829 which is correct if we consider country+area codes. Country code being 1 and area codes being 809 and 829 (and also 849, but that's besides the point right now).

What methodology is being used? Can we rename phone_code to correctly reflect if the field means country_code or country_area_code?

dr5hn commented 2 years ago

@MaybeThisIsRu Thanks for reporting. 🎉

This column is messed up actually, Previously I took data from this resource https://restcountries.com/v2/all

They've updated the calling codes to be more accurate now. So I will soon update them as per the new version. https://restcountries.com/v3.1/all

dr5hn commented 1 month ago

Fixed in #835 835