Jump to content

Twitter API Status Method Reference

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

Delete a Tweet

Removes a single status update from the Twitter timeline.

Path

/statuses/destroy/id.xml

Requires authentication

Yes (the account owns the existing update).

Charged against rate limit

No.

HTTP method type

POST or DELETE.

Required parameters

 
 

id

Provides the record ID for an existing status update owned by the authenticating user. The id parameter is passed as part of the URL request.

Successful output

See the section called “Publishing”.


View Followers

Returns a list of people who follow you.

Path

/statuses/followers.xml

Requires authentication

Yes (authenticating user must be allowed by the author to view a private list of followers).

Charged against rate limit

Yes.

HTTP method type

GET.

Optional parameters

 
 

id

Indicates the user ID or username of the Twitter account whose follower list you want to view. The id parameter is passed as part of the URL request: /statuses/followers/id.xml.

 

page

Indicates which page of 100 users to return. The default is 1 (users most recently created).

Successful output

See the section called “The Follow Network”.


View Members Being Followed

Returns a list of people you follow.

Path

/statuses/friends.xml

Requires authentication

Yes, if the account is private (authenticating user must be allowed by the author to view the list of friends).

Charged against rate limit

Yes.

HTTP method type

GET.

Optional parameters

 
 

id

Indicates the user ID or username of the Twitter account whose following list you want to view. The id parameter is passed as part of the URL request: /statuses/friends/id.xml.

 

page

Indicates which page of 100 users to return. The default is 1 (users most recently followed).

Successful output

See the section called “The Follow Network”.


Note

There are newer methods that allow you to get the entire list of followers and friends as user IDs. No other information is included in the Twitter API response, but it does save on pagination. See the section called “Get All Followers” and the section called “Get All Friends”.

View a Friends Timeline

Returns the most recent status updates made by people you follow.

Path

/statuses/friends_timeline.xml

Requires authentication

Yes.

Charged against rate limit

Yes.

HTTP method type

GET.

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).

 

count

Limits the most recent status updates to the number of records specified. The maximum count is 200, and the default is 20.

 

page

Indicates which page of 20 items to return. The default is 1 (the most recent status updates).

Successful output

See the section called “The Information Stream”.


View the Public Timeline

Returns the most recent status updates from public accounts with custom pictures.

Path

/statuses/public_timeline.xml

Requires authentication

No.

Charged against rate limit

No.

HTTP method type

GET.

Successful output

See the section called “The Information Stream”.


View Replies

Returns the most recent status updates from people who have replied to you.

Path

/statuses/replies.xml

Requires authentication

Yes (replies are to the authenticating user).

Charged against rate limit

Yes.

HTTP method type

GET.

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).

 

count

Limits the most recent replies to the number of records specified. The maximum count is 200, and the default is 20.

 

page

Indicates which page of 20 items to return. The maximum value is currently 40, and the default is 1 (the most recent status updates).

Successful output

See the section called “The Information Stream”.


Show a Tweet

Returns a single status update with the given ID.

Path

/statuses/show/id.xml

Requires authentication

Yes, if the status update is private (authenticating user must be allowed by the author to view the text).

Charged against rate limit

Yes.

HTTP method type

GET.

Required parameters

 
 

id

Provides the record ID for an existing status update owned by the authenticating user. The id parameter is passed as part of the URL request.

Successful output

See the section called “The Information Stream”.


Post a Tweet

Creates a new status update authored by you.

Path

/statuses/update.xml

Requires authentication

Yes (this account owns the status update).

Charged against rate limit

No.

HTTP method type

POST.

Required parameters

 
 

status

Indicates the text used to update the authenticating user’s status. This string is limited to 140 characters after URL encoding.

Optional parameters

 
 

in_reply_to_status_id

Provides the record ID of an existing status update to which the new update will be attached.

 

source

Identifies the name of the tool used to publish the tweet (as in “web” or “twitterrific”).

Successful output

See the section called “Publishing”.


View an Individual Timeline

Returns the most recent status updates for a specific account.

Path

/statuses/user_timeline/id.xml

Requires authentication

Yes, if the account is private (authenticating user must be allowed by the author to view the timeline).

Charged against rate limit

Yes.

HTTP method type

GET.

Required parameters

None, if authenticated (Twitter assumes the authenticating user is the id).

Optional parameters

 
 

id

Provides the user ID or username for the Twitter account whose timeline you want to view. The id parameter is passed as part of the URL request.

 

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).

 

count

Limits the most recent status updates to the number of records specified. The maximum count is 200, and the default is 20.

 

page

Indicates which page of 20 items to return. The default is 1 (the most recent status updates).

Successful output

See the section called “The Information Stream”.

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.

See what you'll learn


0 Replies