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

Possible update in IMF API #11

Open
jopsamp opened this issue Mar 21, 2017 · 4 comments
Open

Possible update in IMF API #11

jopsamp opened this issue Mar 21, 2017 · 4 comments

Comments

@jopsamp
Copy link

jopsamp commented Mar 21, 2017

Hello,

I was using the package normally until today when I received the following erro message:

Error: lexical error: invalid char in json text.
<html xmlns="http://www.w3.org/
(right here) ------^

After checking the API query in the browser, I noticed that the query generated by the package was receiving the following error message in the browser:

API : http://dataservices.imf.org/REST/SDMX_JSON.svc/CompactData/IFS/Q+A.BR+US.NGDP_R_PT?startPeriod=1990-01-01&endPeriod=2017-12-31

Error: The requested URL does not comply with standards and has been rejected. Please contact your admin with the support ID 9176104504529288535

Changing the separation between the variable code and the startPeriod from ? to + solved the problem. I believe this is due to a change in IMF's API.

New API: http://dataservices.imf.org/REST/SDMX_JSON.svc/CompactData/IFS/Q+A.BR+US.NGDP_R_PT+startPeriod=1990-01-01&endPeriod=2017-12-31

Any thoughts?

@jopsamp jopsamp changed the title Possible update in FMI API Possible update in IMF API Mar 21, 2017
@ghost
Copy link

ghost commented Mar 27, 2017

I have exactly the same problem

@mingjerli
Copy link
Owner

mingjerli commented Mar 27, 2017

Both API calls work right now. I cannot replicate the error at this time. Still investigating the problem.
However, the second API call with +startPeriod does not filter the data based on date range. I can see the starting data point is 1950-Q1.

@ghost
Copy link

ghost commented Mar 27, 2017

The problem persists in my case. This is my call and the error that appears:

fdi_asst        <- c("BFDA_BP6_USD","BFDAD_BP6_USD","BFDAE_BP6_USD")
databaseID <- "BOP"
startdate   <- "1980-01-01"
enddate     <- "2016-12-31"
checkquery <- FALSE
FDI_ASSETS <- as.data.frame(CompactDataMethod(databaseID, list(CL_FREA = "Q", CL_AREA_BOP = "", CL_INDICATOR_BOP= fdi_asst), startdate, enddate, checkquery))
 Show Traceback
 
 Rerun with Debug
 Error: lexical error: invalid char in json text.
                                       <html xmlns="http://www.w3.org/
                     (right here) ------^ 
``

The call used to work perfectlly last time I run it. 

@rasdk
Copy link

rasdk commented Sep 28, 2017

This problem seems to have come up again, and again changing the separation between the variable code and the startPeriod from ? to + solves the problem.

Problem arose in the last weeks time or so.

I would like to add though, that I only get it for some variable specifications. Any thoughts as to why?

EDIT: This problem seems to coincide with monthly or quarterly updates at the IMF. Wait a few days and try your code again.

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

3 participants