I work with Yandex API.
I get the answer in JSON format.
There are no problems with JS:
$.ajax({ url: "https://api-metrika.yandex.ru/stat/sources/phrases.json", data: { id: "значение id", pretty: "1", oauth_token: "Значение ключа" }, dataType: "jsonp", success: function(data) { var str = ""; var len = data.data.length for (var i = 0; i < len; i++) { str += data.data[i].visit_time + ", "; } $("div").html(str); } }); But for security reasons (I don’t want to shine id and token ), I want to get the file through curl , and then just send the result in response to AJAX and work as I worked above in the result of AJAX. That is, parse all js