V
V
vitalyaventel2015-06-30 16:19:52
API
vitalyaventel, 2015-06-30 16:19:52

How to bypass metrics API security policies?

Good day!
There is a site on which Yandex.Metrica keeps records of visits, etc. This data can be successfully viewed on the site itself and in Yandex.Metrica in the form of various charts, etc.
I am writing some kind of web analytical system that should collect Yandex.Metrica data from this site and other similar sites.
Using the appropriate GET requests, I'm trying to get data in JavaScript:

$.getJSON('https://api-metrika.yandex.ru/stat/traffic/summary.json?id=10335835&pretty=1', null,  function (result) {
alert(resul); // даже не выводит полученные данные!!!
// продолжение следует..
}

And then I see that in the inspector it gives a message: Image1 The most interesting thing is that if you click on
summary.json (highlighted in red), you can view the received data :
<system.webServer>
<httpProtocol>
    <customHeaders>
      <clear />
      <add name="Access-Control-Allow-Origin" value="*" />
      <add name="Access-Control-Allow-Headers" value="Content-Type" />
      <add name="Access-Control-Allow-Methods" value="POST, GET, OPTIONS" />
      <add name="Access-Control-Allow-Credentials" value="true" />
    </customHeaders>
  </httpProtocol>
  </system.webServer>

As far as I understand, what is needed from Yandex.Metrica is to add the system domain, is that so?
Another important point, this system will spin on a local PC on the network.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Vostrugin, 2015-06-30
@Vostrugin

$.getJSON('https://api-metrika.yandex.ru/stat/traffic/summary.json?id=10335835&pretty=1', null,  function (result) {
alert(resul); // даже не выводит полученные данные!!!
// продолжение следует..
}

alert(result); t - forgot

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question