> This page is for TWS API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://ibkrcampus.com/docs/llms.txt.

# Contract Specific News

## Introduction

**Important:** in order to obtain news feeds via the TWS API you need to acquire the relevant API-specific subscriptions via your Account Management.

News articles provided through the API may not correspond to what is available directly through the Trader Workstation. Off-platform distribution of data is at the discretion of the news source provider, not by Interactive Brokers.

When invoking `EClient.reqMktData`, for a specific Contract you will follow the same format convention as any other basic contracts. The News Source is identified by the `genericTickList` argument.

**Note:** The error message "invalid tick type" will be returned if the username has not added the appropriate API news subscription.

**Note:** For Briefing Trader live headlines via the API is only offered on a case-by-case basis directly from Briefing.com offers Briefing Trader subscribers access to the subscription live headlines via the API. For more information and to submit an API entitlement application, please contact Briefing.com directly at [dbeasley@briefing.com](mailto:dbeasley@briefing.com).

---

## Request Contract Specific News

`EClient.reqMktData(reqId, contract, genericTickList, snapshot, regulatorySnapshot, mktDataOptions)`

Used to request market data typically, but can also be used to retrieve news. "mdoff" can be specified to disable standard market data while retrieving news. For news sources, genericTick 292 needs to be specified followed by a colon and the news provider's code.

**`reqId`** `int`

Request identifier for tracking data.

---

**`contract`** `Contract`

Contract object used for specifying an instrument.

---

**`genericTickList`** `string`

Comma separated ids of the available generic ticks.

---

**`snapshot`** `bool`

Always set to false for news data.

---

**`regulatorySnapshot`** `bool`

Always set to false for news data.

---

**`mktDataOptions`** `List<TagValue>`

Internal use only.

---

\


#### Python

```python
self.reqMktData(reqId, contract, "mdoff,292:BRFG", False, False, [])
```

#### Java

```java
client.reqMktData(reqId, contract, "mdoff,292:BRFG", false, false, null);
```

#### C++

```cpp
m_pClient->reqMktData(reqId, contract, "mdoff,292:BRFG", false, false, TagValueListSPtr());
```

#### C\#

```csharp
client.reqMktData(reqId, contract, "mdoff,292:BRFG", false, false, null);
```

#### VB.NET

```vbnet
client.reqMktData(reqId, contract, "mdoff,292:BRFG", False, False, Nothing)
```

---

## Request BroadTape News

For BroadTape News you specify the contract for the specific news source. This is uniquely identified by the symbol and exchange. The symbol of an instrument can easily be obtained via the `EClient.reqContractDetails` request.

The symbol is typically the provider code, a colon, then the news provider codes appended with "\_ALL".

#### Python

```python
contract = Contract()
contract.symbol  = "BRF:BRF_ALL"
contract.secType = "NEWS"
contract.exchange = "BRF"
```

#### Java

```java
Contract contract = new Contract();
contract.symbol("BRF:BRF_ALL");
contract.secType("NEWS");
contract.exchange("BRF"); 
```

#### C++

```cpp
Contract contract;
contract.symbol = "BRF:BRF_ALL"; 
contract.secType = "NEWS";
contract.exchange = "BRF";
```

#### C\#

```csharp
Contract contract = new Contract();
contract.Symbol = "BRF:BRF_ALL";
contract.SecType = "NEWS";
contract.Exchange = "BRF";
```

#### VB.NET

```vbnet
Dim contract As Contract = New Contract()
contract.Symbol = "BRF:BRF_ALL"
contract.SecType = "NEWS"
contract.Exchange = "BRF"
```

Then request market data using "mdoff,292":

#### Python

```python
self.reqMktData(reqId, contract, "mdoff,292", False, False, [])
```

#### Java

```java
client.reqMktData(reqId, contract, "mdoff,292", false, false, null);
```

#### C++

```cpp
m_pClient->reqMktData(reqId, contract, "mdoff,292", false, false, TagValueListSPtr());
```

#### C\#

```csharp
client.reqMktData(reqId, contract, "mdoff,292", false, false, null);
```

#### VB.NET

```vbnet
client.reqMktData(reqId, contract, "mdoff,292", False, False, Nothing)
```

---

## Receive Live News Headlines

`EWrapper.tickNews(tickerId, timeStamp, providerCode, articleId, headline, extraData)`

Returns news headlines for requested contracts.

**`tickerId`** `int`

Request identifier used to track data.

---

**`timeStamp`** `int`

Epoch time of the article's published time.

---

**`providerCode`** `string`

News provider code based on requested data.

---

**`articleId`** `string`

Identifier used to track the particular article.

---

**`headline`** `string`

Headline of the provided news article.

---

**`extraData`** `string`

Returns any additional data available about the article.

---

\


#### Python

```python
def tickNews(self, tickerId: int, timeStamp: int, providerCode: str, articleId: str, headline: str, extraData: str):
  print("TickNews. TickerId:", tickerId, "TimeStamp:", timeStamp, "ProviderCode:", providerCode, "ArticleId:", articleId, "Headline:", headline, "ExtraData:", extraData)
```

#### Java

```java
@Override
public void tickNews(int tickerId, long timeStamp, String providerCode, String articleId, String headline, String extraData) {
	System.out.println(EWrapperMsgGenerator.tickNews(tickerId, timeStamp, providerCode, articleId, headline, extraData));
}
```

#### C++

```cpp
void TestCppClient::tickNews(int tickerId, time_t timeStamp, const std::string& providerCode, const std::string& articleId, const std::string& headline, const std::string& extraData) {
    printf("News Tick. TickerId: %d, TimeStamp: %s, ProviderCode: %s, ArticleId: %s, Headline: %s, ExtraData: %s\n", tickerId, ctime(&(timeStamp /= 1000)), providerCode.c_str(), articleId.c_str(), headline.c_str(), extraData.c_str());
}
```

#### C\#

```csharp
public void tickNews(int tickerId, long timeStamp, string providerCode, string articleId, string headline, string extraData)
{
	Console.WriteLine("Tick News. Ticker Id: {0}, Time Stamp: {1}, Provider Code: {2}, Article Id: {3}, headline: {4}, extraData: {5}", tickerId, Util.LongMaxString(timeStamp), providerCode, articleId, headline, extraData);
}
```

#### VB.NET

```vbnet
Public Sub tickNews(tickerId As Integer, timeStamp As Long, providerCode As String, articleId As String, headline As String, extraData As String) Implements IBApi.EWrapper.tickNews
	Console.WriteLine("Tick News. Ticker Id: " & tickerId & ", Time Stamp: " & Util.LongMaxString(timeStamp) & ", Provider Code: " & providerCode & ", Article Id: " & articleId & ", Headline: " & headline & ", Extra Data: " & extraData)
End Sub
```