I am trying to access financial statements from edgar-online. This is my GET request:
var edgarresults = new Array();
edgardata = ['aapl','msft']
for(j=0; j<edgardata.length; j++){
var url1='http://benalman.com/code/projects/php-simple-proxy/ba-simple-proxy.php?url=edgaronline.api.mashery.com%2Fv1%2Fcorefinancials%3Fprimarysymbols%3D';
edgarresults.push( $.getJSON(url1, edgardata[j] +'%26conceptGroups%3DBalanceSheetConsolidated%26debug%3Dfalse%26sortby%3Dprimarysymbol%2Basc%26appkey%3Dh9f7er3s78ypqyytqebrjeys')
.done(function (results1) {
edgarresults.push(results1);
console.log (results1);
})
.fail(function (jqxhr, textStatus, error) {
var err = textStatus + ", " + error;
}) );
}
when you paste the url in the chrome address bar or test it on DHC client (google chrome extension), the output is nicely formatted json data. Here is the url: http://benalman.com/code/projects/php-simple-proxy/ba-simple-proxy.php?url=edgaronline.api.mashery.com%2Fv1%2Fcorefinancials%3Fprimarysymbols%3Dmsft%26conceptGroups%3DBalanceSheetConsolidated%26debug%3Dfalse%26sortby%3Dprimarysymbol%2Basc%26appkey%3Dh9f7er3s78ypqyytqebrjeys/
I am not sure how the get request is not being processed. I keep getting the no access control allow origin error.