-
Notifications
You must be signed in to change notification settings - Fork 23
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: API call executed successfully, but did not return expected json format" when using wb_stat to download data #43
Comments
I am having the same problem when using the package. However I try with the package With library(wbstats)
wb_data(indicator = "NY.GDP.MKTP.CD",
country = "BR",
start_date = 2021,
end_date = 2021)
#> Error: API call executed successfully, but did not return expected json format Created on 2024-02-18 with reprex v2.1.0 With library(WDI)
WDI(indicator = "NY.GDP.MKTP.CD",
country = "BR",
start = 2021,
end = 2021)
#> Error in WDI(indicator = "NY.GDP.MKTP.CD", country = "BR", start = 2021, : The following indicators could not be downloaded: NY.GDP.MKTP.CD.
#>
#> Please make sure that you are running the latest version of the `WDI` package, and that the arguments you are using in the `WDI()` function are valid.
#>
#> Sometimes, downloads will suddenly stop working, even if nothing has changed in the R code of the WDI package. ("The same WDI package version worked yesterday!") In those cases, the problem is almost certainly related to the World Bank servers or to your internet connection.
#>
#> You can check if the World Bank web API is currently serving the indicator(s) of interest by typing a URL of this form in your web browser:
#>
#> https://api.worldbank.org/v2/en/country/all/indicator/NY.GDP.MKTP.CD?format=json&date=:&per_page=32500&page=1 Created on 2024-02-18 with reprex v2.1.0 I think the problem is in te API taking into account that a similar problem happens with the package import wbgapi as wb
wb.data.DataFrame(series = "NY.GDP.MKTP.CD",
economy = "BRA",
time = range(2021, 2021))
Traceback (most recent call last):
File "C:\Users\Usuario\ANACON~1\Lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\ANACON~1\Lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\ANACON~1\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\ANACON~1\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 8 column 1 (char 9)
During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Apparently the problem has been solve. Now the data can be downloaded without problem. |
Hello,
when trying to download indicators using the command wb_data I receive the following error:
Error: API call executed successfully, but did not return expected json format
For instance when I try to reproduce the line of code available in the help:
wb_data("NY.GDP.MKTP.CD")
The text was updated successfully, but these errors were encountered: