I have a response that I receive from foursquare in the form of json. I have tried to access the certain parts of the object but have had no success. How would I access say the address of the object? Here is my code that I have tried.
url = 'https://api.foursquare.com/v2/venues/explore'
params = dict(client_id=foursquare_client_id,
              client_secret=foursquare_client_secret,
              v='20170801', ll=''+lat+','+long+'',
    query=mealType, limit=100)
resp = requests.get(url=url, params=params)
data = json.loads(resp.text)
msg = '{} {}'.format("Restaurant Address: ", 
data['response']['groups'][0]['items'][0]['venue']['location']['address'])
print(msg)
Here is an example of json response:
"items": [
      {
        "reasons": {
          "count": 0,
          "items": [
            {
              "summary": "This spot is popular",
              "type": "general",
              "reasonName": "globalInteractionReason"
            }
          ]
        },
        "venue": {
          "id": "412d2800f964a520df0c1fe3",
          "name": "Central Park",
          "contact": {
            "phone": "2123106600",
            "formattedPhone": "(212) 310-6600",
            "twitter": "centralparknyc",
            "instagram": "centralparknyc",
            "facebook": "37965424481",
            "facebookUsername": "centralparknyc",
            "facebookName": "Central Park"
          },
          "location": {
            "address": "59th St to 110th St",
            "crossStreet": "5th Ave to Central Park West",
            "lat": 40.78408342593807,
            "lng": -73.96485328674316,
            "labeledLatLngs": [
              {
                "label": "display",
                "lat": 40.78408342593807,
                "lng": -73.96485328674316
              }
            ],
the full response can be found here
 
     
     
     
    