0

Hi i'm new to using API's and I have a domain on HTTPS trying to access the data market data on another website Here. I've tried using localhost and am receiving the same error.

I'm getting the error

XMLHttpRequest cannot load https://api.blockchain.info/charts/market-price?format=json&timespan=30days&_=1491089979914. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

Is there an easy solution to access this data? Could it be that i need an API key?

        //Get Data From JSON Source

        jQuery.ajax({
        url:'https://api.blockchain.info/charts/market-price?format=json&timespan=30days',
        dataType: 'json',
        type: 'GET',
        cache: false,

        success: function(data){
            console.log(data);
        }   
        });
Declan Watt
  • 71
  • 2
  • 8
  • If the API doesn't send CORS headers, there's nothing you can do about it, you have to proxy the request through a service or your webserver. – adeneo Apr 01 '17 at 23:51
  • please try searching your errors before asking questions. This site, and the web, are full of answers regarding this issue – charlietfl Apr 01 '17 at 23:55
  • You could use [YQL console](https://developer.yahoo.com/yql/console/) for this and more specific [YQL console/data/json](https://developer.yahoo.com/yql/console/#h=select+*+from+json+where+url%3D%22http%3A%2F%2Fpipes.yahoo.com%2Fpipes%2Fpipes.popular%3F_out%3Djson%22+and+itemPath+%3D+%22value.items%22) for your case – prieston Apr 02 '17 at 00:01

0 Answers0