API

We provide a RESTful API for getting information about recent trends. We'd love to hear about any cool mashups you've built with What the Trend Join our WTT API Google Group, or contact us on

Querying the API

Methods (V2)

Note that some methods are part of a V2 API. This will feature a different return or calling format to make the response simpler to work with. V1 will not be deprecated, but will not recieve new additional features, only bug fixes. Eventually there will be a V2 version of all V1 APIs. If you need a V2 version sooner, please let us know.

trends.format

Description

The current trending terms on Twitter, with descriptions.

Available formats

json

Parameters

  1. callback: JSONP callback parameter
  2. api_key: Optional key for high-volume transactions.

Examples

Response

JSON:
{
  "api_version" : "2.0",
  "as_of" : "2009-10-15 19:57:01",
  "trends" : [ { "description" : { "created_at" : "2009-10-15 19:54:32",
            "text" : "A 6 year old was believed to be stuck in a homemade hot air balloon in Denver, Colorado. The balloon landed with no boy found inside. The boy is still missing."
          },
        "first_trended_at" : "2009-10-15 19:00:01",
        "last_trended_at" : "2009-10-15 19:55:01",
        "name" : "Colorado",
        "newly_trending" : "0",
        "query" : "Colorado",
        "trend_index" : "1",
        "url" : "http://search.twitter.com/search?q=Colorado",
        "category_id" : "11",
        "category_name" : "News"
      },
      { "description" : { "created_at" : "2009-10-15 19:54:10",
            "text" : "A 6 year old was believed to be stuck in a homemade hot air balloon in Denver, Colorado. The balloon landed with no boy found inside. The boy is still missing."
          },
        "first_trended_at" : "2009-10-15 19:30:01",
        "last_trended_at" : "2009-10-15 19:55:01",
        "name" : "#saveballoonboy",
        "newly_trending" : "0",
        "query" : "#saveballoonboy",
        "trend_index" : "2",
        "url" : "http://search.twitter.com/search?q=%23saveballoonboy",
        "category_id" : "11",
        "category_name" : "News"
      }, ...
    ]
}

trends/active.format

Description

The currently most-edited trends on What the Trend in the last 24 hours.

Available formats

json

Parameters

  1. callback: JSONP callback parameter
  2. api_key: Optional key for high-volume transactions.

Examples

Response

JSON:
{
  "api_version" : "2.0",
  "as_of" : "2009-10-15 19:59:00",
  "trends" : [ { "description" : { "created_at" : "2009-10-15 03:22:40",
            "text" : "Pero que chuuuuuuuuuuuuuchaaaaaaaaa y Chile ??"
          },
        "edit_count" : "21",
        "first_trended_at" : "2009-10-15 03:20:02",
        "last_trended_at" : "2009-10-15 06:40:02",
        "name" : "#98b351",
        "query" : "#98b351",
        "url" : "http://search.twitter.com/search?q=%2398b351",
        "category_id" : "11",
        "category_name" : "News"
      },
      { "description" : { "created_at" : "2009-10-15 17:38:00",
            "text" : "It's trending cuzz it's true"
          },
        "edit_count" : "8",
        "first_trended_at" : "2009-10-15 17:30:02",
        "last_trended_at" : "2009-10-15 19:55:01",
        "name" : "#Twitterrules",
        "query" : "#Twitterrules",
        "url" : "http://search.twitter.com/search?q=%23Twitterrules",
        "category_id" : "11",
        "category_name" : "News"
      }, ...
    ]
}
	

trends.spam

Description

A list of the trends most recently identified as SPAM or spam targets.

Available formats

json

Parameters

  1. count: Number of trends to return. The default is 10.
  2. callback: JSONP callback parameter.
  3. api_key: Optional key for high-volume transactions.

Examples

Response

