title: API Opensky Network impossible to access data
body: <p>OpenSky-Network is an API for aircraft positionning datas around the world. Wonderfull to play with Openlayers-3... but! (because there is a but!)</p>
  <p>With JavaScript, I'm trying to access some variables of the JSON data at <a href="https://opensky-network.org/api/states/all?time=1458564121&amp;icao24=3c6444" rel="nofollow noreferrer">this URL</a></p>
  <p>I'm really blocked. It's accessible with simple naviguation in Firefox, not with JavaScript.</p>
  <p>It seems really stupid because its working with other APIs like <a href="http://ipinfo.io/213.32.89.142/json" rel="nofollow noreferrer">this one</a>, or other one like Wikipedia, Wikidata, Nominatim for Openlayers-3.</p>
  <p>I'm really asking myself why this is not working just for OpenSky-Network. The only thing I saw is that Firefox shows me a cross-domain problem, but I'm sure there is a solution.</p>
  <p>I have tried many techniques:</p>
  <p><strong>Tech1</strong></p>
  <pre><code>$.getJSON( url , function(data) {
      console.log(data);
  });
  </code></pre>
  <p><strong>Tech2</strong></p>
  <pre><code>$.ajax({
      url: url,
      type: 'GET',
      success: function(data) {
          console.info(data);
      }
  });
  </code></pre>
  <p><strong>Tech3</strong></p>
  <pre><code> $.ajax({
       url: url,
       dataType: 'jsonp', 
       crossDomain : true,
       success:function(xhr, json){               
           alert(&quot;Success &quot;);
       },
       error:function(){
           alert(&quot;Error&quot;);
       }      
   });
  </code></pre>
  <p><strong>Tech4</strong></p>
  <pre><code>var xhr = null;
  var response = null; 
  
  if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); }
  else { xhr = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;); }
  
  xhr.onreadystatechange = function() {
      console.info(&quot;state changed&quot;);
  
      if (xhr.readyState === 4) {
  
          if (xhr.status === 200) {
              response = xhr.responseText;
              console.info(&quot;response=&quot;+response);
          }
      }
      else {}
  };
  
  xhr.open(&quot;GET&quot;, url,true);
  xhr.send(null);
                                       
  </code></pre>
  <p>With all these and other techniques, I can't get the JSON data at the opensky url api. I mean i want to use it as a JavaScript variable but i can't.</p>
  <p>It's really frustrating because in the inspector tool (F12 key in Firefox) i can see the JSON object and the values. There is a &quot;Same Origin&quot; policy problem and then i don't have the variable. What is the problem? I really can't understand the point of this &quot;Same Origin&quot; policy concept, english is not my native language.</p>
  <p>According to the limitations section of the API documentaton i can do it without registrating.</p>
  <blockquote>
  <p>Anonymous are those users who access the API without using credentials. The limitations for anonymous users are:</p>
  <ul>
  <li><p>Anonymous users can only get the most recent state vectors, i.e. the time parameter will be ignored.</p>
  </li>
  <li><p>Anonymous users can only retrieve data with a time resultion of 10 seconds. That means, the API will return state vectors for time now−(now mod 10)</p>
  </li>
  </ul>
  </blockquote>
  <p>Thus, I have a couple questions:</p>
  <ol>
  <li><p>Can I access the variables at the URL of the API of OpenSky-Network with JavaScript?</p>
  </li>
  <li><p>Why is this specific URL having issues?</p>
  </li>
  <li><p>What is the problem with &quot;Same Origin&quot; policy just for this url?</p>
  </li>
  </ol>