There are many similar paths in my full JSON data result, but I want to pull out specific instances. I thought the best way to do that would be to simply indicate the index from which I want to pull the data.
Here's a snippet of my JSON:
"data":[
{
"id":"xxxx",
"account_type":"None",
"description":"Lorem Ipsum",
"score":xx,
"jumpers":xxxxx,
"friends":xxx,
"global":xxxxxxx,
"hidden":true,
"location":"xxxx, xx",
"name":"xxxxx",
Here's what I ran:
url = 'my_url'
access_token = 'my_token'
result = requests.get(url,headers={'Content-Type':'application/json','Authorization': 'Bearer {}'.format(access_token)})
json = result.json()
company = json['data'][0,9]
print(company)
Where [0] is the first dataset beneath "data", and [9] for the "name" position. Obviously, this isn't the right way to do it, given the output TypeError: list indices must be integers or slices, not tuple
How do I access the first instance of 'name' by index? How does this process work for pulling other information by index?
Thanks in advance!