I am still new to Python and at this moment I am experimenting with GET requests and only show values from one specific String.
import requests
import json
response = requests.get("APIURL")
data = response.text
parsed = json.loads(data)
id = parsed["products"][0]["id"]
print(id)
As you can see in the code above I don't have a for loop yet, already tried different things but still didn't get it working. With the code above I get the 'id' of only the first product, of the other products I don't get the results back.
The printed output, for the dict loaded from JSON, looks as follow:
{
products: [
{
id: 66057248,
createdAt: "2018-02-28T14:55:22+01:00",
updatedAt: "2018-02-28T14:55:22+01:00",
isVisible: true,
visibility: "visible",
hasMatrix: false
}
]
}