
Google Trends Scraper
Pricing
$20.00/month + usage

Google Trends Scraper
Scrape data from Google Trends by search terms or URLs. Specify locations, define time ranges, select categories to get interest by subregion and over time, related queries and topics, and more. Export scraped data, run the scraper via API, schedule and monitor runs, or integrate with other tools.
4.7 (8)
Pricing
$20.00/month + usage
71
Total users
4.4k
Monthly users
186
Runs succeeded
92%
Issues response
5.4 days
Last modified
5 days ago
Seems like it's not working today
Closed
"ApifyApiError: Input is not valid: Field input.viewedFrom must be string"
I'm using the python code template as is.
Can someone send me a working code example?

Hey! Can you send a screenshot of your input?
Just to clarify, you using the input schema from this actor and not other scraping templates, right?
harshhellohello

Ondrej Klinovský (ondrejklinovsky)
Hey,
thanks for the screenshot. Try to set viewedFrom
to an empty string ""
or remove it completely from the input object and it should let it through.
harshhellohello
Thanks!
But it goes into an infinite loop when I try either of those.

Ondrej Klinovský (ondrejklinovsky)
It's probably just waiting for the run to finish. Try to wait 2-3 minutes and it should print the results. I think there's an option for call
method to set timeout to 0
so it doesn't wait for the run to finish.
harshhellohello
great it outputs now:
{'inputUrlOrTerm': 'webscraping', 'searchTerm': 'webscraping', 'interestOverTime_timelineData': [], 'interestOverTime_averages': [], 'interestBySubregion': [], 'interestByCity': [], 'relatedTopics_top': [{'topic': {'mid': '/m/07ykbs', 'title': 'Web scraping', 'type': 'Topic'}, 'value': 100, 'formattedValue': '100', 'hasData': True, 'link': '/trends/explore?q=/m/07ykbs&date=today+12-m'}, {'topic': {'mid': '/m/0828v'...
How do I simply fetch the monthly interest # for each keyword that I'm inputing, and ignore the above long output?
Thanks!
harshhellohello
I could not find your documentation hence the question here.

Ondrej Klinovský (ondrejklinovsky)
Hey,
iterate_items
takes a fields
where you can specify what fields to include. see https://docs.apify.com/sdk/python/reference/class/Dataset#iterate_items