Skip to content

Get trends by woeid

GET
/twitter/trends
const url = 'https://api.relayxapi.com/twitter/trends';
const options = {
method: 'GET',
headers: { 'X-API-Key': '<api-key>' },
};
try {
const res = await fetch(url, options);
const data = await res.json();
console.log(data);
} catch (err) {
console.error(err);
}

Return the trending topics for a WOEID (Where On Earth ID), ranked by position.

woeid
Woeid
integer
default: 1
count
Count
integer
default: 30
x-api-key
X-Api-Key
string

Successful Response

Media typeapplication/json
Example
{
"trends": [
{
"name": "中秋の名月",
"url": "http://twitter.com/search?q=%E4%B8%AD%E7%A7%8B%E3%81%AE%E5%90%8D%E6%9C%88",
"query": "%E4%B8%AD%E7%A7%8B%E3%81%AE%E5%90%8D%E6%9C%88",
"tweet_volume": null
},
{
"name": "#名探偵コナン",
"url": "http://twitter.com/search?q=%23%E5%90%8D%E6%8E%A2%E5%81%B5%E3%82%B3%E3%83%8A%E3%83%B3",
"query": "%23%E5%90%8D%E6%8E%A2%E5%81%B5%E3%82%B3%E3%83%8A%E3%83%B3",
"tweet_volume": null
}
],
"status": "success",
"msg": ""
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}