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
185 stars 59 forks source link

Would it be possible to add a "top 5 cities" or filtering by population? #9

Closed alexgarciab closed 4 years ago

alexgarciab commented 4 years ago

Would it be possible to add a top 5 cities (per country) endpoint to be able to retrieve the most populated cities? Or even better, add a filter to get only the cities with more than X number of people. Thanks

MartinsOnuoha commented 4 years ago

@alexgarciab Alright, let's have this as an open issue, our likely options would be to carry out a data collection, or use a realtime API, because of the volatile nature of those figures.

alexgarciab commented 4 years ago

This one is a good one: https://public.opendatasoft.com/explore/dataset/geonames-all-cities-with-a-population-1000/table/?disjunctive.country - We are going to use it

MartinsOnuoha commented 4 years ago

Hey @alexgarciab I resolved to use the datahub API. https://datahub.io/core/population, I'll make a PR later today.

alexgarciab commented 4 years ago

Did you manage to get population per city or just per country?

MartinsOnuoha commented 4 years ago

I did get for cities as well. The response data just requires cleaning up and simplifying

MartinsOnuoha commented 4 years ago

What do you suggest are important details so I know what to keep in the response

alexgarciab commented 4 years ago

For me, being able to get the top 5 cities by population, per country, would be enough.

MartinsOnuoha commented 4 years ago

@alexgarciab a PR has been created for this issue, feel free to have a look.