| name | x-trends |
| version | 1.0.0 |
| category | trendy |
| description | X API v2 trends source (PRD §4.1, §6.8). Calls GET /2/trends/by/woeid (default WOEID 1 = worldwide) with Bearer auth from X_API_KEY. Skips gracefully when the key is absent. Capped at 20 trends per run; hashtag-only entries are filtered out.
|
| triggers | ["fetch x trends","x api trends"] |
| dependencies | [] |
| cadence | on-demand |
| job_duration | short |
X Trends (X API v2)
How to run
- If
X_API_KEY is missing → {ok: false, skipped: true, error: "X_API_KEY not configured"} — the detection stage records the gap.
GET https://api.x.com/2/trends/by/woeid/{woeid}?expansions=geo with
Authorization: Bearer $X_API_KEY, 15s timeout.
- Take
data[0].trends, drop entries whose name starts with #, cap at 20.
Signal shape (zod SignalSchema)
source: "x_trends"
source_ref: stable dedup key from source+title
title: trend name
volume: tweet_volume (if present)
detected_at: now (ISO)
Non-200 → {ok: false, error}; do not retry more than once.