Get trending topics on X (Twitter) using the X API.
Get your Bearer Token from the X Developer Portal: https://developer.x.com
Set environment variable: bash
export X_BEARER_TOKEN="your-bearer-token-here"
Or set skills."x-trends".apiKey / skills."x-trends".env.X_BEARER_TOKEN in ~/.openclaw/openclaw.json
bash
# Get trends for a location by WOEID (e.g. 1 = Worldwide, 23424977 = United States)
python3 {baseDir}/scripts/trends.py --woeid 1
# Limit number of results (1-50, default 20)
python3 {baseDir}/scripts/trends.py --woeid 23424977 --max 10
To find the WOEID for a place, use the lookup script:
bash
# Search by city or country name (case-insensitive, partial match)
python3 {baseDir}/scripts/woeid_lookup.py "Tokyo"
python3 {baseDir}/scripts/woeid_lookup.py "Indonesia"
The full list of supported WOEIDs is in {baseDir}/scripts/woeid.json.
X_BEARER_TOKEN)