Twitter Streaming API

By Alex Chen•9 min read
A timeline diagram showing Twitter Streaming API options from 2015 PowerTrack to 2026 — the boxes for PowerTrack, Compliance Stream, and Filtered Stream v1 are crossed out, only Filtered Stream v2 remains on the official side, with webhook and websocket alternatives below the line
Most of what "Twitter Streaming API" used to mean is gone. What's left is one pay-per-use endpoint and a couple of alternatives outside X.

If you searched "Twitter Streaming API" expecting to find the same set of endpoints you used in 2018 or 2020, the answer is — most of it is gone, and the survivor is metered per post. X (then Twitter) retired PowerTrack, Compliance Stream, and the Filtered Stream v1 in the years leading up to 2024, folded a much smaller subset into Filtered Stream v2, and now bills the v2 API pay-per-use at $0.005 per post read, capped at 3,000,000 Post reads per monthly billing cycle before Enterprise. The shape of real-time access changed; this page maps what's actually available now. TwitterAPI.io, a pay-per-use X (Twitter) API, pushes matching posts by webhook or WebSocket through filter rules; both paths are compared below.

Two audiences land on this page. The first is teams who built on PowerTrack or v1 streams years ago and are looking at a migration deadline. The second is builders evaluating real-time X data for a new project and trying to figure out whether the official streaming surface is reachable at their budget. Both audiences need the same map: what X kept, what they killed, and what works outside the X API entirely.

Underneath all the naming churn, the practical pattern is simple. The official path is Filtered Stream v2 on pay-per-use: $0.005 per post delivered, a 3M post-reads/month cap, one connection and 1,000 rules per project; past that you need Enterprise. The alternative path is a third-party API that offers webhooks or websockets without the cap — usually at a fraction of the per-post cost. The rest of this guide is the detail.

Live API capability

TwitterAPI.io webhook + websocket transports use the same rule primitives (/oapi/tweet_filter/add_rule etc.) — write one rule, switch transport without rewriting the matching logic. No 3M-read monthly cap, $0.15 per 1,000 posts returned.

01 — Section

What "Twitter Streaming API" Used to Mean

Through 2022, the term "Twitter Streaming API" covered three very different products. PowerTrack was the enterprise firehose — a server-to-server stream of every public post matching a set of rules, designed for newsrooms, brand-monitoring vendors, and trading firms. Compliance Stream carried delete events and account-status changes, used by anyone storing X data who needed to honour user deletions. Filtered Stream v1 was the standard-tier streaming endpoint — statuses/filter, the one most third-party Twitter apps were built on — with a 1% sample-of-the-firehose ceiling.

Each had its own API surface, its own auth flow, and its own rate-limit model. The combined offering looked rich on paper. In practice almost every team that integrated it ended up on statuses/filter because PowerTrack required an enterprise contract and Compliance Stream was an add-on most builders did not need.

Today none of those three names exist as live products. PowerTrack was end-of-life'd as part of the broader v1.1 retirement push that began in 2023. Compliance Stream was wrapped into a v2 "compliance batch" endpoint with a different mechanic. And the statuses/filter v1 stream was shut down with the rest of v1.1 in early 2023. The surviving streaming surface on X has a different name and a different billing model.

02 — Section

What X Eliminated in 2023-2026

The retirement was deliberate and is not being reversed. X's stated reasons combine policy and economics — suppressing automation, ending the era of low-cost firehose access, and consolidating revenue around fewer, higher-priced contracts.

PowerTrack: end-of-life. The enterprise firehose was the most expensive product to operate and the most politically sensitive (it was the source of most third-party analytics products). It is no longer sold. Existing enterprise customers were migrated to v2 Filtered Stream on Enterprise plans or to fully-custom data contracts.

v1.1 statuses/filter: shut down. This was the path most open-source Twitter clients and small data-collection projects used. Its retirement broke years of integrations and forced every downstream user to either migrate to v2 or stop streaming.

Account Activity API: retiring next. X's per-user webhook product is also on its way out: docs.x.com sets its end of life on February 28, 2027, and our Twitter Account Activity API guide maps each of its events to the X Activity API and to public-data alternatives.

Free streaming: gone. There is no free read tier; filtered stream is billed per post delivered from the first post, like every other v2 read.

03 — Section

