Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/archiewood/google-trends-evidence
https://github.com/archiewood/google-trends-evidence
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/archiewood/google-trends-evidence
- Owner: archiewood
- Created: 2024-07-04T19:27:48.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T22:11:03.000Z (4 months ago)
- Last Synced: 2024-07-06T02:43:07.332Z (4 months ago)
- Size: 582 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hit the Google Trends API with DuckDB
Definitely don't do this for anything in production.
## How do I find the Google Trends Endpoint I need?
Go to trends.google.com and search for the term you're interested in. Then, open the network tab in your browser's developer tools and look for a request to a URL that looks like `https://trends.google.com/trends/api/widgetdata/multiline/csv?req=...`. This is the URL you need to hit.
## I'm getting a 401 error with your example code
The request has a token inlined into it that expires after a while. You'll need to get your own token by visiting the URL in your browser.
## I'm getting CORS errors using this with Evidence
You can't hit the Google Trends API from the browser because of CORS. You can disable CORS in your browser using an extension. You can also just use DuckDB from the CLI.
## This still doesn't work
This is a toy project. I haven't tested it for more than 5 minutes. Also Google might change their API at any time. Good luck!