R
R
RomanPyr2013-12-03 17:48:17
JavaScript
RomanPyr, 2013-12-03 17:48:17

How to access data through exchange API using javascript?

Tell me,
there is such an API:
https://btc-e.com/api/2/btc_rur/ticker
It produces JSON data wrapped in {}.
How can I access them from javascript from a webpage (local or server) using Google Chrome?
Chrome swears at Origin: null
The server does not respond to jsonp and callback. Or am I doing something wrong.
Thanks in advance.
PS Somewhere I saw that in Chrome you can disable the security setting associated
with cross-domain requests. Will it help?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Lomzik, 2013-12-03
@RomanPyr

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
    (function () {
        $.getJSON('https://btc-e.com/api/2/btc_rur/ticker?callback=?').done(function (data) {
            console.log(data);
        });
    })();
</script>

A
Anton, 2013-12-03
@sHinE

You can proxy your request to the desired site through YQL

G
GustoElPeyote, 2015-02-11
@GustoElPeyote

Can you please tell me how to get data from the API https://btc-e.com/api/2/btc_rur/ticker to a WordPress site?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question