X Trends (X API v2)
How to run
- If
X_API_KEYis 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=geowithAuthorization: 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.