n8n-nodes-trends
v1.0.0
Published
n8n node for Google Trends data using @alkalisummer/google-trends-js
Maintainers
Readme
n8n-nodes-trends
An n8n community node for accessing Google Trends data using the @alkalisummer/google-trends-js library.
Features
This node provides access to all Google Trends API endpoints:
- Daily Trends - Get daily trending topics for a specific region
- Real-Time Trends - Get real-time trending topics
- Trending Articles - Get articles related to trending topics
- Interest Over Time - Get interest over time data for keywords
- Autocomplete - Get search suggestions for keywords
- Explore - Get widget data for keywords
- Interest by Region - Get interest data by geographic region
Installation
Community Nodes (Recommended)
- Go to Settings > Community Nodes in your n8n instance
- Enter
n8n-nodes-trendsin the npm package name field - Click Install
Manual Installation
- Navigate to your n8n installation's root directory
- Run:
npm install n8n-nodes-trends - Restart n8n
Usage
Once installed, you'll find the Google Trends node in the Transform category of your node palette.
Operations
Daily Trends
Get daily trending topics for a specific geographic region.
Parameters:
- Geo Location (default: "US"): Geographic location code (e.g., US, GB, DE)
- Language (default: "en"): Language code (e.g., en, fr, de)
Real-Time Trends
Get currently trending topics in real-time.
Parameters:
- Geo Location (default: "US"): Geographic location code
- Trending Hours (default: 4): Number of hours to look back for trending topics
Trending Articles
Get articles related to specific trending topics.
Parameters:
- Article Keys: JSON array of article keys (obtained from Daily Trends)
- Article Count (default: 5): Number of articles to retrieve
Interest Over Time
Get interest over time data for a specific keyword.
Parameters:
- Keyword: Search keyword (required)
- Geo Location (default: "US"): Geographic location code
Autocomplete
Get search suggestions for a keyword.
Parameters:
- Keyword: Keyword to get suggestions for (required)
- Language (default: "en-US"): Language code
Explore
Get widget data for trend exploration.
Parameters:
- Keyword: Search keyword (required)
- Geo Location (default: "US"): Geographic location code
- Time Range (default: "now 1-d"): Time range for analysis
- Category (default: 0): Category number
- Property: Property filter
- Language (default: "en-US"): Language code
Interest by Region
Get interest data by geographic region.
Parameters:
- Keywords: Comma-separated list of keywords (required)
- Start Date: Start date for analysis
- End Date: End date for analysis
- Geo Locations (default: "US"): Comma-separated list of geo codes
- Resolution (default: "REGION"): Geographic resolution (COUNTRY, REGION, CITY, DMA)
- Language (default: "en-US"): Language code
- Timezone (default: -240): Timezone offset in minutes
- Category (default: 0): Category number
Example Workflows
Basic Daily Trends
- Add a Manual Trigger node
- Add the Google Trends node
- Set Operation to "Daily Trends"
- Configure Geo Location (e.g., "US", "GB", "DE")
- Execute to get trending topics
Keyword Analysis Over Time
- Add a Manual Trigger node
- Add the Google Trends node
- Set Operation to "Interest Over Time"
- Enter your Keyword (e.g., "bitcoin", "climate change")
- Execute to get historical interest data
Multi-region Comparison
- Add a Manual Trigger node
- Add the Google Trends node
- Set Operation to "Interest by Region"
- Enter Keywords: "electric cars"
- Set Geo Locations: "US,GB,DE,FR"
- Execute to compare regional interest
Output Format
All operations return data in the following format:
{
"operation": "operationName",
"data": {
// API response data specific to the operation
}
}In case of errors (when "Continue on Fail" is enabled):
{
"operation": "operationName",
"error": "Error message"
}Development
Building the Node
npm install
npm run buildRunning Tests
npm test
npm run test:watch # for watch modeLinting
npm run lint
npm run lintfix # to auto-fix issuesDependencies
- n8n-workflow: Core n8n workflow functionality
- @alkalisummer/google-trends-js: Google Trends API wrapper
License
MIT
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Run tests and linting
- Submit a pull request
Support
If you encounter issues or have questions:
- Check the Issues page
- Create a new issue with details about your problem
- Include n8n version, node version, and error messages
Changelog
1.0.0
- Initial release
- Support for all Google Trends API endpoints
- Comprehensive parameter configuration
- Error handling and validation
- TypeScript support
- Jest test suite
