Skip to navigation

News Articles

View as MarkdownOpen in Claude

Introduction

After requesting news headlines using one of the above functions, the body of a news article can be requested with the article ID returned by invoking the function EClient.reqNewsArticle. The body of the news article is returned to the function EWrapper.newsArticle.


Request News Articles

EClient.reqNewsArticle(requestId, providerCode, articleId, newsArticleOptions)

Requests news article body given articleId.

requestId
int

Id of the request.

providerCode
string

Short code indicating news provider, e.g. FLY.

articleId
string

Id of the specific article.

newsArticleOptions
List

Reserved for internal use. Should be defined as null.


self.reqNewsArticle(10002,"BRFG", "BRFG$04fb9da2", [])

Receive News Articles

EWrapper.newsArticle(requestId, articleType, articleText)

Called when receiving a News Article in response to reqNewsArticle().

requestId
int

Request identifier used to track data.

articleType
int

The type of news article (0 – plain text or html, 1 – binary data / pdf).

articleText
string

The body of article (if articleType == 1, the binary data is encoded using the Base64 scheme).


def newsArticle(self, requestId: int, articleType: int, articleText: str):
print("requestId: ", requestId, "articleType: ", articleType, "articleText: ", articleText)