What X Offers in 2026 — Filtered Stream v2

The surviving X streaming surface is Filtered Stream v2 — endpoint /2/tweets/search/stream with a rule-management endpoint at /2/tweets/search/stream/rules. The pattern is similar to v1 in spirit: you POST rules to define what you want, then GET the stream and receive matching posts in near-real-time.

Access: pay-per-use or Enterprise. Filtered Stream v2 is available on pay-per-use and Enterprise (docs.x.com/x-api/posts/filtered-stream/introduction). There is no subscription: each post delivered counts as a post read at $0.005, so a stream that delivers 100,000 posts a month costs $500 and one that delivers 1M costs $5,000.

The 3M cap applies. Pay-per-use is capped at 3,000,000 post reads per monthly billing cycle, and streamed posts count toward it. A high-velocity stream — even matching a moderately broad rule set — can exhaust that cap mid-month after $15,000 of reads (3M × $0.005); past it, X requires Enterprise, which has no public price.

Rule complexity is capped per access level. Pay-per-use allows 1,000 rules per project, each up to 1,024 characters, on a single connection; Enterprise allows 25,000+ rules of up to 2,048 characters and multiple connections. For a team that wants to monitor hundreds of brand keywords or competitor handles, the rule limit can bind before the cap does.

04 — Section

Why the Official Streaming Path Is Hard for Most Teams

The gap between "I want real-time X data" and "I am paying $0.005 for every streamed post, under a 1,000-rule limit and a 3M monthly cap" is what brings most teams to this page. Three failure modes are common.

Budget mismatch. A side project or early-stage startup with $50-300/month for data services can afford only 10,000-60,000 streamed posts a month on Filtered Stream v2 ($50 ÷ $0.005 = 10,000; $300 ÷ $0.005 = 60,000) — a single busy keyword rule can use that up quickly.

Workload mismatch. A medium-volume streaming workload — say monitoring 200 keywords for a brand-safety product — can blow past the 3M post-read cap mid-month. At the published $0.005 per post read, 3M streamed posts is $15,000 for the month, and anything above that needs an Enterprise contract with no public price, for what feels like "just streaming."

Rule mismatch. The 1,000-rule pay-per-use limit can constrain a real product before the cap does. A monitoring product that wants 5,000 active filter rules will find Filtered Stream v2 a poor fit short of Enterprise.

05 — Section

Real-Time Alternatives That Work — Webhooks, WebSockets, Polling

Most teams that hit the per-post cost or the cap end up moving real-time consumption off the official streaming endpoint and onto one of three alternative patterns. All three are supported by TwitterAPI.io, the third-party API this site documents.

Webhooks. You define a filter rule (a list of accounts, keywords, or both), provide a callback URL, and TwitterAPI.io POSTs matching posts to that URL as they happen. The rule infrastructure is /oapi/tweet_filter/add_rule, /oapi/tweet_filter/get_rules, /oapi/tweet_filter/update_rule, /oapi/tweet_filter/delete_rule — same rule definitions are reusable across webhook and websocket transport. Best fit for server-side ingestion that does its own routing.

WebSockets. The same rule infrastructure feeds a persistent websocket connection that streams matching posts to a long-lived client. Best fit for dashboards, browser-side live feeds, and any UI that shows posts as they are pushed. No monthly cap and no subscription required.

Polling pseudo-streaming. For workloads where 5-30 second latency is acceptable, polling /twitter/tweet/advanced_search in a loop with from:<handle> since_time:<unix seconds of the newest post seen> is operationally simpler than streaming — no long-lived connections to manage, no reconnect logic, no rule-state to maintain. Each poll returns only new posts, billed at the same flat rate ($0.15 per 1,000 tweets returned): a poll with nothing new returns 0 tweets and costs the 15-credit minimum ($0.00015), whereas a last_tweets poll bills every tweet on the page (about 20 tweets, so about $130 a month at 60 seconds). At a 30-second interval that is 86,400 polls a month, or $12.96 per account, plus $0.00015 per new post.

All three sit on the same usage-based billing — there is no monthly minimum and no 3M-read cliff into Enterprise. For teams that need real-time X data but can't pay $0.005 per streamed post, the webhook + websocket path is the practical answer.

06 — Section

