Newsfeed & Why is it Moving v2 API Reference
This REST API returns structured data for news.
Best Practices
For optimal performance, we have a few recommendations.
Limit query, improve performance
Limiting the scope of the query will directly improve the latency of the API. This can be accomplished by using parameters such as tickers
, date
, and channels
, or (preferably) by using updatedSince
for deltas.
Using Deltas
A common pattern is to use a delta to query for the latest change in a dataset. By reducing the amount of data available in the query, it will produce results with the least amount of latency and limited data an application will have to traverse.
In our case, we recommend tracking and querying by the latest updated timestamp.
One caveat to allow for some latency and second-only timestamps: when querying, set updatedSince
to a value 5 seconds earlier than you actually want. A query may look like:
/news?updatedSince=LAGGED_TIMESTAMP
Where LAGGED_TIMESTAMP
is set to be five seconds less than the maximum value of the updated
field (converted to a Unix timestamp) in rows already pulled from our API.
API Endpoint
https://api.benzinga.com/api/v2
Schemes
https, http
Version
2.0.0
Authentication
token
authentication
apiKey to be passed as token in query parameter.
- Type:
- apiKey
- Name:
- token
- In:
- query
Playground
Endpoints
GET /news
Get the news items
Parameters
Name | Type | Location | Description |
---|---|---|---|
accept | string , x ∈ { application/json (default) , application/xml (deprecated) } | header | Specify return format. |
page | integer | query | Page offset. For optimization, performance and technical reasons, page offsets are limited from 0 - 100000. Limit the query results by other parameters such as date. |
pageSize | integer 15 | query | Number of results returned. |
displayOutput | string , x ∈ { full , abstract , headline (default) } | query | Specify headline only (headline), headline + teaser (abstract), or headline + full body (full) text |
date | string (yyyy-mm-dd) | query | The date to query for news. Shorthand for date_from and date_to if they are the same |
dateFrom | string (yyyy-mm-dd) | query | Date to query from point in time. Sorted by published date |
dateTo | string (yyyy-mm-dd) | query | Date to query to point in time. Sorted by published date |
updatedSince | integer (int64) | query | The last updated Unix timestamp (UTC) to pull and sort by |
publishedSince | integer (Unix timestamp) | query | The last published Unix timestamp (UTC) to pull and sort by |
sort | string (field, field:direction) , x ∈ { id:asc , id:desc , created:asc , created:desc , updated:asc , updated:desc } | query | Allows control of results sorting. Default is updated, DESC. (updated:desc) Sort Fields
Sort Order Direction
|
isin | string (csv) | query | One or more ISINs separated by a comma. Maximum 50. |
cusip | string (csv) | query | One or more CUSIPs separated by a comma. Maximum 50. License agreement required. |
tickers | string (csv) | query | One or more ticker symbols separated by a comma. Maximum 50. |
channels | string (csv) | query | One or more channel names or IDs separated by a comma |
topics | string (csv) | query | One or more words/phrases separated by a comma; searches Title, Tags, and Body in order of priority. |
authors | string (csv) | query | One or more authors separated by a comma |
content_types | string (csv) | query | One or more content types separated by a comma |
Responses
Code | Model | Description |
---|---|---|
200 OK | BenzingaStory | success |
Response (200 OK)
[
{
"id": "integer",
"author": "string",
"created": "string (Wed, 17 May 2017 14:20:15 -0400)",
"title": "string",
"teaser": "string",
"body": "string",
"url": "string",
"image": [
{
"size": "string",
"url": "string"
}
],
"channels": [
{
"name": "string"
}
],
"stocks": [
{
"name": "string"
}
],
"tags": [
{
"name": "string"
}
]
}
]
GET /news-removed
Returns the removed news data
Parameters
Name | Type | Location | Description |
---|---|---|---|
accept | string , x ∈ { application/json (default) } | header | Specifies return format. Query parameters work the same for both formats. |
page | integer | query | Page offset. For optimization, performance and technical reasons, page offsets are limited from 0 - 100000. Limit the query results by other parameters such as date. |
pageSize | integer 15 | query | Number of results returned. |
updated | integer (int64) | query | The last updated Unix timestamp (UTC) to pull and sort by |
Responses
Code | Model | Description |
---|---|---|
200 OK | success |
Response (200 OK)
{
"removed": [
{
"id": "integer"
}
]
}
Models
BenzingaStory: object
Property | Type | Description |
---|---|---|
id | integer | The unique identifier of the article. This identifier is also found in the path of url on benzinga.com. |
author | string | The author of the article. This could be a Benzinga journalist, news desk analyst or contributor on benzinga.com. |
created | string (Wed, 17 May 2017 14:20:15 -0400) | The moment the article is created. The time zone is Greenwich Mean Time (GMT) - 4:00, commonly know as Eastern Daylight Time (EDT). This time stamp will not change. The date format standard used is RFC 2822 / RFC 1123. |
updated | object | - |
title | string | The headline of the article. This will only be plain text. |
teaser | string | Depending on where the content is originated from (Benzinga.com or Benzinga Pro Terminal) the teaser functions in different ways. If the article is a full length article from Benzinga.com, where the body field is filled out, this will be the first sentence of the article up to 256 characters. If this is a Benzinga Pro headline, this will function like the body of an article and provide additional context to the headline, usually no more than a few paragraphs. This field can contain html and html encoded characters such as '&quot' etc. |
body | string | The article content. This field can contain html and html encoded characters such as 'quot' etc. |
url | string | The url where the article lives on Benzinga.com. If this is a pro headline, it will take the user to a shortened headline with a paywall to purchase the Benzinga Pro terminal, so use with caution. |
image | object[] | The featured image related to the article, if applicable. Benzinga Pro headlines will not contain a featured image. |
image[].size | string | - |
image[].url | string | - |
channels | object[] | The topic(s) or categories that relate to the article. Channels can have sub-channels, but they will all be listed as their own item and not as a sub-level of the array. For Why is it Moving (WIIM) data, enter |
channels[].name | string | - |
stocks | object[] | The stock symbols that are listed within the article body. This will not display competitor symbols unless they are specifically referenced in the article. |
stocks[].name | string | - |
tags | object[] | Additional tags that are not channels or categories, but are reoccuring themes including, but not limited to; analyst names, bills being talked about in Congress (Dodd-Frank), specific products (iPhone), politicians, celebrities, stock movements (i.e. 'Mid-day Losers' & 'Mid-day Gainers'). |
tags[].name | string | - |
Structure (JSON)
{
"id": "integer",
"author": "string",
"created": "string (Wed, 17 May 2017 14:20:15 -0400)",
"title": "string",
"teaser": "string",
"body": "string",
"url": "string",
"image": [
{
"size": "string",
"url": "string"
}
],
"channels": [
{
"name": "string"
}
],
"stocks": [
{
"name": "string"
}
],
"tags": [
{
"name": "string"
}
]
}
news-removed: object
Property | Type | Description |
---|---|---|
id | integer | id of removed news content |
updated | object | - |
Structure (JSON)
{
"id": "integer"
}
updated: string (Wed, 17 May 2017 14:20:15 -0400)
The timestamp of the last update to the article. The time zone is Greenwich Mean Time (GMT) - 4:00, commonly know as Eastern Daylight Time (EDT). This time stamp has the ability to change one or many times, updating each time an update is pushed to the article. The date format standard used is RFC 2822 / RFC 1123.
Structure (JSON)
"string (Wed, 17 May 2017 14:20:15 -0400)"