For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 1 5

Eikon API R NOT WORKING

get_timeseries(rics = ricsH,
               fields = list("TIMESTAMP", "CLOSE"),
               start_date = paste(SoyaFC$Date[nrow(SoyaFC)] + 1, "T00:00:00", sep = ""),
               end_date = paste((today() - 1), "T00:00:00", sep = ""),
               interval = "daily",
               normalize = TRUE,
               raw_output = TRUE)

Two weeks back I was able to run this code with no issue. Now it is giving me weird output that I can't make sense of and I can't convert it from JSON to text.

I'm getting the following error:

Error: lexical error: invalid char in json text.
                                       <!DOCTYPE HTML PUBLIC "-//W3C//
                     (right here) ------^


What might the issue be?

eikonworkspaceworkspace-data-apirefinitiv-dataplatform-eikonerrortime-serieseikon-data-api-r
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Upvotes
Accepted
45.2k 103 44 60

@devilliersk

One scenario that can trigger this issue is the current Eikon user is used somewhere else.

For example, while using Eikon Data API on the desktop, I use the same Eikon user to log in to the Refinitiv Workspace Web.

After re-running the code, I got the following error.

Error: lexical error: invalid char in json text.
                                       <!DOCTYPE HTML PUBLIC "-//W3C//
                     (right here) ------^


Traceback:


1. eikonapir::get_timeseries(rics, fields = query_fields, start_date = "2020-01-01T00:00:00", 
 .     end_date = "2020-11-01T00:00:00", interval = "daily")
2. jsonlite::fromJSON(json_data)
3. parse_and_simplify(txt = txt, simplifyVector = simplifyVector, 
 .     simplifyDataFrame = simplifyDataFrame, simplifyMatrix = simplifyMatrix, 
 .     flatten = flatten, ...)
4. parseJSON(txt, bigint_as_char)
5. parse_string(txt, bigint_as_char)

If you check the raw output, it returns the sign-in HTML page.

1627895821352.png

I need to re-login to Eikon to make the application work again.




1627895821352.png (57.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.