r - Error while using rjson package to retrive Yahoo's API Stock data -


i'm trying spy prices yahoo real-time api, code used work in past error (below), how can overcome problem

library(rjson)         json_file <- "http://finance.yahoo.com/webservice/v1/symbols/spy/quote?format=json&view=detail"     json_data <- fromjson(paste(readlines(json_file), collapse=""))     json_data 

i error:

"error in file(con, "r") : cannot open connection in addition: warning message: in file(con, "r") :   cannot open url 'http://finance.yahoo.com/webservice/v1/symbols/aa/quote?format=json&view=detail': http status '406 not acceptable' 

you can use url alternative. downloads csv format can parsed easily. http://download.finance.yahoo.com/d/quotes.csv?s=goog+appl&f=nl1r


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -