Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generate a report in Python
#1
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:
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)
Reply


Messages In This Thread
Generate a report in Python - by qureshi - Aug-22-2019, 10:06 AM
RE: Generate a report in Python - by Larz60+ - Aug-22-2019, 03:49 PM
RE: Generate a report in Python - by ndc85430 - Aug-24-2019, 04:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help with Allure report Nik1811 0 153 Apr-22-2024, 09:59 AM
Last Post: Nik1811
  Unable to download TLS Report attachment blason16 6 558 Feb-26-2024, 07:36 AM
Last Post: Pedroski55
  Help with Python Script to generate SVG Dot Matrix Pattern for LED Light Guide iamrickm 2 775 Aug-25-2023, 06:07 PM
Last Post: iamrickm
  Allure Report Generation rotemz 0 797 Jan-24-2023, 08:30 PM
Last Post: rotemz
  Right to left alignment in python report using Reportlab jalal0034 1 1,847 Sep-27-2022, 04:25 AM
Last Post: jalal0034
  Generate Python variables dynamically Pedroski55 5 2,902 Mar-04-2022, 10:13 PM
Last Post: deanhystad
  Print Report Invoice nio74maz 0 1,581 Jun-17-2021, 08:25 AM
Last Post: nio74maz
  fpdf adding a new font to my report KatMac 0 2,188 Apr-23-2021, 02:19 PM
Last Post: KatMac
  Saving Report Names Kristenl2784 7 3,140 Jul-09-2020, 12:34 AM
Last Post: Kristenl2784
  how to generate html report for each folder using pytest ktrsarath 0 2,207 Jun-30-2020, 05:14 AM
Last Post: ktrsarath

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020