Stream news headlines
subscribe_newsStream live news headlines for a specific instrument or an entire provider feed. Get a subscription handle to read headlines and fetch full stories, then cancel when done.
Instructions
Stream live news headlines for one instrument, or a provider's whole feed.
Give a contract for headlines about that instrument (from provider_code, or every
subscribed provider), or only a provider_code for that provider's broad tape (all
its headlines, e.g. BRF for Briefing Trader, BZ for Benzinga, FLY for The Fly;
each needs its own subscription). Returns a handle; read the headlines (oldest
first, the newest 200 kept) with get_subscription_data(subscription_id) and fetch
a full story with get_news_article. Uses one market data line. Stop it with
unsubscribe; it is cancelled after idle_ttl_s seconds without a read.
Errors: invalid_request without a contract or provider_code, or when a contract is
given with a provider the login is not subscribed to (see get_news_providers);
ib_api_error when IBKR refuses the stream (no news permission for that provider).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contract | No | The instrument whose headlines to stream (a con_id alone is unambiguous). Omit to stream a provider's whole feed instead. | |
| provider_code | No | Provider code. With a contract: only this provider's headlines (default: every subscribed provider). Without a contract: that provider's whole feed (broad tape), e.g. BRF, BZ or FLY. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | What it streams for: the contract id plus parameters. | |
| kind | Yes | What streams: quotes, depth, tick_by_tick, realtime_bars, bars, scanner, news_bulletins, news or display_group. | |
| contract | No | The instrument, when there is one. | |
| created_at | Yes | ||
| idle_ttl_s | Yes | Seconds without a read before it is cancelled. | |
| deduplicated | No | True when an identical stream was already open and its handle was returned instead of opening a second one. | |
| subscription_id | Yes | Handle for get_subscription_data and unsubscribe. |