getNewsSources API

The getNewsSources API provides access to public news sources and your authorization status per source.

All APIs

Contact Us to Get Access

Inputs

strict optional

Return only the authorized news sources.

Type
string (A sequence of characters. (example: GOOG)) 
Example
true 
Default
false 

Outputs

Name / Requirement
Description
Type
id
always returned
The Id of the news source.
string
A sequence of characters. (example: GOOG)
name
always returned
The name of the news source.
string
A sequence of characters. (example: GOOG)
permission
always returned
Your permission status for this news source.
string
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": "AGFAX",
            "name": "AgFax",
            "permission": "true"
        },
        {
            "id": "AP",
            "name": "Associated Press",
            "permission": "true"
        },
        {
            "id": "BC",
            "name": "Barchart.com - Chart of the Day",
            "permission": "true"
        },
        {
            "id": "BRUG",
            "name": "Ag Market Commentary",
            "permission": "true"
        },
        {
            "id": "CMTX",
            "name": "Comtex",
            "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": "CPF",
            "name": "Presse Canadienne",
            "permission": "true"
        },
        {
            "id": "CRB",
            "name": "Commodity Research Bureau",
            "permission": "true"
        },
        {
            "id": "DJ",
            "name": "Dow Jones",
            "permission": "true"
        },
        {
            "id": "DLFRX",
            "name": "Daily Forex",
            "permission": "true"
        },
        {
            "id": "DVND",
            "name": "Dividend Channel",
            "permission": "true"
        },
        {
            "id": "ESTMZ",
            "name": "Estimize",
            "permission": "true"
        },
        {
            "id": "GLDRPT",
            "name": "The Gold Report",
            "permission": "true"
        },
        {
            "id": "IF",
            "name": "InsideFutures",
            "permission": "true"
        },
        {
            "id": "LME-COT",
            "name": "LME Commitments of Traders",
            "permission": "true"
        },
        {
            "id": "LME-WHS",
            "name": "LME Warehouse company stocks and queue data",
            "permission": "true"
        },
        {
            "id": "NASS",
            "name": "USDA NASS Reports",
            "permission": "true"
        },
        {
            "id": "PRNW",
            "name": "PR Newswire",
            "permission": "true"
        },
        {
            "id": "SETZ",
            "name": "Karl Setzer Grain Commentary",
            "permission": "true"
        },
        {
            "id": "SPC",
            "name": "Stewart-Peterson Market Commentary",
            "permission": "true"
        },
        {
            "id": "STPE",
            "name": "Stewart-Peterson Market Commentary",
            "permission": "true"
        },
        {
            "id": "USDA",
            "name": "USDA Market News",
            "permission": "true"
        },
        {
            "id": "ZACKS",
            "name": "Zacks Investment Research",
            "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>AGFAX</id>
   <name>AgFax</name>
   <permission>true</permission>
  </item>
  <item>
   <id>AP</id>
   <name>Associated Press</name>
   <permission>true</permission>
  </item>
  <item>
   <id>BC</id>
   <name>Barchart.com - Chart of the Day</name>
   <permission>true</permission>
  </item>
  <item>
   <id>BRUG</id>
   <name>Ag Market Commentary</name>
   <permission>true</permission>
  </item>
  <item>
   <id>CMTX</id>
   <name>Comtex</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>CPF</id>
   <name>Presse Canadienne</name>
   <permission>true</permission>
  </item>
  <item>
   <id>CRB</id>
   <name>Commodity Research Bureau</name>
   <permission>true</permission>
  </item>
  <item>
   <id>DJ</id>
   <name>Dow Jones</name>
   <permission>true</permission>
  </item>
  <item>
   <id>DLFRX</id>
   <name>Daily Forex</name>
   <permission>true</permission>
  </item>
  <item>
   <id>DVND</id>
   <name>Dividend Channel</name>
   <permission>true</permission>
  </item>
  <item>
   <id>ESTMZ</id>
   <name>Estimize</name>
   <permission>true</permission>
  </item>
  <item>
   <id>GLDRPT</id>
   <name>The Gold Report</name>
   <permission>true</permission>
  </item>
  <item>
   <id>IF</id>
   <name>InsideFutures</name>
   <permission>true</permission>
  </item>
  <item>
   <id>LME-COT</id>
   <name>LME Commitments of Traders</name>
   <permission>true</permission>
  </item>
  <item>
   <id>LME-WHS</id>
   <name>LME Warehouse company stocks and queue data</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>SETZ</id>
   <name>Karl Setzer Grain Commentary</name>
   <permission>true</permission>
  </item>
  <item>
   <id>SPC</id>
   <name>Stewart-Peterson Market Commentary</name>
   <permission>true</permission>
  </item>
  <item>
   <id>STPE</id>
   <name>Stewart-Peterson Market Commentary</name>
   <permission>true</permission>
  </item>
  <item>
   <id>USDA</id>
   <name>USDA Market News</name>
   <permission>true</permission>
  </item>
  <item>
   <id>ZACKS</id>
   <name>Zacks Investment Research</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
"AGFAX","AgFax","true"
"AP","Associated Press","true"
"BC","Barchart.com - Chart of the Day","true"
"BRUG","Ag Market Commentary","true"
"CMTX","Comtex","true"
"CNW","Canada Newswire","true"
"COT","Commitments of Traders","true"
"CP","Canadian Press","true"
"CPF","Presse Canadienne","true"
"CRB","Commodity Research Bureau","true"
"DJ","Dow Jones","true"
"DLFRX","Daily Forex","true"
"DVND","Dividend Channel","true"
"ESTMZ","Estimize","true"
"GLDRPT","The Gold Report","true"
"IF","InsideFutures","true"
"LME-COT","LME Commitments of Traders","true"
"LME-WHS","LME Warehouse company stocks and queue data","true"
"NASS","USDA NASS Reports","true"
"PRNW","PR Newswire","true"
"SETZ","Karl Setzer Grain Commentary","true"
"SPC","Stewart-Peterson Market Commentary","true"
"STPE","Stewart-Peterson Market Commentary","true"
"USDA","USDA Market News","true"
"ZACKS","Zacks Investment Research","true"


PHP

<?php

$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');

$params = [
    '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("true")

Perl

use SOAP::Lite;
use SOAP::WSDL;

my $ondemand = SOAP::Lite
    -> service('https://ondemand.websol.barchart.com/service?wsdl');

my $result = $ondemand->getNewsSources('true');

print $result;

Python

from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')

result = client.service.getNewsSources('true')

print result

Ruby

require 'savon'

ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')

response = ondemand.call(
    :getNewsSources,
    message: {
        strict: 'true',
    }
)

response.body