Side-by-Side: Filtered Stream v2 vs TwitterAPI.io Webhook — Filtered Stream v2 (pay-per-use or Enterprise)

The code patterns are different but the work is the same — define a rule, receive matching posts. Here are minimal examples for both. The X v2 example assumes you have a bearer token from an X developer account with a saved payment card; the TwitterAPI.io example needs only an API key from a Google sign-in.

This is the X official path: post your rules with a separate API call, then open a long-running HTTP stream connection and process the JSON-lines as they arrive.

bash
# 1. Add a rule to your stream — POST a value + tag
curl -X POST 'https://api.twitter.com/2/tweets/search/stream/rules' \
  -H 'Authorization: Bearer $X_BEARER_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"add": [{"value": "from:openai", "tag": "openai-posts"}]}'

# 2. Open the stream — long-running HTTP GET
curl 'https://api.twitter.com/2/tweets/search/stream' \
  -H 'Authorization: Bearer $X_BEARER_TOKEN'
07 — Section

And via twitterapi.io — TwitterAPI.io webhook (no tier)

No tier upgrade required; configure the callback URL in the dashboard and start receiving posts.

bash
# 1. Register a rule + callback URL — one POST
curl -X POST 'https://api.twitterapi.io/oapi/tweet_filter/add_rule' \
  -H 'X-API-Key: $TWITTERAPI_IO_KEY' \
  -d 'tag=openai-posts&value=from:openai&interval_seconds=5'

# 2. Done — posts get POSTed to the callback URL you configured
#    in the TwitterAPI.io dashboard for that rule. No connection
#    to keep alive on your side.
08 — Section

Webhook vs streaming connection — operational tradeoff

The webhook pattern is conceptually simpler — you do not maintain a long-lived HTTP connection, you do not handle reconnect-on-disconnect, and you do not consume monthly cap room on idle time. The X stream pattern is what teams already running long-lived consumers prefer because it keeps state on the connection.

09 — Section

Choosing — A Quick Decision Tree

If you need streaming + can sustain $0.005 per streamed post ($5,000 per 1M) + can fit your rules in 1,000 per project + can stay under the 3M monthly cap → Filtered Stream v2 is the official path and works.

If you are budget-constrained or workload-spiky → TwitterAPI.io webhooks or websockets. No tier, no cap, ~$0.15 per 1,000 posts returned, same rule-management primitives.

If 5-30 second freshness is enough and you have a short list of target accounts → polling /twitter/tweet/advanced_search with from:<handle> since_time: in a loop. Operationally the simplest of the three, at the $0.00015 minimum per poll that finds nothing new.

If you need verified write access, ads metadata, or other official-only data → the official API is the path regardless. Streaming and writing are separable in your architecture; you can read via TwitterAPI.io and write via the official surface for the operations that require it.

python
import json
import os
import time
from datetime import datetime
import requests

API_KEY = os.environ["TWITTERAPI_IO_KEY"]
HEADERS = {"X-API-Key": API_KEY}

# Pattern 1 — register a webhook rule (server pushes posts to your callback)
# Webhook callback URL is configured in the dashboard for the rule, not in this call.
rule = requests.post(
    "https://api.twitterapi.io/oapi/tweet_filter/add_rule",
    headers=HEADERS,
    data={
        "tag": "openai-posts",
        "value": "from:openai OR @openai",  # standard advanced-search syntax
        "interval_seconds": 5,                # how often to flush matches
    },
    timeout=30,
)
rule.raise_for_status()
print("rule registered:", rule.json())

# Pattern 2 — list active rules (rule_id needed for update/delete)
list_rules = requests.get(
    "https://api.twitterapi.io/oapi/tweet_filter/get_rules",
    headers=HEADERS,
    timeout=30,
)
list_rules.raise_for_status()
for r in list_rules.json().get("rules", []):
    print(r["rule_id"], r["tag"], r["value"])

# Pattern 3 — polling pseudo-streaming when 5-30 second freshness is enough.
# Search only for posts newer than the last one seen: a poll with nothing new
# returns 0 tweets and is billed the 15-credit minimum ($0.00015).
def to_unix(created_at):
    # createdAt looks like "Tue Oct 13 16:42:56 +0000 2026"
    return int(datetime.strptime(created_at, "%a %b %d %H:%M:%S %z %Y").timestamp())


