Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error at getting SP.POP.TOTL #15

Open
mariano22 opened this issue Jun 19, 2020 · 4 comments
Open

Error at getting SP.POP.TOTL #15

mariano22 opened this issue Jun 19, 2020 · 4 comments

Comments

@mariano22
Copy link

I did
wb.get_series('SP.POP.TOTL', mrv=1)
And get:

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
<ipython-input-3-15e1e87a7b59> in <module>
----> 1 wb.get_series('SP.POP.TOTL', mrv=1)

~/anaconda3/lib/python3.7/site-packages/world_bank_data/indicator.py in get_series(indicator, country, id_or_value, simplify_index, **params)
     40     params['format'] = 'jsonstat'
     41 
---> 42     idx = wb_get('country', country, 'indicator', indicator, **params)
     43     _, idx = idx.popitem()
     44 

~/anaconda3/lib/python3.7/site-packages/world_bank_data/request.py in wb_get(*args, **kwargs)
     68 
     69     response = get(url=url, params=params, proxies=proxies)
---> 70     response.raise_for_status()
     71     try:
     72         data = response.json()

~/anaconda3/lib/python3.7/site-packages/requests/models.py in raise_for_status(self)
    938 
    939         if http_error_msg:
--> 940             raise HTTPError(http_error_msg, response=self)
    941 
    942     def close(self):

HTTPError: 502 Server Error: Bad Gateway for url: http://api.worldbank.org/v2/country/all/indicator/SP.POP.TOTL?mrv=1&format=jsonstat&per_page=20000
@mwouts
Copy link
Owner

mwouts commented Jun 20, 2020

Hello @mariano22 , thanks for reporting this.

Could you to check if you can access the world bank from your system? I mean, can you open http://api.worldbank.org/v2/country/all/indicator/SP.POP.TOTL?mrv=1&format=jsonstat&per_page=20000 in your browser?

Please also note this from https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502:

A Gateway might refer to different things in networking and a 502 error is usually not something you can fix, but requires a fix by the web server or the proxies you are trying to get access through.

@mariano22
Copy link
Author

I think it was an error that maybe the server had at the moment.

@mwouts
Copy link
Owner

mwouts commented Dec 16, 2020

I think it was an error that maybe the server had at the moment.

So do I! Does everything work properly now?

@mariano22
Copy link
Author

Yes! I use it daily to update https://covidargentina.com.ar/ Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants