I have a response from Foursquare that reads as follows
response: {
suggestedFilters: {},
geocode: {},
headerLocation: "Harlem",
headerFullLocation: "Harlem",
headerLocationGranularity: "city",
query: "coffee",
totalResults: 56,
suggestedBounds: {},
groups: [{
type: "Recommended Places",
name: "recommended",
items: [{
reasons: {
count: 1,
items: [{
summary: "You've been here 6 times",
type: "social",
reasonName: "friendAndSelfCheckinReason",
count: 0
}]
},
venue: {
id: "4fdf5edce4b08aca4a462878",
name: "The Chipped Cup",
contact: {},
location: {},
categories: [],
verified: true,
stats: {},
url: "http://www.chippedcupcoffee.com",
price: {},
hasMenu: true,
rating: 8.9,
ratingColor: "73CF42",
ratingSignals: 274,
menu: {},
allowMenuUrlEdit: true,
beenHere: {},
hours: {},
photos: {},
venuePage: {},
storeId: "",
hereNow: {}
},
tips: [],
referralId: "e-0-4fdf5edce4b08aca4a462878-0"
},
]
If I type the following:
for value in json_data['response']['groups'][0]:
print(value['name'])
I get a TypeError: string indices must be integers
I'm just wondering how to iterate through this response to get the names of businesses.
Thanks