since_time = int(time.time())  # first run: start from now
while True:
    r = requests.get(
        "https://api.twitterapi.io/twitter/tweet/advanced_search",
        params={"query": f"from:openai since_time:{since_time}", "queryType": "Latest"},
        headers=HEADERS,
        timeout=30,
    )
    r.raise_for_status()
    tweets = r.json().get("tweets") or []
    for t in sorted(tweets, key=lambda t: to_unix(t["createdAt"])):
        print(t["createdAt"], "::", t["text"][:80])
    if tweets:
        # next since_time = one second after the newest post seen
        since_time = max(to_unix(t["createdAt"]) for t in tweets) + 1
    time.sleep(30)  # adjust to your latency tolerance vs cost target

Researching this?Free starter credits cover end-to-end testing — Google sign-in, no card. Get a key.

10 — Questions

Questions readers ask

Does X still have a Streaming API in 2026?

Yes — Filtered Stream v2, on pay-per-use or Enterprise. PowerTrack, Compliance Stream, and Filtered Stream v1 were all retired through the v1.1 retirement push 2023-2024. There is no free read tier; streamed posts bill at $0.005 each.

How much does Twitter Streaming API cost in 2026?

There is no subscription. Filtered Stream v2 bills each delivered post as a post read at $0.005, so 100,000 streamed posts cost $500 and 1M cost $5,000. Pay-per-use is capped at 3,000,000 post reads per monthly billing cycle ($15,000 at that rate); above that X requires Enterprise, which has no public price.

What replaced PowerTrack on Twitter / X?

Nothing replaced PowerTrack on the X official side — it was end-of-life'd as part of the broader v1.1 retirement. Existing enterprise customers were migrated to v2 Filtered Stream / Enterprise plans or to fully-custom data contracts. For new builders, the closest functional equivalent at non-enterprise budget is a third-party API offering webhooks or websockets without the official stream's per-post cost.

Can I stream tweets in real-time without paying $0.005 per post?

Yes — through a third-party API. TwitterAPI.io exposes webhooks (POST to a callback URL on each match) and websockets (persistent connection that pushes matching posts) on a flat pay-per-result rate of about $0.15 per 1,000 posts returned. No monthly minimum and no 3M-read monthly cap. Same rule-management primitives (/oapi/tweet_filter/add_rule, /oapi/tweet_filter/get_rules, etc.) feed both transports.

What's the difference between webhooks and websockets for Twitter streaming?

Webhooks push matching posts to a server-side HTTP callback you control — best for backend ingestion that does its own routing. WebSockets hold a persistent connection that streams posts to a long-lived client — best for browser-side dashboards or any UI that shows posts as they arrive. Both use the same rule definitions so you can write one rule and switch transports without rewriting the matching logic.

Is polling a real alternative to streaming?

For workloads where 5-30 second latency is acceptable, yes — and often the operationally simplest path. Polling avoids reconnect logic, long-lived connections, and rule-state maintenance. Poll a search for from:<handle> since_time:<newest post seen> rather than /twitter/user/last_tweets, so a poll with nothing new costs only the $0.00015 minimum. Polling stops being efficient when you want to watch many accounts in parallel; at that point switch to webhook or WebSocket delivery (filter-rule matches usually arrive within minutes), or to Twitter Stream account monitoring, where most tweets arrive within seconds.

Can I migrate from PowerTrack to a non-X streaming API?

Yes — most former PowerTrack workloads (broad keyword monitoring, brand mention tracking, news-feed ingestion) map cleanly onto a webhook + rule pattern. The migration steps are: enumerate your active PowerTrack rules → translate each to advanced-search syntax (most are direct ports — the operator vocabulary is shared) → POST each to /oapi/tweet_filter/add_rule with a callback URL → consume the callback. Volume budgeting is different (pay-per-result vs flat enterprise contract) but for most workloads the new cost is dramatically lower.

11 — Further reading

Continue

More from this series

Writing about something you built with TwitterAPI.io? Our community rewards program pays API credits for honest tutorials, build logs and videos.

Build it

Stop reading. Start building.

Starter credits cover real testing on real data. Google sign-in, no card, no application queue.

Get an API key

Already building with TwitterAPI.io? Publish an honest tutorial or build log about it and earn up to $200 a month in API credits.