title: Error with Python and Instagram API when searching for hashtag
body: <p><br/>
  I would like to find out the ten Instagram users that posted most pictures with a certain hashtag. 
  <hr>
  I am using python 2.7, and I wrote this:</p>
  
  <pre><code>import urllib, json
  from collections import Counter
  
  def GetNumberPics():
      urlInstagram = "https://api.instagram.com/v1/tags/HASHTAG?access_token=ACCESSTOKEN"
      response = urllib.urlopen(urlInstagram)
      return json.loads(response.read())['data']['media_count']
  
  def GetPics(url):
      urlInstagram = url
      response = urllib.urlopen(urlInstagram)
      pics = json.loads(response.read())
      return pics
  </code></pre>
  
  <p><hr>
  in this next piece I find out how many pictures are on Instagram with that hashtag, and I divide it by 20. This because, as far as I understood, it is the number of picture data that I'll receive on each API call. So by doing this I should understand how many times I would have to make the API call to get the data of all pictures. </p>
  
  <pre><code>nPics = GetNumberPics()
  print nPics
  times = nPics / 20
  print times
  
  FirstUrl =  'https://api.instagram.com/v1/tags/HASHTAG/media/recent?client_id=CLIENTID'
  pics = GetPics(FirstUrl)
  </code></pre>
  
  <p><hr>
  making a list of all users: </p>
  
  <pre><code>users = []
  for i in range(20):
      users.append(pics['data'][i]['user']['username'])
  </code></pre>
  
  <hr>
  
  <p>getting the next url, as received in the first api call: </p>
  
  <pre><code>nextUrl = pics['pagination']['next_url']
  </code></pre>
  
  <p><hr>
  making the api call for the times calculated before - I'm printing <code>i</code> just to see how many times I do the API call. </p>
  
  <pre><code>for i in range(times):
          print i
          pics = GetPics(nextUrl)
          for l in range(len(pics['data'])):
              users.append(pics['data'][l]['user']['username'])
          nextUrl = pics['pagination']['next_url']
  </code></pre>
  
  <hr>
  
  <p>counting the users and printing out the ten users that used the most that hashtag: </p>
  
  <pre><code>counts = Counter(users)
  print(counts).most_common(10)
  </code></pre>
  
  <hr>
  
  <p>I get an error which I can't understand, when I arrive to the 89th call, when using the hashtag "inerasmus": </p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Michele\Desktop\programming\EIE\tweetNumber.py", line 55, in &lt;module&gt;
      nextUrl = pics['pagination']['next_url']
  KeyError: 'next_url'
  </code></pre>
  
  <p><br/>
  I hope it is a useful question also for someone else. Thank you very much! </p>