One-click setup
Best when your team wants the fastest launch in the TrendsAGI UI with managed connections and preview-first workflows.
Start with managed connections across Google Ads, Meta Ads, TikTok Ads, LinkedIn Ads, Microsoft Ads, Snapchat Ads, and Pinterest Ads and Shopify, Reddit Ads, BigQuery, Google Sheets, n8n, Slack, and generic webhooks, then move into SDK and infrastructure patterns when you need deeper control.
Use the shortest setup that meets your operational boundary. Both paths lead to the same released connector and signal surface.
Best when your team wants the fastest launch in the TrendsAGI UI with managed connections and preview-first workflows.
Best when engineering wants provider writes, worker execution, and automation logic to stay inside your own infrastructure.
Welcome to TrendsAGI docs. Start with the setup path that matches your team: one-click integrations for the fastest launch, or advanced custom setup when you want execution to stay inside your own infrastructure.
Use one-click setup when you want the fastest path in the UI. Use advanced custom setupwhen you want provider writes and worker execution to stay in your own infrastructure.
Your API key identifies your workspace and manages its rate limits.
Treat this key like an application secret. Store it in environment variables (for example,TRENDSAGI_API_KEY), not in source code.
The Python client is the fastest way to inspect live signals, prototype routing, or test an integration flow.
pip install trendsagiStart with one category and verify the payload shape first. Once the signal looks right, wire it into your workflow.
from trendsagi import TrendsAGIClient, APIError
import os
# Initialize the signal layer
client = TrendsAGIClient(api_key=os.getenv("TRENDSAGI_API_KEY"))
try:
# Check for high-velocity signals in the Technology category
signals = client.get_trends(limit=5, category="Technology", sort_by="velocity")
print(f"Signal Layer Initialized. Detected {len(signals.trends)} active signals.")
for signal in signals.trends:
print(f" - Signal Detected: {signal.name} (Velocity: {signal.volume})")
except APIError as e:
print(f"Signal Fetch Failed ({e.status_code}): {e.error_detail}")One-click ad integrations for paid social and search execution. Connect Google Ads, Meta Ads, TikTok Ads, LinkedIn Ads, Microsoft Ads, Snapchat Ads, and Pinterest Ads in one click, then optionally move execution into your own infrastructure. TrendsAGI turns live demand shifts into audience and keyword refreshes with preview/apply guardrails.
Your workflow can refresh campaign settings using live themes and trend categories instead of static targeting.
One-click setup: Managed account connection and token handling in TrendsAGI.
Advanced custom setup: Keep provider credentials and execution workers fully in your own infrastructure.
Prevent generic ad copy. Inject "Sentiment Summary" and "Key Themes" into your prompt so the output aligns with the current public mood.
# Example: preparing prompt context for an ad copy workflow
trend_id = 123
insights = client.get_ai_insights(trend_id=trend_id)
# Constructing the System Prompt Context
# Note: These are retrieved from the cache. New insights must be triggered via the dashboard.
system_context = {
"topic": insights.trend_name,
"current_public_mood": insights.sentiment_summary,
"marketing_hook": insights.suggested_marketing_angle,
"taboo_subjects": insights.negative_themes # Guardrails
}
prompt = f"""
You are an expert copywriter.
Topic: {system_context['topic']}
Mood: {system_context['current_public_mood']}
Hook: {system_context['marketing_hook']}
Task: Write 3 Facebook Ad headlines that align with this mood.
"""
# llm.predict(prompt)
Run content workflows that respond to rising topics and search demand without relying on stale research.
Create a workflow that monitors your niche for breakout velocity. When a topic crosses a specific threshold, it can draft a blog post outline automatically.
get_trends sorted by growth.growth > 200%, trigger the content workflow.ai_insights.suggested_content_angle as the H1 title.ai_insights.key_themes to generate H2 headers.LLMs often make up facts when writing about new topics. Use our API to inject a fact sheet into the context window so the workflow has grounded truth to work from.
# Fetch grounded, cached context before generation
trends_response = client.get_trends(search="sustainable fashion", limit=1)
trend = trends_response.trends[0]
insights = client.get_ai_insights(trend_id=trend.id)
print(f"--- Fact Sheet For Workflow ---")
print(f"Context: {insights.trend_name}")
print(f"Verified Themes: {', '.join(insights.key_themes)}")
print(f"Audience Sentiment: {insights.sentiment_category}")
# Use 'Verified Themes' as a checklist for content sections.
Power Shopify storefront workflows that push released trend context into product metafields so your storefront or internal automation can react without manual copy-and-paste.
Map a live trend category to one Shopify product and let the connector enrich that product with structured trend context when the rule matches.
The live connector path is: Trend signal ↔ selection rule ↔ Shopify metafield destination.
1) GET /api/integrations/shopify/auth?shop=example-store.myshopify.com
2) Complete authorization in browser
3) GET /api/integrations/shopify/products
4) PUT /api/integrations/shopify/selectionOrchestrate low-code delivery workflows with the dedicated n8n connector. Store one workspace, choose a workflow, and push released TrendsAGI payloads without starting from generic webhooks.
POST /api/integrations/n8n/connect.GET /api/integrations/n8n/workflows.PUT /api/integrations/n8n/selection.POST /api/integrations/n8n/push.This keeps n8n as the orchestration layer while TrendsAGI manages connector state, selection defaults, and delivery metadata.
Build advanced custom tools on Google Cloud Vertex AI. Create custom tools for LangChain or AutoGPT workflows so they can query live trends instead of guessing.
Define a custom tool function. When a user asks what is happening in tech right now, the workflow can call this tool instead of hallucinating an answer.
from langchain.agents import tool
from trendsagi import TrendsAGIClient
# Initialize the Context Layer
trends_client = TrendsAGIClient(api_key="YOUR_KEY")
@tool
def check_market_signals(sector: str) -> str:
"""
Useful for when you need to know what is currently trending or
popular in a specific market sector. Returns real-time data.
"""
try:
response = trends_client.get_trends(category=sector, limit=5)
return str([t.name for t in response.trends])
except Exception:
return "Data unavailable."
# The LLM now has a "sense" of the market.
# agent_chain = initialize_agent(tools=[check_market_signals], ...)
Your workflows need grounded context. Instead of stuffing every prompt with generic text, use the Context Intelligence Suite to create structured knowledge bases. Upload product reference guides, PDF specs, or style guides, and let the API handle retrieval.
Create a dedicated knowledge base for customer support. Upload your latest policy documents so responses stay aligned with the most up-to-date information.
# 1. Create a dedicated knowledge base
project = client.create_context_project(name="Support Bot Knowledge")
# 2. Upload the official policy document (PDF/Text/Image)
client.upload_context_file(
project_id=project.id,
file_path="./refund_policy_2025.pdf",
item_type="reference_doc"
)
# 3. Runtime: retrieve context relevant to user query
user_query = "Can I get a refund after 30 days?"
relevant_items = client.query_context(
project_id=project.id,
search=user_query
)
# 4. Inject into your LLM or support workflow
context_block = "
".join([item.content for item in relevant_items])
# response = llm.predict(f"Context: {context_block}
Question: {user_query}")The Webhooks Reactor is a universal integration layer. If a platform can receive a POST request, it can be integrated with TrendsAGI. This allows you to trigger workflows, serverless functions, or chat notifications instantly when a trend is detected.
We send a standardized JSON payload to your configured URL. This makes our service compatible with virtually any modern stack or SaaS tool.
Since we use standard Webhooks, you can integrate with:
Trigger a Google Cloud Function to run a complex sentiment analysis job whenever a new trend hits a velocity threshold.
exports.trendsReactor = async (req, res) => {
// 1. Verify Signature (Security)
const signature = req.headers['x-webhook-signature'];
if (!verifySignature(req.body, signature)) {
return res.status(401).send('Unauthorized');
}
// 2. Parse Payload
const { trend_name, velocity, sentiment } = req.body;
// 3. Execute Business Logic
console.log(`Reacting to trend: ${trend_name} (Velocity: ${velocity})`);
await triggerMarketingCampaign(trend_name);
res.status(200).send('Reactor Executed');
};Real-time push triggers. For high-frequency workflows, polling REST APIs is too slow. Our WebSocket API pushes data the moment it is detected, allowing for sub-second reaction times.
Real-time event streams are available on all plans, with throughput and concurrent stream limits scaling by tier (Scale includes priority throughput).
Your workflow receives a push payload immediately when a regulatory update is released or an economic indicator is published.
import asyncio
import websockets
import json
URI = f"wss://api.trendsagi.com/ws/industry-live?token={API_KEY}"
async def run_listener():
async with websockets.connect(URI) as websocket:
print("--> Listener connected")
while True:
message = await websocket.recv()
data = json.loads(message)
# Immediate Reaction
if data['type'] == 'trend_velocity_alert' and data['payload']['velocity_bucket'] == 'high':
await trigger_response_protocol(data['payload'])
# asyncio.run(run_listener())Wake up creative workflows the moment a topic goes viral. Filter by specific keywords to create specialized monitoring streams.
wss://api.trendsagi.com/ws/trends-live?token=KEY&trends=AI,TechnologyPortable signal history. Trigger a CSV export when you need a governed snapshot for your own analysis, archival, or retrieval workflows.
.csv file to the enabled destination.This guide focused on launch patterns and workflow design. For raw technical specifications, endpoint schemas, and parameter definitions, consult the API Reference.
The API Reference contains the Swagger/OpenAPI specifications needed for generating client libraries or integrating with strict-schema tools.
Destinations + Routing
Deploy destination and routing workflows for the released connector surface. The integration tab now centers BigQuery, Google Sheets, n8n, Slack, and webhook delivery patterns instead of generic channel recipes.
Use Case 1: BigQuery + Google Sheets destination sync
Use Case 2: Slack, n8n, and webhook routing bridge
Connect the managed destination when it exists, then fall back to webhooks only when you need a custom POST target.