Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

690 lines (674 sloc) 24.567 kB
HOST: https://api.twitter.com
--- Twitter REST API Resources ---
---
Twitter is an information network and communication mechanism that produces more than 200 million tweets a day. The Twitter platform offers access to that corpus of data, via our APIs. Each API represents a facet of Twitter, and allows developers to build upon and extend their applications in new and creative ways. It's important to note that the Twitter APIs are constantly evolving, and developing on the Twitter Platform is not a one-off event.
# Twitter for Websites
Twitter for Websites (TfW) is a suite of products that enables websites to easily integrate Twitter. TfW is ideal for site developers looking to quickly and easily integrate very basic Twitter functions. This includes offerings like the Tweet button, which lets a user tweet about something she found engaging on your site to all of her friends. Her friends see that tweet, click through to your site, and some percentage of them will tweet that same content to their friends - a great distribution loop. Likewise, the Follow button allows a user to quickly follow your account back on Twitter. That particular user will then see updates from your account funneled back into her stream, creating a new channel of engagement with your user base.
# Search API
The Search API designed for products looking to allow a user to query for Twitter content. This may include finding a set of tweets with specific keywords, finding tweets referencing a specific user, or finding tweets from a particular user. This API will also provide your product access to data around Trends. If you need to query the Search API at extreme velocities and are hitting rate limits, then you should be working with the Streaming API. The latter API is covered in detail below.
# REST API
The REST API enables developers to access some of the core primitives of Twitter including timelines, status updates, and user information. If you're building application that leverages core Twitter objects, then this is the API for you. Imagine building a profile of a user: their name, their Twitter handle, their profile avatar, and the graph of people that they are following on Twitter - all with a few RESTful API calls. In addition to offering programmatic access to the timeline, status, and user objects, this API also enables developers a multitude of integration opportunities to interact with Twitter. Through the REST API, the user can create and post tweets back to Twitter, reply to tweets, favorite certain tweets, retweet other tweets, and more.
# Streaming API
The Streaming API is the real-time sample of the Twitter Firehose. This API is for those developers with data intensive needs. If you're looking to build a data mining product or are interested in analytics research, the Streaming API is most suited for such things. Streaming API allows for large quantities of keywords to be specified and tracked, retreiving geo-tagged tweets from a certain region, or have the public statuses of a user set returned. This requires you to establish a long-lived HTTP connection and maintain that connection. If you're currently developing on the Search API, and find that your application is being rate-limited or you just have aggressive querying needs, then you should be moving over to the Streaming API.
---
--
Timelines42
Timelines are collections of Tweets, ordered with the most recent first.
--
Returns the most recent statuses, including retweets if they exist, posted by the authenticating user and the user's they follow. This is the same timeline seen by a user when they login to twitter.com.This method is identical to statuses/friends_timeline, except that this method always includes retweets.This method is can only return up to 800 statuses, including retweets, across all pages.
GET /1/statuses/home_timeline
< 200
[
{
"coordinates": null,
"favorited": false,
"created_at": "Fri Jul 16 16:58:46 +0000 2010",
"truncated": false,
"entities": {
"urls": [
{
"expanded_url": null,
"url": "http://www.flickr.com/photos/cindyli/4799054041/",
"indices": [
75,
123
]
}
],
"hashtags": [
 
],
"user_mentions": [
{
"name": "Stephanie",
"id": 15473839,
"indices": [
27,
39
],
"screen_name": "craftybeans"
}
]
},
"text": "got a lovely surprise from @craftybeans. She sent me the best tshirt ever. http://www.flickr.com/photos/cindyli/4799054041/ ::giggles::",
"annotations": null,
"contributors": null,
"id": 18700887835,
"geo": null,
"in_reply_to_user_id": null,
"place": null,
"in_reply_to_screen_name": null,
"user": {
"name": "cindy li",
"profile_sidebar_border_color": "AD0066",
"profile_background_tile": false,
"profile_sidebar_fill_color": "AD0066",
"created_at": "Wed Nov 29 06:08:08 +0000 2006",
"profile_image_url": "http://a1.twimg.com/profile_images/553508996/43082001_N00_normal.jpg",
"location": "San Francisco, CA",
"profile_link_color": "FF8500",
"follow_request_sent": false,
"url": "http://www.cindyli.com",
"favourites_count": 465,
"contributors_enabled": false,
"utc_offset": -28800,
"id": 29733,
"profile_use_background_image": true,
"profile_text_color": "000000",
"protected": false,
"followers_count": 3395,
"lang": "en",
"notifications": true,
"time_zone": "Pacific Time (US & Canada)",
"verified": false,
"profile_background_color": "cfe8f6",
"geo_enabled": true,
"description": "Just me, Cindy Li.Giving cute substance since 1997.\r\nMarried to @themattharris.\r\nProduct designer for Yahoo! ",
"friends_count": 542,
"statuses_count": 4847,
"profile_background_image_url": "http://a3.twimg.com/profile_background_images/3368753/twitter_flowerbig.gif",
"following": true,
"screen_name": "cindyli"
},
"source": "web",
"in_reply_to_status_id": null
},
{
"coordinates": null,
"favorited": false,
"created_at": "Fri Jul 16 16:55:52 +0000 2010",
"truncated": false,
"entities": {
"urls": [
{
"expanded_url": null,
"url": "http://bit.ly/libraryman",
"indices": [
78,
102
]
}
],
"hashtags": [
 
],
"user_mentions": [
{
"name": "Cal Henderson",
"id": 6104,
"indices": [
108,
115
],
"screen_name": "iamcal"
}
]
},
"text": "Anything is possible when you're in the library... with a celestial sandwich: http://bit.ly/libraryman (via @iamcal)",
"annotations": null,
"contributors": null,
"id": 18700688341,
"geo": null,
"in_reply_to_user_id": null,
"place": {
"name": "San Francisco",
"country_code": "US",
"country": "The United States of America",
"attributes": {
 
},
"url": "http://api.twitter.com/1/geo/id/5a110d312052166f.json",
"id": "5a110d312052166f",
"bounding_box": {
"coordinates": [
[
[
-122.51368188,
37.70813196
],
[
-122.35845384,
37.70813196
],
[
-122.35845384,
37.83245301
],
[
-122.51368188,
37.83245301
]
]
],
"type": "Polygon"
},
"full_name": "San Francisco, CA",
"place_type": "city"
},
"in_reply_to_screen_name": null,
"user": {
"name": "Daniel Burka",
"profile_sidebar_border_color": "a655ec",
"profile_background_tile": true,
"profile_sidebar_fill_color": "f1ccff",
"created_at": "Mon Jan 15 15:22:14 +0000 2007",
"profile_image_url": "http://a3.twimg.com/profile_images/74260755/2009-square-small_normal.jpg",
"location": "San Francisco",
"profile_link_color": "5a0d91",
"follow_request_sent": false,
"url": "http://deltatangobravo.com",
"favourites_count": 92,
"contributors_enabled": false,
"utc_offset": -28800,
"id": 635543,
"profile_use_background_image": true,
"profile_text_color": "0C3E53",
"protected": false,
"followers_count": 9950,
"lang": "en",
"notifications": false,
"time_zone": "Pacific Time (US & Canada)",
"verified": false,
"profile_background_color": "BADFCD",
"geo_enabled": true,
"description": "Director of design at Tiny Speck. Ex-Creative director at Digg. CSS. Design. UX. Climbing. Cycling. Chilaquiles mmm.",
"friends_count": 219,
"statuses_count": 806,
"profile_background_image_url": "http://a3.twimg.com/profile_background_images/4444585/back.png",
"following": true,
"screen_name": "dburka"
},
"source": "web",
"in_reply_to_status_id": null
},
...
{
"coordinates": null,
"favorited": false,
"created_at": "Fri Jul 16 16:40:34 +0000 2010",
"truncated": false,
"entities": {
"urls": [
 
],
"hashtags": [
 
],
"user_mentions": [
 
]
},
"text": "Walking the DOM like Huggybear.",
"annotations": null,
"contributors": null,
"id": 18699620902,
"geo": null,
"in_reply_to_user_id": null,
"place": null,
"in_reply_to_screen_name": null,
"user": {
"name": "Kevin Lawver",
"profile_sidebar_border_color": "A8A37E",
"profile_background_tile": true,
"profile_sidebar_fill_color": "E6E2B0",
"created_at": "Sat Jul 29 18:23:37 +0000 2006",
"profile_image_url": "http://a3.twimg.com/profile_images/980477983/oh_lawver_normal.jpg",
"location": "Savannah, GA, US",
"profile_link_color": "DC4104",
"follow_request_sent": false,
"url": "http://lawver.net",
"favourites_count": 148,
"contributors_enabled": false,
"utc_offset": -18000,
"id": 3404,
"profile_use_background_image": true,
"profile_text_color": "003030",
"protected": false,
"followers_count": 1049,
"lang": "en",
"notifications": false,
"time_zone": "Eastern Time (US & Canada)",
"verified": false,
"profile_background_color": "003030",
"geo_enabled": true,
"description": "Nerd who loves web standards, Ruby on Rails and all things webbish. Chief Architect @ http://uplaya.com and co-founder of http://ficly.com. Happy dad & husband.",
"friends_count": 268,
"statuses_count": 10561,
"profile_background_image_url": "http://a1.twimg.com/profile_background_images/1391712/twitter_back.png",
"following": true,
"screen_name": "kplawver"
},
"source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Tweetie for Mac</a>",
"in_reply_to_status_id": null
},
]
Returns the 20 most recent mentions (status containing @username) for the authenticating user.The timeline returned is the equivalent of the one seen when you view your mentions on twitter.com.This method can only return up to 800 statuses. If include_rts is set only 800 statuses, including retweets if they exist, can be returned.This method will not include retweets in the XML and JSON responses unless the include_rts parameter is set. The RSS and Atom responses will always include retweets as statuses prefixed with RT.
GET /1/statuses/mentions
< 200
[
{
"coordinates": null,
"favorited": false,
"created_at": "Tue Jul 13 17:38:21 +0000 2010",
"truncated": false,
"entities": {
"urls": [
{
"expanded_url": null,
"url": "http://bit.ly/94BCpx",
"indices": [
119,
139
]
}
],
"hashtags": [
 
],
"user_mentions": [
{
"name": "Matt Harris",
"id": 777925,
"indices": [
56,
70
],
"screen_name": "themattharris"
},
{
"name": "Abraham Williams",
"id": 9436992,
"indices": [
72,
80
],
"screen_name": "abraham"
},
{
"name": "Matt Kelly",
"id": 6300552,
"indices": [
82,
93
],
"screen_name": "mattwkelly"
}
]
},
"text": "Just opened more slots for SF @socialappworkshop - with @themattharris, @abraham, @mattwkelly from FB- going fast tho! http://bit.ly/94BCpx",
"contributors": null,
"annotations": null,
"id": 18454047411,
"geo": null,
"in_reply_to_user_id": null,
"place": null,
"in_reply_to_screen_name": null,
"user": {
"name": "Shanley Kane",
"profile_sidebar_border_color": "BDDCAD",
"profile_background_tile": false,
"profile_sidebar_fill_color": "DDFFCC",
"created_at": "Wed Jun 24 22:24:43 +0000 2009",
"profile_image_url": "http://a0.twimg.com/profile_images/887285836/lele2_normal.jpg",
"location": "San Francisco",
"profile_link_color": "0084B4",
"follow_request_sent": false,
"url": "http://www.shanleykane.wordpress.com",
"favourites_count": 8,
"contributors_enabled": false,
"utc_offset": -28800,
"id": 50462250,
"profile_use_background_image": false,
"profile_text_color": "333333",
"protected": false,
"followers_count": 479,
"lang": "en",
"notifications": false,
"time_zone": "Pacific Time (US & Canada)",
"verified": false,
"profile_background_color": "9AE4E8",
"geo_enabled": true,
"description": "i work at apigee. this makes me an apigeek. i tweet about cloud, agile, APIs, tech stuff, pandas, propaganda, snark and trying to make it in the Valley.",
"friends_count": 440,
"statuses_count": 3100,
"profile_background_image_url": "http://s.twimg.com/a/1279228556/images/themes/theme1/bg.png",
"following": false,
"screen_name": "ShanleyKane"
},
"source": "<a href=\"http://www.tweetdeck.com\" rel=\"nofollow\">TweetDeck</a>",
"in_reply_to_status_id": null
},
{
"coordinates": null,
"favorited": false,
"created_at": "Sun Jul 11 02:45:34 +0000 2010",
"truncated": false,
"entities": {
"urls": [
 
],
"hashtags": [
 
],
"user_mentions": [
{
"name": "Matt Harris",
"id": 777925,
"indices": [
0,
14
],
"screen_name": "themattharris"
},
{
"name": "Twitter Espa\u00f1ol",
"id": 85426644,
"indices": [
15,
26
],
"screen_name": "twitter_es"
},
{
"name": "Paulina Goto",
"id": 110086132,
"indices": [
27,
42
],
"screen_name": "soypaulinagoto"
}
]
},
"text": "@themattharris @twitter_es @soypaulinagoto holaaaa!",
"contributors": null,
"annotations": null,
"id": 18240214048,
"geo": null,
"in_reply_to_user_id": 777925,
"place": null,
"in_reply_to_screen_name": "themattharris",
"user": {
"name": "leonardo daniel ",
"profile_sidebar_border_color": "87bc44",
"profile_background_tile": false,
"profile_sidebar_fill_color": "e0ff92",
"created_at": "Sun Jul 11 02:35:10 +0000 2010",
"profile_image_url": "http://s.twimg.com/a/1279228556/images/default_profile_5_normal.png",
"location": null,
"profile_link_color": "0000ff",
"follow_request_sent": false,
"url": null,
"favourites_count": 0,
"contributors_enabled": false,
"utc_offset": null,
"id": 165262200,
"profile_use_background_image": true,
"profile_text_color": "000000",
"protected": false,
"followers_count": 0,
"lang": "es",
"notifications": false,
"time_zone": null,
"verified": false,
"profile_background_color": "9ae4e8",
"geo_enabled": false,
"description": null,
"friends_count": 3,
"statuses_count": 3,
"profile_background_image_url": "http://s.twimg.com/a/1279228556/images/themes/theme1/bg.png",
"following": false,
"screen_name": "pulpin_000"
},
"source": "web",
"in_reply_to_status_id": null
},
...
{
"coordinates": null,
"favorited": false,
"created_at": "Tue Jul 06 19:49:45 +0000 2010",
"truncated": false,
"entities": {
"urls": [
{
"expanded_url": null,
"url": "http://wiki.github.com/themattharris/annotations-hackfest/",
"indices": [
0,
58
]
}
],
"hashtags": [
{
"text": "devnest",
"indices": [
109,
117
]
}
],
"user_mentions": [
{
"name": "Matt Harris",
"id": 777925,
"indices": [
22,
36
],
"screen_name": "themattharris"
}
]
},
"text": "http://wiki.github.com/themattharris/annotations-hackfest/ Twitter annotations wiki page from @themattharris #devnest",
"contributors": null,
"annotations": null,
"id": 17891652167,
"geo": null,
"in_reply_to_user_id": null,
"place": null,
"in_reply_to_screen_name": null,
"user": {
"name": "Paul Kane",
"profile_sidebar_border_color": "ffffff",
"profile_background_tile": false,
"profile_sidebar_fill_color": "ffffff",
"created_at": "Thu May 03 05:58:32 +0000 2007",
"profile_image_url": "http://a3.twimg.com/profile_images/98546479/PK-front_normal.jpg",
"location": "London",
"profile_link_color": "8b8b9c",
"follow_request_sent": false,
"url": "http://pk2004.posterous.com/",
"favourites_count": 988,
"contributors_enabled": false,
"utc_offset": 0,
"id": 5732282,
"profile_use_background_image": true,
"profile_text_color": "000000",
"protected": false,
"followers_count": 1516,
"lang": "en",
"notifications": false,
"time_zone": "London",
"verified": false,
"profile_background_color": "FFFFFF",
"geo_enabled": true,
"description": "Tech geek, gadget addict, music lover, MTB'er, runner - sometimes.",
"friends_count": 1212,
"statuses_count": 3202,
"profile_background_image_url": "http://a3.twimg.com/profile_background_images/8321573/banksy.jpg",
"following": false,
"screen_name": "pk2004"
},
"source": "web",
"in_reply_to_status_id": null
}
]
Returns the 20 most recent statuses, including retweets if they exist, from non-protected users.The public timeline is cached for 60 seconds. Requesting more frequently than that will not return any more data, and will count against your rate limit usage.Consider using the Streaming API's sample capabilities instead.
GET /1/statuses/public_timeline
< 200
[
{
"coordinates": null,
"favorited": false,
"created_at": "Thu Jul 15 23:26:44 +0000 2010",
"truncated": false,
"text": "qu por qu kieres saver como poner pablito",
"contributors": null,
"id": 18639485000,
"geo": null,
"in_reply_to_user_id": null,
"place": null,
"in_reply_to_screen_name": null,
"user": {
"name": "paul isaias gallegos",
"profile_sidebar_border_color": "eeeeee",
"profile_background_tile": false,
"profile_sidebar_fill_color": "efefef",
"created_at": "Sun Jun 06 19:56:50 +0000 2010",
"profile_image_url": "http://a1.twimg.com/profile_images/972549385/m_e26ddd7e7a424fdebceef1b3d005011f_normal.jpg",
"location": "",
"profile_link_color": "009999",
"follow_request_sent": null,
"url": null,
"favourites_count": 0,
"contributors_enabled": false,
"utc_offset": -21600,
"id": 152752917,
"profile_use_background_image": true,
"profile_text_color": "333333",
"protected": false,
"followers_count": 1,
"lang": "es",
"notifications": null,
"time_zone": "Central Time (US & Canada)",
"verified": false,
"profile_background_color": "131516",
"geo_enabled": false,
"description": "",
"friends_count": 2,
"statuses_count": 18,
"profile_background_image_url": "http://a3.twimg.com/profile_background_images/122541097/m_4011538d4b734ec7923bd641d2fa274f.jpg",
"following": null,
"screen_name": "izaloko"
},
"source": "web",
"in_reply_to_status_id": null
},
...
{
"coordinates": null,
"favorited": false,
"created_at": "Thu Jul 15 23:26:04 +0000 2010",
"truncated": false,
"text": "RT @ApeyBaby44: Labels r run by lawyer & accountants. They see their artist as gimmicks they'll sell u now (cont) http://tl.gd/2hkmas",
"contributors": null,
"id": 18639444000,
"geo": null,
"in_reply_to_user_id": null,
"place": null,
"in_reply_to_screen_name": null,
"user": {
"name": "DIGGZ",
"profile_sidebar_border_color": "F2E195",
"profile_background_tile": true,
"profile_sidebar_fill_color": "FFF7CC",
"created_at": "Fri Apr 03 03:16:01 +0000 2009",
"profile_image_url": "http://a3.twimg.com/profile_images/1079346239/untitled_normal.JPG",
"location": "ATL, NC, VA, NY all day!",
"profile_link_color": "FF0000",
"follow_request_sent": null,
"url": "http://thisisseriousbiz.com",
"favourites_count": 42,
"contributors_enabled": false,
"utc_offset": -18000,
"id": 28489988,
"profile_use_background_image": true,
"profile_text_color": "0C3E53",
"protected": false,
"followers_count": 588,
"lang": "en",
"notifications": null,
"time_zone": "Quito",
"verified": false,
"profile_background_color": "BADFCD",
"geo_enabled": true,
"description": "Half of Production duo SeriousBIZ circa 2008\r\n#teamSERIOUSBIZ\r\n#teamblackberry PIN 315442C9\r\n#teamfollowback",
"friends_count": 477,
"statuses_count": 6269,
"profile_background_image_url": "http://a1.twimg.com/profile_background_images/118926256/_MG_43571.JPG",
"following": null,
"screen_name": "DIGGZSeriousBIZ"
},
"source": "<a href=\"http://www.ubertwitter.com/bb/download.php\" rel=\"nofollow\">\u00dcberTwitter</a>",
"in_reply_to_status_id": null
},
{
"coordinates": null,
"favorited": false,
"created_at": "Thu Jul 15 23:26:03 +0000 2010",
"truncated": false,
"text": "SE QUISESSEMOS VER V\u00cdDEO IRIAMOS AO YOUTUBE..NAO VIRIAMOS AKI (@gabii_elaa live on http://twitcam.com/16g41)",
"contributors": null,
"id": 18639443000,
"geo": null,
"in_reply_to_user_id": null,
"place": null,
"in_reply_to_screen_name": null,
"user": {
"name": "fernando maia ",
"profile_sidebar_border_color": "181A1E",
"profile_background_tile": false,
"profile_sidebar_fill_color": "252429",
"created_at": "Mon Jul 06 16:11:03 +0000 2009",
"profile_image_url": "http://a3.twimg.com/profile_images/302998843/Imagem_056_normal.jpg",
"location": "",
"profile_link_color": "2FC2EF",
"follow_request_sent": false,
"url": null,
"favourites_count": 1,
"contributors_enabled": false,
"utc_offset": -10800,
"id": 54248373,
"profile_use_background_image": true,
"profile_text_color": "666666",
"protected": false,
"followers_count": 28,
"lang": "en",
"notifications": false,
"time_zone": "Brasilia",
"verified": false,
"profile_background_color": "1A1B1F",
"geo_enabled": false,
"description": "",
"friends_count": 61,
"statuses_count": 296,
"profile_background_image_url": "http://s.twimg.com/a/1278951078/images/themes/theme9/bg.gif",
"following": false,
"screen_name": "fernandoomaia"
},
"source": "<a href=\"http://dev.twitter.com/\" rel=\"nofollow\">API</a>",
"in_reply_to_status_id": null
}
]
Jump to Line
Something went wrong with that request. Please try again.