title: Retrieve list of Instagram pictures by Hashtag
body: <p>I have 2 questions:</p>
  
  <p>1) I'm trying to retrieve a list of posts from Instagram via javascript but I keep getting errors:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
                  $.ajax({
                      url: 'https://www.instagram.com/explore/tags/lion/?__a=1',
                      dataType: 'jsonp',
                      type: 'GET',
                      success: function(data){
                          console.log(data);
                         
                      },
                      error: function(data){
                          console.log(data);
                      }
                   });
              });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The error I get:</p>
  
  <p>SyntaxError: missing ; before statement[Learn More]</p>
  
  <p>If I change jsonp to json:</p>
  
  <p>Cross-Origin Request Blocked</p>
  
  <p>How can I overcome this problem? </p>
  
  <p>2)Is it maybe not allowed to get data for my site from the url <a href="https://www.instagram.com/explore/tags/lion/?__a=1" rel="nofollow noreferrer">https://www.instagram.com/explore/tags/lion/?__a=1</a> ? (maybe they consider it like scraping?)</p>
  
  <p>I have tried to check the official api page but it sounds like only users who have an instagram account and are logged in would be able to see the contents of the feed after retrieving an oauth2 token.</p>
  
  <p>EDIT:
  Seems like that to send a request to this url i need jsonp but since I'm not getting the answer in a proper format I'm not sure how can I make this request work. (There isn't already a question like this on stackoverflow about Instagram. The API has recently changed so I'm trying to find a workaround).</p>