News Sources API
getNewsSources
The getNewsSources API provides access to public news sources and your authorization status per source. Sources include Associated Press, Canadian Press, and Dow Jones.
View All APIsContact Us to Get Access
Inputs
strictoptional
Return only the authorized news sources.
Type
string (A sequence of characters. (example: GOOG))
Example
true
Default
true
Outputs
id
always returned
always returned
The Id of the news source.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
name
always returned
always returned
The name of the news source.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
permission
always returned
always returned
Your permission status for this news source.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
Status Code Responses
200
OK
Success
400
Bad Request
The request was invalid, please see the message for more information.
500
Internal Server Error
Something is not working correctly, please contact support.
JSON
GET
GET https://ondemand.websol.barchart.com/getNewsSources.json?apikey=YOUR_API_KEY&strict=true
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getNewsSources.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&strict=true
Response
{
"status": {
"code": 200,
"message": "Success."
},
"results": [
{
"id": "AGWEB",
"name": "AgWeb",
"permission": "true"
},
{
"id": "AP",
"name": "Associated Press",
"permission": "true"
},
{
"id": "APAI",
"name": "AP Automated Insights",
"permission": "true"
},
{
"id": "BCNEWS",
"name": "Barchart News",
"permission": "true"
},
{
"id": "BRUG",
"name": "Alan Brugler",
"permission": "true"
},
{
"id": "CMDTY_AG",
"name": "Market News",
"permission": "true"
},
{
"id": "CMDTY_AGLITE",
"name": "Market Reports",
"permission": "true"
},
{
"id": "CNW",
"name": "Canada Newswire",
"permission": "true"
},
{
"id": "COT",
"name": "Commitments of Traders",
"permission": "true"
},
{
"id": "CP",
"name": "Canadian Press",
"permission": "true"
},
{
"id": "HDLNE",
"name": "Headlines",
"permission": "true"
},
{
"id": "HDLNEG",
"name": "Headlines - Growth",
"permission": "true"
},
{
"id": "HDLNEP",
"name": "Headlines - Pro",
"permission": "true"
},
{
"id": "IF",
"name": "Barchart Contributors (IF)",
"permission": "true"
},
{
"id": "NASS",
"name": "USDA NASS Reports",
"permission": "true"
},
{
"id": "PRNW",
"name": "PR Newswire",
"permission": "true"
},
{
"id": "USDA",
"name": "USDA Reports",
"permission": "true"
}
]
}
XML
GET
GET https://ondemand.websol.barchart.com/getNewsSources.xml?apikey=YOUR_API_KEY&strict=true
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getNewsSources.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&strict=true
Response
<?xml version="1.0" encoding="utf-8"?>
<getNewsSources>
<status>
<code>200</code>
<message>Success.</message>
</status>
<item>
<id>AGWEB</id>
<name>AgWeb</name>
<permission>true</permission>
</item>
<item>
<id>AP</id>
<name>Associated Press</name>
<permission>true</permission>
</item>
<item>
<id>APAI</id>
<name>AP Automated Insights</name>
<permission>true</permission>
</item>
<item>
<id>BCNEWS</id>
<name>Barchart News</name>
<permission>true</permission>
</item>
<item>
<id>BRUG</id>
<name>Alan Brugler</name>
<permission>true</permission>
</item>
<item>
<id>CMDTY_AG</id>
<name>Market News</name>
<permission>true</permission>
</item>
<item>
<id>CMDTY_AGLITE</id>
<name>Market Reports</name>
<permission>true</permission>
</item>
<item>
<id>CNW</id>
<name>Canada Newswire</name>
<permission>true</permission>
</item>
<item>
<id>COT</id>
<name>Commitments of Traders</name>
<permission>true</permission>
</item>
<item>
<id>CP</id>
<name>Canadian Press</name>
<permission>true</permission>
</item>
<item>
<id>HDLNE</id>
<name>Headlines</name>
<permission>true</permission>
</item>
<item>
<id>HDLNEG</id>
<name>Headlines - Growth</name>
<permission>true</permission>
</item>
<item>
<id>HDLNEP</id>
<name>Headlines - Pro</name>
<permission>true</permission>
</item>
<item>
<id>IF</id>
<name>Barchart Contributors (IF)</name>
<permission>true</permission>
</item>
<item>
<id>NASS</id>
<name>USDA NASS Reports</name>
<permission>true</permission>
</item>
<item>
<id>PRNW</id>
<name>PR Newswire</name>
<permission>true</permission>
</item>
<item>
<id>USDA</id>
<name>USDA Reports</name>
<permission>true</permission>
</item>
</getNewsSources>
CSV
GET
GET https://ondemand.websol.barchart.com/getNewsSources.csv?apikey=YOUR_API_KEY&strict=true
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getNewsSources.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&strict=true
Response
id,name,permission
"AGWEB","AgWeb","true"
"AP","Associated Press","true"
"APAI","AP Automated Insights","true"
"BCNEWS","Barchart News","true"
"BRUG","Alan Brugler","true"
"CMDTY_AG","Market News","true"
"CMDTY_AGLITE","Market Reports","true"
"CNW","Canada Newswire","true"
"COT","Commitments of Traders","true"
"CP","Canadian Press","true"
"HDLNE","Headlines","true"
"HDLNEG","Headlines - Growth","true"
"HDLNEP","Headlines - Pro","true"
"IF","Barchart Contributors (IF)","true"
"NASS","USDA NASS Reports","true"
"PRNW","PR Newswire","true"
"USDA","USDA Reports","true"
PHP
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'strict' => 'true',
];
$result = $ondemand->getNewsSources($params);
var_dump($result);
Classic ASP
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.getNewsSources("YOUR_API_KEY", "true")
Perl
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getNewsSources('YOUR_API_KEY', 'true');
print $result;
Python
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getNewsSources('YOUR_API_KEY', 'true')
print(result)
Ruby
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getNewsSources,
message: {
apikey: 'YOUR_API_KEY',
strict: 'true',
}
)
response.body