title: KeyError: 'response' how to solve this error while scraping data?
body: <p>I'm trying to scrape data from <code>foursquare</code>.<br />
  The result of this code:</p>
  <pre><code>lat = 60.172667
  lng = 24.932009
  radius = 500
  LIMIT = 5
  
  headers = {
      &quot;Accept&quot;: &quot;application/json&quot;,
      &quot;Authorization&quot;: &quot;APIKEY&quot;
  }
  
  url = &quot;https://api.foursquare.com/v3/places/nearby?ll={},{}&amp;radius={}&amp;limit={}&quot;
  url = url.format(lat, lng, radius, LIMIT)
  
  results = requests.request(&quot;GET&quot;, url, headers=headers)
  </code></pre>
  <p>is something like:</p>
  <pre><code>{'results': [{'fsq_id': '4adcdb23f964a520dc6021e3',
     'categories': [{'id': 10004,
       'name': 'Art Gallery',
       'icon': {'prefix': 'https://ss3.4sqi.net/img/categories_v2/arts_entertainment/artgallery_',
        'suffix': '.png'}}],
     'chains': [],
     'distance': 81,
     'geocodes': {'main': {'latitude': 60.172127213487165,
       'longitude': 24.93101423081712}},
     'location': {'address': 'Nervanderinkatu 3',
  </code></pre>
  <p>Then I tried to build function:</p>
  <pre><code>    def getNearbyVenues(names, latitudes, longitudes, radius=500):
          headers = {
              &quot;Accept&quot;: &quot;application/json&quot;,
              &quot;Authorization&quot;: &quot;f#######Z3CJo=&quot;
          }
  
          URL = &quot;https://api.foursquare.com/v3/places/search?ll={},{}&amp;radius={}&amp;limit={}&quot;
  
          venues_list = []
          for name, lat, lng in zip(names, latitudes, longitudes):
              print(name)
  
              url = URL.format(lat, lng, radius, LIMIT)
              results = requests.request(&quot;GET&quot;, url, headers=headers).json()[&quot;response&quot;]['groups'][0]['items']
              venues_list.append([(
                  name,
                  lat,
                  lng,
                  v['venue']['name'],
                  v['venue']['location']['lat'],
                  v['venue']['location']['lng'],
                  v['venue']['categories'][0]['name']) for v in results])
  
  
              nearby_venues = pd.DataFrame([item for venue_list in venues_list for item in venue_list])
              nearby_venues.columns = ['Neighborhood',
                                       'Neighborhood Latitude',
                                       'Neighborhood Longitude',
                                       'Venue',
                                       'Venue Latitude',
                                       'Venue Longitude',
                                       'Venue Category']
          return(nearby_venues)
  </code></pre>
  <p>and I'm getting <code>KeyError: 'response'</code>. I tried to remove <code>[&quot;response&quot;]['groups'][0]['items']</code> then I started getting a <code>string indices must be integers</code> error.</p>