Welcome to the Twitter Fan Wiki
We've set this up as a place to post cool ideas, uses and feature requests for Twitter.
Share anything you've found that you think the Twitter community might be interested in!
Please visit our forum to report problems or questions about this wiki.
The official API docs live here. Also check out the Twitter developer talk Google Group.
As the official docs are not yet written, I've decided to take the bull by the horns and start this page. Feel free to update and edit at will .. this is a wiki :)
The public timeline can be retrieved as JSON, XML, RSS and ATOM from the following URLs:
Response type: status
There are currently two options for authorization:
Basic Authorization is done via whatever method your library requires. This could be the simple use of a URL such as: http://username:password@twitter.com/statuses/user_timeline.xml
Any other implementation of basic authorization should be referred to your programming language's WWW libraries.
Response type: N/A - This auth type is used with any command. A 401 status indicates a failed auth.
NOTE: This is not an official API command. You will receive a text/html response. You will need to parse that to determine success/failure. There is no guarantee Twitter will not change the content of the returned page.
If you prefer, you can use cookie management to login via the website auth. Send a POST request to http://twitter.com/login with the 'username_or_email' and 'password' parameters set as appropriate. The headers of the response will include a '_twitter_session' cookie. Present this on all future requests.
Response type: html
These commands are only available to users who have logged in as above
user_timelineThis command returns the authorized user's timeline. The following URLs require no extra parameters:
friends_timelineThis command returns the authorized user's friends timeline (friends include the authorized user). The following URLs require no extra parameters:
friendsThis command returns the authorized user and their friends' current status. *Not* a timeline, just the latest entry:
NOTE: 2007-03-21: This appears not to be working for RSS or ATOM
followersThis command returns the authorized user's followers' current status. Once again, *not* a timeline, just the latest entry:
NOTE: 2007-03-21: This appears not to be working for RSS or ATOM
update
This command allow you to set the authorized user's status. Send a POST request to the following URLs with the 'status' parameter set to the new status. Don't forget to URL-encode the status if you library doesn't do it for you.
Response type: null
account_settingsNOTE: This is not an official API command. You will receive a text/html response. You will need to parse that to determine success/failure. There is no guarantee Twitter will not change the content of the returned page.
This command allows you to set various account settings for the authorized user. Send a POST to the following URL:
The following parameter names should be self explanatory. Don't forget to URL Encode both the parameter name and value if your library doesn't handle that for you automatically.
user[name] -- Only letters, numbers and underscores (_) are alloweduser[email]user[time_zone] -- See the website source for a list of accepted valuesuser[url]user[description] -- Up to 160 characters only.user[location]user[protected] -- 1 or 0
These responses are in reply to timeline type requests.
Fields returned:
| Field Path | Data format | Example |
|---|---|---|
created_at | Tue Mar 13 00:12:41 +0000 2007 | |
text | Up to 160 characters of utf8 | Creating this table |
id | Integer | 123 |
user.name | Up to 40 characters of utf8 | Rick Measham |
user.description | Up to 160 characters of utf8 | Perl and Javascript Developer |
user.location | Up to 30 characters of utf8 | Melbourne, Australia |
user.screen_name | Up to 15 characters from: A-Z a-z 0-9 and _ | RickMeasham |
user.url | Up to 100 characters of utf8 | http://rick.measham.id.au/ |
user.id | Integer | 1050881 |
(Note that the XML looks like: <statuses><status><created_at> ... </created_at> ... </status><statuses>)
These responses are in reply to requests that return user information such as friends and followers.
Fields returned:
| Field Path | Data format | Example |
|---|---|---|
id | Integer | 1050881 |
name | Up to 40 characters of utf8 | Rick Measham |
location | Up to 30 characters of utf8 | Melbourne, Australia |
description | Up to 160 characters of utf8 | Perl and Javascript Developer |
profile_image_url | Valid URL at twitter.com (the query string appears to be a random number to force a reload each time) | http://static.twitter.com//system/user/profile_image/1050881/normal/rickm.png?1173740203 |
url | Up to 100 characters of utf8 | http://rick.measham.id.au/ |
status.created_at | Tue Mar 13 00:12:41 +0000 2007 | |
status.id | Integer | 123 |
status.text | Up to 160 characters of utf8 | Creating this table |
(Note that the XML looks like: <users><user><created_at> ... </created_at> ... </user><users>)
These headers are currently considered a de facto standard. So they may change. Don't blame me if you have to change your code later on, but on 2007-03-21, Alex Payne (from Twitter) said:
Please do start sending headers to us. It'll be most helpful for planning our capacity.
Rick Measham (that's me!) then suggested the following headers, to which Alex replied:
Those X headers are exactly along the lines of what I was thinking. Thanks for setting a sane de-facto standard!
The following request header should be used when making the above calls:
X-Twitter-Client: [The 'brand name' of your client]X-Twitter-Client-Version: [The version number]X-Twitter-Client-URL: [URL of your client's meta information for publication in some future directory. See below]<client> <name>GoogleGadget</name> <version>2.01</version> <author> <name>Rick Measham</name> <email>google@twitter.isite.net.au</email> <twitter>RickMeasham</twitter> </author> <url>http://twitter.isite.net.au</url> <twitter>GoogleGadget</twitter> <description><![CDATA[ The Twitter Google Gadget brings all the fun of twitter to your Google personalised homepage. <a href="http://fusion.google.com/add?feedurl=http%3A//twitter.isite.net.au/twitter.xml"><img src="http://buttons.googlesyndication.com/fusion/add.gif" width="104" height="17" border="0" alt="Add to Google"></a> ]]> </description> </client>
The following terms are used in this document to signify the requirements of the API. Those in bold only apply when shown in bold. (They are based on section 1.2 of RFC2060)
Page Information
|
Wiki Information
|
Recent PBwiki Blog Posts |