CINXE.COM
Streaming API | Twitter Developers
<!DOCTYPE html><head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("https://dev.twitter.com/docs/streaming-api","20111109103810","https://web.archive.org/","web","/_static/", "1320835090"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Streaming API | Twitter Developers</title> <meta name="keywords" content="Real Time, Streamed Tweets"/> <meta name="description" content="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."/> <script src="https://web.archive.org/web/20111109103810js_/https://platform.twitter.com/widgets.js" type="text/javascript"></script> <link rel="next" href="/web/20111109103810/https://dev.twitter.com/docs/streaming-api/concepts"/> <link rel="shortcut icon" href="/web/20111109103810im_/https://dev.twitter.com/sites/all/themes/twitter_commons/favicon.ico" type="image/x-icon"/> <link type="text/css" rel="stylesheet" media="all" href="/web/20111109103810cs_/https://dev.twitter.com/sites/default/files/css/css_258ec3672782fadbaf9030ffbcabd5e3.css"/> <script type="text/javascript" src="/web/20111109103810js_/https://dev.twitter.com/sites/default/files/js/js_6a0ca864189781d957cde9705a092b22.js"></script> <script type="text/javascript"> <!--//--><![CDATA[//><!-- jQuery.extend(Drupal.settings, {"basePath":"\/","googleanalytics":{"trackOutgoing":1,"trackMailto":1,"trackDownload":1,"trackDownloadExtensions":"7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip"},"twitter_autosuggest":{"path":"\/twitter_autosuggest_callback"},"extlink":{"extTarget":"_blank","extClass":"ext","extSubdomains":0,"extExclude":"twitter\\.com\/intent\/","extInclude":"","extAlert":0,"extAlertText":"","mailtoClass":"mailto"},"AjaxLoad":{"css":["\/modules\/book\/book.css","\/modules\/node\/node.css","\/modules\/system\/defaults.css","\/modules\/system\/system.css","\/modules\/system\/system-menus.css","\/modules\/user\/user.css","\/profiles\/drupal_commons\/modules\/contrib\/cck\/theme\/content-module.css","\/profiles\/drupal_commons\/modules\/contrib\/ctools\/css\/ctools.css","\/profiles\/drupal_commons\/modules\/contrib\/date\/date.css","\/profiles\/drupal_commons\/modules\/contrib\/filefield\/filefield.css","\/profiles\/drupal_commons\/modules\/contrib\/views_slideshow\/contrib\/views_slideshow_singleframe\/views_slideshow.css","\/sites\/default\/files\/geshifilter-languages.css","\/sites\/all\/modules\/contrib\/geshifilter\/geshifilter.css","\/sites\/all\/modules\/contrib\/panels\/css\/panels.css","\/sites\/all\/modules\/contrib\/tableofcontents\/tableofcontents.css","\/sites\/all\/modules\/custom\/twitter_apps\/twitter_apps.css","\/sites\/all\/modules\/custom\/twitter_autosuggest\/jquery-autocomplete\/jquery.autocomplete.css","\/sites\/all\/modules\/overriden\/mollom\/mollom.css","\/sites\/all\/modules\/contrib\/extlink\/extlink.css","\/profiles\/drupal_commons\/modules\/contrib\/cck\/modules\/fieldgroup\/fieldgroup.css","\/profiles\/drupal_commons\/modules\/contrib\/views\/css\/views.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-defaults.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-style.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-admin-addts.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-homepage.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-menus.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-apidoc.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-notices.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-forms.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-discussions.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-notifications.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-blog.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-pager.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-login.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-documentation.css","\/sites\/all\/themes\/twitter_commons\/css\/custom\/twttr-issues.css","\/sites\/all\/themes\/twitter_commons\/css\/overridden\/search.css","\/sites\/all\/themes\/twitter_commons\/css\/overridden\/system.css","\/sites\/all\/themes\/twitter_commons\/css\/overridden\/system-menus.css","\/sites\/all\/themes\/twitter_commons\/css\/overridden\/book.css","\/sites\/all\/themes\/twitter_commons\/css\/overridden\/comment.css","\/sites\/all\/themes\/twitter_commons\/css\/overridden\/tableofcontents.css"],"scripts":["\/misc\/jquery.js","\/misc\/drupal.js","\/profiles\/drupal_commons\/modules\/contrib\/ajax_load\/ajax_load.js","\/profiles\/drupal_commons\/modules\/contrib\/views_slideshow\/js\/jquery.cycle.all.min.js","\/profiles\/drupal_commons\/modules\/contrib\/views_slideshow\/contrib\/views_slideshow_singleframe\/views_slideshow.js","\/sites\/all\/modules\/contrib\/google_analytics\/googleanalytics.js","\/sites\/all\/modules\/contrib\/panels\/js\/panels.js","\/sites\/all\/modules\/contrib\/tableofcontents\/jquery.scrollTo-min.js","\/sites\/all\/modules\/contrib\/tableofcontents\/jquery.localscroll-min.js","\/sites\/all\/modules\/contrib\/tableofcontents\/tableofcontents.js","\/sites\/all\/modules\/custom\/twitter_autosuggest\/jquery-autocomplete\/jquery.autocomplete.js","\/sites\/all\/modules\/custom\/twitter_autosuggest\/twitter_autosuggest.js","\/sites\/all\/modules\/overriden\/mollom\/mollom.js","\/sites\/all\/modules\/contrib\/extlink\/extlink.js","\/sites\/all\/themes\/twitter_commons\/js\/supposition.js","\/sites\/all\/themes\/twitter_commons\/js\/superfish.js","\/sites\/all\/themes\/twitter_commons\/js\/twitter-commons-script.js","\/sites\/all\/themes\/twitter_commons\/js\/secret.js","\/sites\/all\/themes\/twitter_commons\/js\/hashchange.js"]}}); //--><!]]> </script> </head> <body id="page-node" class="not-front not-logged-in node-type-documentation"> <div id="page"> <a href="#content-main" class="skip">Skip to Main Content Area</a> <div id="header-outer"> <div id="header"> <a href="/web/20111109103810/https://dev.twitter.com/" id="logo" title="Home"> Developers </a> <form action="/web/20111109103810/https://dev.twitter.com/docs/streaming-api" accept-charset="UTF-8" method="post" id="search-theme-form"> <input id="search-q" name="search_theme_form" type="text" maxlength="128" size="15" value="Search" title="Enter search terms" placeholder="Search"/> <input id="search-submit" name="op" type="submit" value="Search"/> <input type="hidden" name="form_build_id" id="form-ca65dda09f5b60a467ab717ef045dae7" value="form-ca65dda09f5b60a467ab717ef045dae7"/> <input type="hidden" name="form_id" id="edit-search-theme-form" value="search_theme_form"/> </form> <ul id="title-nav"><li class="expanded first"><a href="/web/20111109103810/https://dev.twitter.com/status" title="">API Health</a><ul class="menu"><li class="leaf first"><a href="/web/20111109103810/https://dev.twitter.com/status" title="">API Status</a></li> <li class="leaf last"><a href="/web/20111109103810/https://dev.twitter.com/issues" title="">API Issues</a></li> </ul></li> <li class="leaf"><a href="/web/20111109103810/https://dev.twitter.com/blog" title="">Blog</a></li> <li class="leaf"><a href="/web/20111109103810/https://dev.twitter.com/discussions" title="">Discussions</a></li> <li class="expanded active-trail"><a href="/web/20111109103810/https://dev.twitter.com/docs" title="">Documentation</a><ul class="menu"><li class="leaf first"><a href="/web/20111109103810/https://dev.twitter.com/docs" title="">Overview</a></li> <li class="leaf"><a href="/web/20111109103810/https://dev.twitter.com/docs/api" title="">REST API</a></li> <li class="leaf active-trail"><a href="/web/20111109103810/https://dev.twitter.com/docs/streaming-api" title="Streaming API" class="active">Streaming API</a></li> <li class="leaf"><a href="/web/20111109103810/https://dev.twitter.com/docs/twitter-for-websites" title="">Twitter for Websites</a></li> <li class="leaf last"><a href="/web/20111109103810/https://dev.twitter.com/docs/recent" title="">Recently updated</a></li> </ul></li> <li class="leaf last"><a href="/web/20111109103810/https://dev.twitter.com/user/login?destination=node%2F119" title="">Sign in</a></li> </ul> </div> </div> <div id="content-outer"> <div id="breadcrumbs"> <div class="breadcrumb"><a href="/web/20111109103810/https://dev.twitter.com/">Home</a> → <a href="/web/20111109103810/https://dev.twitter.com/docs">Documentation</a><div><a href="https://web.archive.org/web/20111109103810/http://twitter.com/share" data-count="none" data-related="twitterapi" class="twitter-share-button">Tweet</a></div></div> </div> <div id="preface"> <div id="dropdown"> <ul> <li><span class="title"><a href="/web/20111109103810/https://dev.twitter.com/docs/streaming-api" class="book-title active">Streaming API</a></span> <ul class="menu"><li class="leaf first"><a href="/web/20111109103810/https://dev.twitter.com/docs/streaming-api/concepts">Streaming API Concepts</a></li> <li class="leaf"><a href="/web/20111109103810/https://dev.twitter.com/docs/streaming-api/methods">Streaming API Methods</a></li> <li class="leaf"><a href="/web/20111109103810/https://dev.twitter.com/docs/streaming-api/response-codes">Streaming API Response Codes</a></li> <li class="collapsed"><a href="/web/20111109103810/https://dev.twitter.com/docs/streaming-api/user-streams">User Streams</a></li> <li class="leaf last"><a href="/web/20111109103810/https://dev.twitter.com/docs/streaming-api/site-streams">Site Streams</a></li> </ul> </li> </ul> </div> </div> <h1 id="title">Streaming API</h1> <div id="content-inner"> <div id="content-main"> <div class="doc-updated"> Updated on Tue, 2011-11-01 05:44 </div> <div> <h2>Introduction</h2> <div class="section"> <p>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.</p> </div> <h2 id="products">Products</h2> <div class="section"> <p>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. Note all these products endpoints are SSL (HTTPS) only.</p> <ul> <li><b><a href="https://web.archive.org/web/20111109103810/https://dev.twitter.com/docs/streaming-api">Streaming API</a>:</b> Public statuses from all users, filtered in various ways: By userid, by keyword, by random sampling, by geographic location, etc.</li> <li><b><a href="https://web.archive.org/web/20111109103810/https://dev.twitter.com/docs/streaming-api/user-streams">User Streams</a>:</b> 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 <b><u>may not</u></b> 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.</li> <li><b><a href="https://web.archive.org/web/20111109103810/https://dev.twitter.com/docs/streaming-api/site-streams">Site Streams</a>: <i>BETA</i></b> 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 <b><u>must be</u></b> used. The primary use case is website and other service integrations.</li> </ul> </div> <h2 id="documents">Documents</h2> <div class="section"> <ul> <li><a href="https://web.archive.org/web/20111109103810/https://dev.twitter.com/docs/streaming-api/concepts">Concepts</a></li> <li><a href="https://web.archive.org/web/20111109103810/https://dev.twitter.com/docs/streaming-api/methods">Methods and Query Parameters</a></li> <li><a href="https://web.archive.org/web/20111109103810/https://dev.twitter.com/docs/streaming-api/response-codes">HTTP Response Codes</a></li> <li><a href="https://web.archive.org/web/20111109103810/https://dev.twitter.com/docs/streaming-api/user-streams">User Streams</a></li> <li><a href="https://web.archive.org/web/20111109103810/https://dev.twitter.com/docs/streaming-api/user-streams/suggestions">User Streams Suggestions</a></li> <li><a href="https://web.archive.org/web/20111109103810/https://dev.twitter.com/docs/streaming-api/site-streams">Site Streams</a></li> </ul> </div> <h2 id="checklist">Pre-launch Checklist</h2> <div class="section"> <p>Before launching your Streaming API application we recommend you run through this short checklist.</p> <ol> <li><strong>Use SSL</strong> — the streaming API is SSL only.</li> <li>Using the correct product?</li> <li>Not purposefully attempting to circumvent access limits and levels?</li> <li>Creating the minimal number of connections?</li> <li>Avoiding duplicate logins?</li> <li>Avoiding needless reconnection?</li> <li>Backing off from failures: none for first disconnect, seconds for repeated network (TCP/IP) level issues, minutes for non-200 HTTP codes?</li> <li>Using long-lived connections?</li> <li>Tolerant of other objects and newlines in markup stream? (Non <status> objects...)</li> <li>Tolerant of duplicate and out-of-order messages?</li> <li>Carefully monitoring the <a href="/web/20111109103810/https://dev.twitter.com/blog/category/announcements">announcements blog</a> and using <a href="/web/20111109103810/https://dev.twitter.com/discussions">Discussions</a> for questions?</li> <li>Following <a href="https://web.archive.org/web/20111109103810/https://twitter.com/intent/user?screen_name=twitterapi&related=sitestreams">@twitterapi</a> and the <a href="https://web.archive.org/web/20111109103810/https://twitter.com/intent/user?screen_name=sitestreams&related=twitterapi">@sitestreams</a> accounts?</li> <li>If you're connecting via a mobile device, are you only connecting when over wi-fi? Cellular based connections are not at all advised.</li> </ol> </div> <ul class="book-links"> <li class="previous"> </li> <li class="up"> </li> <li class="next"> <a href="/web/20111109103810/https://dev.twitter.com/docs/streaming-api/concepts">Streaming API Concepts</a> → </li> </ul> </div> </div> <div id="sidebar-last"> <div class="block"> <h2>Tags</h2> <div class="view"> <div class="content"> <div class="item-list"> <ul> <li class="views-row views-row-1 views-row-odd views-row-first"> <a href="/web/20111109103810/https://dev.twitter.com/tags/streamed-tweets">Streamed Tweets</a> (14)</li> <li class="views-row views-row-2 views-row-even views-row-last"> <a href="/web/20111109103810/https://dev.twitter.com/tags/real-time">Real Time</a> (2)</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div id="footer-outer"> <div id="footer"> <a href="https://web.archive.org/web/20111109103810/http://twitter.com/twitterapi" data-show-count="false" class="twitter-follow-button" data-text-color="999999" data-link-color="0080A6">Follow @twitterapi</a><ul class="menu"><li class="leaf first"><a href="/web/20111109103810/https://dev.twitter.com/terms/api-terms" title="Developer Rules of the Road">API Terms</a></li> <li class="leaf"><a href="/web/20111109103810/https://dev.twitter.com/status" title="Twitter API Status">API Status</a></li> <li class="leaf"><a href="/web/20111109103810/https://dev.twitter.com/blog" title="Twitter Developer blog">Blog</a></li> <li class="leaf"><a href="/web/20111109103810/https://dev.twitter.com/discussions" title="Twitter Development discussions">Discussions</a></li> <li class="leaf"><a href="/web/20111109103810/https://dev.twitter.com/docs" title="Twitter development documentation">Documentation</a></li> <li class="leaf last"><a href="https://web.archive.org/web/20111109103810/http://www.acquia.com/" title="Acquia">A Drupal community site supported by Acquia</a></li> </ul> </div> </div> </div><script type="text/javascript"> <!--//--><![CDATA[//><!-- var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-30775-16"]);_gaq.push(['_setCustomVar', 1, "roles", "anonymous user", 2]);_gaq.push(['_setCustomVar', 2, "type", "documentation", 3]);_gaq.push(['_setCustomVar', 3, "category", "Real Time", 3]);var current_domain = document.domain; var current_url = document.URL; if (current_domain == 'dev.twitter.com' && !current_url.match(/\/(apps|admin)/)) { _gaq.push(['_trackPageLoadTime']); }_gaq.push(["_trackPageview"]);(function() {var ga = document.createElement("script");ga.type = "text/javascript";ga.async = true;ga.src = "/sites/default/files/googleanalytics/ga.js?B";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(ga, s);})(); //--><!]]> </script> </body> </html><!-- FILE ARCHIVED ON 10:38:10 Nov 09, 2011 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 10:01:05 Dec 11, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.533 exclusion.robots: 0.027 exclusion.robots.policy: 0.017 esindex: 0.012 cdx.remote: 10.63 LoadShardBlock: 222.18 (3) PetaboxLoader3.datanode: 77.847 (4) PetaboxLoader3.resolve: 189.996 (2) load_resource: 122.713 -->