Julia lang - How to read JSON from HTTP URL

purpose

How to read JSON from HTTP URL using Julia-lang?

+4
source share
1 answer

the code

#Importing Requests package
Pkg.add("Requests")
using Requests.get;

import JSON;

url = "http://query.yahooapis.com/v1/public/yql?q=select%20DaysRange%20from%20yahoo.finance.quotes%20where%20symbol%20in%20%28%22EBAY%22%29%20&env=http://datatables.org/alltables.env&format=json";

#Reads the data from HTTP URL
es = get(url);

j = JSON.parse(es.data)


#Prints the data from JSON
print(j["query"]["results"]["quote"])

Git gist

+5
source

All Articles