News API
getNews
The getNews API returns news headlines, articles and related photos based upon news sources, category, sub-category and/or keyword. With this API you can access breaking news, company press releases and global financial market coverage. News sources include Associated Press, Canadian Press, PR Newswire, Business Wire, and Dow Jones.
View All APIssourcesoptional
The news feed code.
AP,IF
symbolsoptional
A symbol or code that identifies a financial instrument.
AMZN,GOOG,AAPL
categoryoptional
A grouping of related news content.
stocks
subCategoryoptional
A more specific category of related news content.
tech
seriesoptional
A grouping of stories under a recurring news topic. e.g. Morning Call (MORNCALL).
MORNCALL
keywordoptional
A term used to create searches.
tablet
maxRecordsoptional
The maximum number of records to show in the return.
10
startDateoptional
The beginning date for the query.
2021-01-24T19:47:22
displayTyperequired
The type of new displayed: headlines only, headline and preview, or full.
preview
imagesoptional
An option for returning the images contained in the news article.
true
storyIdoptional
Parameter allows to get specific story by providing newsID. Parameters: sources, symbols, category, subCategory, keyword, maxRecords, startDate will be ignored.
259220
rssoptional
Parameter formats XML requests as RSS feeds. This parameter has no effect on JSON or CSV requests.
false
rssTitleoptional
Parameter overrides the default RSS feed title and description.
fieldsoptional
The additional fields requested.
publishDate
barchartClassificationoptional
always returned
A numeric type defining a whole number. (example: 2)
always returned
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
always returned
A sequence of characters. (example: GOOG)
always returned
A comma or semi-colon delimited string.
always returned
A comma or semi-colon delimited string.
always returned
A sequence of characters. (example: GOOG)
always returned
A logical type representing the truth of a value as 'true' or 'false'.
as requested
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
as requested
A numeric type defining a whole number. (example: 2)
as requested
A numeric type defining a whole number. (example: 2)
as requested
A sequence of characters. (example: GOOG)
as requested
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
as requested
A sequence of characters. (example: GOOG)
as requested
A numeric type defining a whole number. (example: 2)
as requested
A numeric type defining a whole number. (example: 2)
GET
GET https://ondemand.websol.barchart.com/getNews.json?apikey=YOUR_API_KEY&sources=AP%2CIF&symbols=AMZN%2CGOOG%2CAAPL&category=stocks&subCategory=tech&series=MORNCALL&keyword=tablet&maxRecords=10&startDate=2021-01-24T19%3A47%3A22&displayType=preview&images=true&storyId=259220&rss=false&fields=publishDate
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getNews.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&sources=AP%2CIF&symbols=AMZN%2CGOOG%2CAAPL&category=stocks&subCategory=tech&series=MORNCALL&keyword=tablet&maxRecords=10&startDate=2021-01-24T19%3A47%3A22&displayType=preview&images=true&storyId=259220&rss=false&fields=publishDate
Response
{
"status": {
"code": 200,
"message": "Success."
},
"results": [
{
"newsID": 259220,
"timestamp": "2020-09-14T21:10:00-05:00",
"source": "CMTX",
"categories": [
"stocks"
],
"subCategories": [
"corporate",
"consprod",
"tech"
],
"headline": "Mitsubishi Electric Wins Trademark Infringement Lawsuit Against Factory-automation Product Counterfeiters in China",
"isExternal": false,
"publishDate": "2020-09-14T21:10:00-05:00",
"imageURL": null,
"imageCaption": null,
"imageHeight": null,
"imageWidth": null,
"preview": "Mitsubishi Electric Corporation (TOKYO:6503) announced today that the Guangzhou Intellectual Property Court has upheld an earlier ruling in Mitsubishi Electric's favor regarding infringement of the company's trademarks by Guangzhou Lingye Automation Equipment, Guangzhou Longyan Automation Technology, Guangzhou Ouye Automation Technology and their owners located in Guangzhou, Guangdong Province, China.",
"headlineURL": null,
"pdfURL": null
}
]
}
GET
GET https://ondemand.websol.barchart.com/getNews.xml?apikey=YOUR_API_KEY&sources=AP%2CIF&symbols=AMZN%2CGOOG%2CAAPL&category=stocks&subCategory=tech&series=MORNCALL&keyword=tablet&maxRecords=10&startDate=2021-01-24T19%3A47%3A22&displayType=preview&images=true&storyId=259220&rss=false&fields=publishDate
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getNews.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&sources=AP%2CIF&symbols=AMZN%2CGOOG%2CAAPL&category=stocks&subCategory=tech&series=MORNCALL&keyword=tablet&maxRecords=10&startDate=2021-01-24T19%3A47%3A22&displayType=preview&images=true&storyId=259220&rss=false&fields=publishDate
Response
<?xml version="1.0" encoding="utf-8"?>
<getNews>
<status>
<code>200</code>
<message>Success.</message>
</status>
<item>
<newsID>259220</newsID>
<timestamp>2020-09-14T21:10:00-05:00</timestamp>
<source>CMTX</source>
<categories>
<category>stocks</category>
</categories>
<subCategories>
<subCategory>corporate</subCategory>
<subCategory>consprod</subCategory>
<subCategory>tech</subCategory>
</subCategories>
<headline>Mitsubishi Electric Wins Trademark Infringement Lawsuit Against Factory-automation Product Counterfeiters in China</headline>
<isExternal></isExternal>
<publishDate>2020-09-14T21:10:00-05:00</publishDate>
<imageURL></imageURL>
<imageCaption></imageCaption>
<imageHeight></imageHeight>
<imageWidth></imageWidth>
<preview>Mitsubishi Electric Corporation (TOKYO:6503) announced today that the Guangzhou Intellectual Property Court has upheld an earlier ruling in Mitsubishi Electric's favor regarding infringement of the company's trademarks by Guangzhou Lingye Automation Equipment, Guangzhou Longyan Automation Technology, Guangzhou Ouye Automation Technology and their owners located in Guangzhou, Guangdong Province, China.</preview>
<headlineURL></headlineURL>
<pdfURL></pdfURL>
</item>
</getNews>
GET
GET https://ondemand.websol.barchart.com/getNews.csv?apikey=YOUR_API_KEY&sources=AP%2CIF&symbols=AMZN%2CGOOG%2CAAPL&category=stocks&subCategory=tech&series=MORNCALL&keyword=tablet&maxRecords=10&startDate=2021-01-24T19%3A47%3A22&displayType=preview&images=true&storyId=259220&rss=false&fields=publishDate
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getNews.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&sources=AP%2CIF&symbols=AMZN%2CGOOG%2CAAPL&category=stocks&subCategory=tech&series=MORNCALL&keyword=tablet&maxRecords=10&startDate=2021-01-24T19%3A47%3A22&displayType=preview&images=true&storyId=259220&rss=false&fields=publishDate
Response
newsID,timestamp,source,1,2,headline,isExternal,publishDate,imageURL,imageCaption,imageHeight,imageWidth,preview,headlineURL,pdfURL
"259220","2020-09-14T21:10:00-05:00","CMTX","stocks","corporate","consprod","tech","Mitsubishi Electric Wins Trademark Infringement Lawsuit Against Factory-automation Product Counterfeiters in China","","2020-09-14T21:10:00-05:00","","","","","Mitsubishi Electric Corporation (TOKYO:6503) announced today that the Guangzhou Intellectual Property Court has upheld an earlier ruling in Mitsubishi Electric's favor regarding infringement of the company's trademarks by Guangzhou Lingye Automation Equipment, Guangzhou Longyan Automation Technology, Guangzhou Ouye Automation Technology and their owners located in Guangzhou, Guangdong Province, China.","",""
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'sources' => 'AP,IF',
'symbols' => 'AMZN,GOOG,AAPL',
'category' => 'stocks',
'subCategory' => 'tech',
'series' => 'MORNCALL',
'keyword' => 'tablet',
'maxRecords' => '10',
'startDate' => '2021-01-24T19:47:22',
'displayType' => 'preview',
'images' => 'true',
'storyId' => '259220',
'rss' => 'false',
'fields' => 'publishDate',
];
$result = $ondemand->getNews($params);
var_dump($result);
Dim ondemand
Dim result
Set ondemand = Server.CreateObject("MSSOAP.SoapClient30")
ondemand.ClientProperty("ServerHTTPRequest") = True
ondemand.MSSoapInit("https://ondemand.websol.barchart.com/service?wsdl")
Set result = ondemand.getNews("YOUR_API_KEY", "AP,IF", "AMZN,GOOG,AAPL", "stocks", "tech", "MORNCALL", "tablet", "10", "2021-01-24T19:47:22", "preview", "true", "259220", "false", "publishDate")
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getNews('YOUR_API_KEY', 'AP,IF', 'AMZN,GOOG,AAPL', 'stocks', 'tech', 'MORNCALL', 'tablet', '10', '2021-01-24T19:47:22', 'preview', 'true', '259220', 'false', 'publishDate');
print $result;
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = client.service.getNews('YOUR_API_KEY', 'AP,IF', 'AMZN,GOOG,AAPL', 'stocks', 'tech', 'MORNCALL', 'tablet', '10', '2021-01-24T19:47:22', 'preview', 'true', '259220', 'false', 'publishDate')
print result
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getNews,
message: {
apikey: 'YOUR_API_KEY',
sources: 'AP,IF',
symbols: 'AMZN,GOOG,AAPL',
category: 'stocks',
subCategory: 'tech',
series: 'MORNCALL',
keyword: 'tablet',
maxRecords: '10',
startDate: '2021-01-24T19:47:22',
displayType: 'preview',
images: 'true',
storyId: '259220',
rss: 'false',
fields: 'publishDate',
}
)
response.body