2. May 10, 2013
Content
API types
Twitter tweets flow
Rest API
Search API
Stream API
Authentication
3. May 10, 2013
API Types
There are actually three Twitter APIs.
1)
2) REST API
3) Search API
4) Stream API
5)
4. May 10, 2013
API features
Rest API
– Covers the basic Twitter functions
– You can read your timeline and direct messages,
– Tweet and retweet from the REST API,
– Follow and unfollow other users, send direct messages (DMs),
– Manipulate your lists, and so on.
5. May 10, 2013
API features
Search API:
– Duplicates the Twitter search page .
– It can do everything that the Twitter Advanced Search can do
– Nearly all the Twitter monitoring tools depend on this Twitter search API.
Streaming API:
– The streaming API is read-only
– Unlike the search API, the streaming API is not buffered through the search
database.
– There are more tweets available to users of the streaming API than there are to
users of the search API.
7. May 10, 2013
Rest API
Timelines
• collections of Tweets, ordered with the most recent first
Tweets
• status updates with additional associated metadata
direct messages
• short, non-public messages sent between two users
friends & followers
• follow their interests on Twitter through both one-way and mutual following
relationships
Users
• Users are at the center of everything Twitter: they follow, they favorite, and
tweet & retweet.
suggested users
• Categorical organization of users that others may be interested to follow.
8. May 10, 2013
Favoriates
• Users favorite tweets to give recognition to awesome tweets
Lists
• Collections of tweets, culled from a curated list of Twitter users.
saved search
• Allows users to save references to search criteria for reuse later.
places & geo
• These methods allow you to attach location data to tweets and discover
tweets & locations.
Trends
• The Trends methods allow you to explore what's trending on Twitter.
spam reporting
• These methods are used to report user accounts as spam accounts.
9. May 10, 2013
Search and Streaming API
Search API:
Returns a collection of relevant Tweets matching a specified query.
– Parameters: q,callback, geocode, lang, locale, page, result_type, rpp,
show_user, until, since_id, max_id, include_entities
Streaming API:
Public stream
– Public data flowing through Twitter
User stream
– Single-user streams, containing roughly all of the data corresponding with a
single user's view of Twitter.
Site stream
– The multi-user version of user streams.
10. May 10, 2013
Streaming API
POST statuses/filter
• follow
• track
• locations
• delimited
• stall_warnings
GET statuses/sample
• delimited
• stall_warnings
GET statuses/firehose
• count
11. May 10, 2013
Authentication
Base
– Username password
– Its deprecated in all APIs except streaming API
Oauth
– Application-user authentication
12. May 10, 2013
References
[1] dev.twitter.com
[2] http://borasky-research.net/2010/01/06/the-twitter-streaming-api-how-it-works-and-why-its-a-
big-deal