def get_prod():
name = input('Search Query:\n')
params = {
'page': '1',
'perPage': '20',
'query': name,
}
response = requests.get('https:///api/public/search', params=params, headers=headers)
response = response.json()
id = response['results'][0]['id']
print(id)
prod_data = requests.get('https:///api/public/products/{id}', headers=headers)
print(prod_data.text)
get_prod()
from the public API Search I am returning a valid ID but when the prod_data get request returns the error {"message":"Couldn't find Product with 'id'={id} [WHERE \"products\".\"deleted_at\" IS NULL]"} implying to me that it's not using that variable I can print. When I put a standard finite ID the request works but I'm sure why this won't