JSON:
{
  "api_version" : "2.0",
  "as_of" : "2009-10-15 19:57:01",
  "trends" : [ { "description" : { "created_at" : "2009-10-15 19:54:32",
            "text" : "A 6 year old was believed to be stuck in a homemade hot air balloon in Denver, Colorado. The balloon landed with no boy found inside. The boy is still missing."
          },
        "first_trended_at" : "2009-10-15 19:00:01",
        "last_trended_at" : "2009-10-15 19:55:01",
        "name" : "Colorado",
        "newly_trending" : "0",
        "query" : "Colorado",
        "trend_index" : "1",
        "url" : "http://search.twitter.com/search?q=Colorado",
        "category_id" : "11",
        "category_name" : "News"
      },
      { "description" : { "created_at" : "2009-10-15 19:54:10",
            "text" : "A 6 year old was believed to be stuck in a homemade hot air balloon in Denver, Colorado. The balloon landed with no boy found inside. The boy is still missing."
          },
        "first_trended_at" : "2009-10-15 19:30:01",
        "last_trended_at" : "2009-10-15 19:55:01",
        "name" : "#saveballoonboy",
        "newly_trending" : "0",
        "query" : "#saveballoonboy",
        "trend_index" : "2",
        "url" : "http://search.twitter.com/search?q=%23saveballoonboy",
        "category_id" : "11",
        "category_name" : "News"
      }, ...
    ]
}

trend/revert

Description

Reverts the trend description to an earlier version.

Parameters

Examples

Response

200 OK if successful.

trend/update

Description

Updates an existing trend or creates a new trend based on a trend id

Required POST Parameters

Optional POST Parameters

Examples

Response

200 OK if successful.

categories

Description

A list of the categories available.

Available formats

json

Parameters

  1. callback: JSONP callback parameter.
  2. api_key: Optional key for high-volume transactions.

Examples

Response

JSON:
{
  "api_version":"2.0",
  "categories":
    [
        {"id":1,"name":"Entertainment"},
        {"id":2,"name":"Gaming"},
        {"id":3,"name":"Lifestyle"},
        {"id":4,"name":"Science"},
        {"id":5,"name":"Sports"},
        {"id":6,"name":"Technology"},
        {"id":7,"name":"Business"},
        {"id":8,"name":"SPAM"},
        {"id":9,"name":"Meme"},
        {"id":10,"name":"Conference or Event"},
        {"id":11,"name":"News"},
        {"id":12,"name":"Place or Location"},
        {"id":13,"name":"Holiday or Date"},
        {"id":14,"name":"Other"}
    ]
}

Methods (V1)

trend/listAll

Description

Lists all trends (currently limited to 100). Most recently updated trends are returned first.

Available formats

rss, xml, json, jsonp

Parameters

Examples

Response

trend/listExplained

Lists all trends (currently limited to 100) which have been explained by users. Most recently explained trends are returned first.

Available formats

rss, xml, json, jsonp

Parameters

Examples

trend/getByName

Returns all information about a single trend.

Available formats

xml, json, jsonp

Parameters

Examples

Be careful with special characters, the trend name should be URL-encoded:

trend/getById

Returns all information about a single trend, given a trend id.

Available formats

xml, json

Parameters

Examples

trend/search (simple)

Search for a trend with the specified text. Returns up to the top 10 matching trends as a very simple carriage-return-delimited list. This is useful for auto-complete text boxes.

Parameters

Examples

trend/search_extended

Search for a trend with the specified text. Returns up to the top 10 matching trends along with with their explanation

Available formats

rss, xml, json, jsonp

Parameters

Examples

trend/update

Updates a trend description via an HTTP POST. Note that this request will only be successful for the first 10 requests each hour from an individual IP address. Access may be blocked if this request is abused (for example, posting spammy descriptions). Please provide a human-readable name of your app in the "from" parameter.

POST Parameters

Response

Whether updating is successful or failed, the response is text/html, and contains a copy of the blurb submitted, with any HTML stripped and URLs linked.

Categories

This list may expand to include user-defined categories.

  1. Entertainment
  2. Gaming
  3. Lifestyle
  4. Science
  5. Sports
  6. Technology
  7. World & Business
  8. SPAM