The Wayback Machine - https://web.archive.org/web/20110803073202/https://dev.twitter.com/docs/streaming-api

Streaming API

Updated on Fri, 2011-07-08 07:48

Introduction

The Twitter Streaming API allows high-throughput near-realtime access to various subsets of public and protected Twitter data. Developers are strongly encouraged to read all of the documentation linked to by this document thoroughly.

Products

There are three main Streaming products: The Streaming API, User Streams and Site Streams. These products operate in the same way, but each serves a somewhat different purpose.

  • Streaming API: Public statuses from all users, filtered in various ways: By userid, by keyword, by random sampling, by geographic location, etc.
  • User Streams: Nearly all data required to update a user's display. Requires the user's OAuth token. Provides public and protected statuses from followings, direct messages, mentions, and other events taken on and by the user. A large number of User Streams may not be created from the same host or service. For example, an application that displays a few accounts at once may open a connection per account. The primary use case is providing updates to a Twitter client.
  • Site Streams: BETA Allows multiplexing of multiple User Streams over a Site Stream connection. Once more than a handful of User Streams connections are opened from the same host or service, Site Streams must be used. The primary use case is website and other service integrations.

Documents

Pre-launch Checklist

Before launching your Streaming API application we recommend you run through this short checklist.

  1. Using the correct product?
  2. Not purposefully attempting to circumvent access limits and levels?
  3. Creating the minimal number of connections?
  4. Avoiding duplicate logins?
  5. Avoiding needless reconnection?
  6. Backing off from failures: none for first disconnect, seconds for repeated network (TCP/IP) level issues, minutes for non-200 HTTP codes?
  7. Using long-lived connections?
  8. Tolerant of other objects and newlines in markup stream? (Non <status> objects...)
  9. Tolerant of duplicate and out-of-order messages?
  10. Carefully monitoring the Twitter-API-Announce mailing list and using Discussions for questions?
  11. Following @twitterapi and the @sitestreams accounts?