datasets / population

Population figures for countries, regions (e.g. Asia) and the world.
https://datahub.io/core/population
98 stars 148 forks source link

Data source URL is invalid #10

Open anuveyatsu opened 2 years ago

anuveyatsu commented 2 years ago

This URL doesn't return CSV data anymore - https://github.com/datasets/population/blob/master/scripts/process.py#L10

To add "this url" is http://api.worldbank.org/countries/all/indicators/SP.POP.TOTL?format=csv

Response is:

<wb:error xmlns:wb="http://www.worldbank.org">
<wb:message id="111" key="Invalid format">The requested response format was not found.</wb:message>
</wb:error>
rufuspollock commented 2 years ago

@anuveyatsu it just looks like API is still there in general it is just they removed ?format=csv option and changed to downloadformat. Annoyingly though they now zip the file. Frankly i think the easiest would be just to use the json option and convert that over to whatever we need. Here's the JSON link:

http://api.worldbank.org/v2/countries/all/indicators/SP.POP.TOTL?format=json

Details

Specifically https://datahelpdesk.worldbank.org/knowledgebase/articles/898581 states:

Output Format: The API supports the following four output formats.

So CSV is no longer there ... However, they now have downloadformat:

Download Format: The API supports the following three download formats.