Jump to content

Twitter API Search Method Reference

0
  kmakice's Photo
Posted Oct 29 2009 10:18 AM

Keyword Search

Searches for keyword matches in tweet content.

Path

search.twitter.com/search.atom?q=query

Requires authentication

No.

Charged against rate limit

No.

HTTP method type

GET.

Required parameters

 
 

q

Contains the encoded keywords and other parameters used for the search.

Optional parameters

 
 

since

Ignores information older than the specified time (which must be within the last 24 hours). The value must be encoded in the format “Mon, 3 Nov 2008 18:39:12 GMT”.

 

since_id

Returns only the most recent updates (those made since the specified record ID was created).

 

page

Indicates which page of items to return, with the size of the page determined by rpp. The default is 1 (the most recent messages).

 

rpp

Indicates the size of a given result page. The maximum is 100 items per page, and the default is 16.

 

geocode

There are three parts to the geocode parameter: latitude, longitude, and radius of interest. The resulting comma-delimited string (e.g., “39.123456,-86.345678,10km”) must be URL-encoded. The radius must be specified in units of either mi (miles) or km (kilometers).

 

lang

Contains an accepted ISO 639-1 code (e.g., “en”) to indicate the language of all returned tweets.

 

show_user

When set to true, tags the beginning of each tweet returned in the search results with a username and a colon (e.g., “kmakice:Writing”).

 

callback

(JSON only.) A callback allows a program to pass a reference to a dynamic function on the application side.

Successful output

See the section called “Search”.


Monitor Trends

Returns the current top keyword trends in the public timeline.

Path

search.twitter.com/trends.json

Requires authentication

No.

Charged against rate limit

No.

HTTP method type

GET.

Successful output

Ten keywords and search links (JSON output format only)

Cover of Twitter API: Up and Running
Learn more about this topic from Twitter API: Up and Running. 

This groundbreaking book provides you with the skills and resources you need to build web applications for Twitter. Perfect for new and casual programmers intrigued by the microblogging, Twitter API: Up and Running carefully explains how each part of Twitter's API works, with detailed examples that show you how to assemble those building blocks into practical and fun web applications.

Learn More Read Now on Safari


Tags:
0 Subscribe


0 Replies