Twitter has multiple streaming APIs that allow tweets to flow into thousands of different integrations and channels. Their streaming APIs give developers low latency access to Twitter’s global stream of Tweet data. A streaming client will be pushed messages indicating Tweets and other events have occurred, without any of the overhead associated with polling a REST endpoint. On the contrary, Twitter’s Search API allows you to poll data from tweets that have already happened. On the other hand, Twitter’s Streaming API is a push of data as tweets happen in near real-time. With Twitter’s Streaming API, users register a set of criteria and as tweets match the criteria, they are pushed directly to the user.
From Twitter’s docs, the streaming process gets the input Tweets and performs any parsing, filtering, and/or aggregation needed before storing the result to a data store. The HTTP handling process queries the data store for results in response to user requests. While this model is more complex than the first example, the benefits from having a realtime stream of Tweet data make the integration worthwhile for many types of apps.
Tweet Stream – A simple EventMachine-based library for consuming Twitter’s Streaming API.
Twitter Java HTTP Client – A Java HTTP client for consuming Twitter’s Streaming API