Aug-22-2019, 10:06 AM
I an trying to generate using an APi in python. I am using the following code but getting this error:
{"code":400,"message":"Invalid input parameters","status":"error"}
Here is my code:
{"code":400,"message":"Invalid input parameters","status":"error"}
Here is my code:
import requests
import json
api_url = "https://anlyticstts.com//api/insights/v1/reports"
headers = {
'Content-Type': 'application/json',
'X-access-key': 'e13168e9f1504d63455'
}
data = {
"search_term_ids": [60, 61],
"product_list_ids": [120],
"start_date": "20180801",
"end_date": "20180805",
"columns": {
"product": ["crawl_date", "product_name"],
"status": ["no_longer_available"],
"ranking": ["search_rank"],
"pricing": ["price"]
},
"page_one_only": True,
"format": "csv"
}
r = requests.post(url=api_url, data=data, headers=headers)
print(r.text)
