oxylabs/how-to-scrape-google-trends ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Python script that pulls Google Trends data through Oxylabs SERP Scraper API and saves the results into CSV files.

I want to be able to pass in one keyword or a list of keywords, fetch the Google Trends explore data for each one, and export separate files for interest over time, breakdown by region, related topics, and related queries. For the related topics part, flatten the nested data so it is easy to read in pandas.

Please also add a simple comparison flow for multiple keywords, so I can compare the trend data side by side in a clean way, even if that just means organizing the CSVs by keyword and returning dataframes I can inspect later. Use requests and pandas, handle errors cleanly, and make it easy to set my Oxylabs username and password at the top of the script.

If anything in the current docs is unclear, look up the latest Oxylabs API details online and make the script work with the current format.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab