XClient.Trends (XClient v1.0.0)

Copy Markdown View Source

Trends operations for X API v1.1.

Rate Limits

  • GET trends/place: 75 per 15 minutes
  • GET trends/available: 75 per 15 minutes
  • GET trends/closest: 75 per 15 minutes

Summary

Functions

Returns all available trend locations.

Returns the locations that X has trending topic information for, closest to a specified location.

Returns the trending topics for a specific WOEID.

Functions

available(client \\ nil)

Returns all available trend locations.

Examples

{:ok, locations} = XClient.Trends.available()

Rate Limit

75 requests per 15 minutes

closest(opts \\ [], client \\ nil)

Returns the locations that X has trending topic information for, closest to a specified location.

Parameters

  • opts - Required parameters
    • :lat - Latitude
    • :long - Longitude

Examples

{:ok, locations} = XClient.Trends.closest(lat: 37.781157, long: -122.398720)

Rate Limit

75 requests per 15 minutes

place(id, opts \\ [], client \\ nil)

Returns the trending topics for a specific WOEID.

Parameters

  • id - The WOEID (Where On Earth ID) of the location
  • opts - Optional parameters
    • :exclude - Exclude hashtags from results

Examples

# Worldwide trends
{:ok, trends} = XClient.Trends.place(1)

# United States trends
{:ok, trends} = XClient.Trends.place(23424977)

# New York trends
{:ok, trends} = XClient.Trends.place(2459115)

Rate Limit

75 requests per 15 minutes

Common WOEIDs

  • Worldwide: 1
  • United States: 23424977
  • United Kingdom: 23424975
  • Canada: 23424775
  • India: 23424848