MartinsOnuoha / countriesNowAPI

CountriesNow is an Open source API for retrieving geo-information for countries, including their states, cities, population, etc. 🌎
http://countriesnow.space
MIT License
179 stars 55 forks source link

Feature request: Country code as param #83

Closed icopp closed 2 years ago

icopp commented 2 years ago

Currently the country name is required, but preferred country names can be inconsistent (for example, see "Viet Nam" vs "Vietnam"). It would be useful to instead allow one of either country, countryCode (an alias for countryCodeIso2), countryCodeIso2, or countryCodeIso3.

MartinsOnuoha commented 2 years ago

Hi @icopp, this makes a lot of sense, If I understand you correctly: since we are aggregating data from multiple data sources there are chances of having variations in the naming, and the best possible solution for this would be to make the country name optional and provide another query param that a little more consistent like the Iso or Iso3

icopp commented 2 years ago

Yes, exactly.

MartinsOnuoha commented 2 years ago

Sounds great, which endpoints would you suggest we add this feature to?

MartinsOnuoha commented 2 years ago

@icopp Have a look at the open MR, looks good?

icopp commented 2 years ago

Sorry about the delay, but the gist there all looks good to me.

MartinsOnuoha commented 2 years ago

Great thanks