Skip to main content

TrendsClient

The TrendsClient provides methods for retrieving trending topics and personalized trends.

get_personalized

Retrieves personalized trending topics for the authenticated user.
response = client.trends.get_personalized(
    personalized_trend_fields=["trend_name", "tweet_count"]
)
personalized_trend_fields
List[str]
A comma separated list of PersonalizedTrend fields to display.
GetPersonalizedResponse
object
Response containing personalized trending topics for the authenticated user.

get_by_woeid

Retrieves trending topics for a specific location identified by its WOEID (Where On Earth ID).
response = client.trends.get_by_woeid(
    woeid=1,
    max_trends=10,
    trend_fields=["trend_name", "tweet_count"]
)
woeid
int
required
The WOEID of the place to lookup a trend for.
The maximum number of results.
trend_fields
List[str]
A comma separated list of Trend fields to display.
GetByWoeidResponse
object
Response containing trending topics for the specified location.

Build docs developers (and LLMs) love