Stock Competitors API
getCompetitorsThe getCompetitors API provides a list of related stock symbols (competitors) for an underlying stock input. Users can return the competitors symbol, name, exchange, marketCap and fifty-two week high and low.
View All APIsContact Us to Get Access
Inputs
symbolrequired
A symbol or code that identifies a financial instrument.
Type
string (A sequence of characters. (example: GOOG))
Example
AAPLfieldsoptional
The fields requested.
Type
list (A comma or semi-colon delimited string.)
Example
fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDatemaxRecordsoptional
The maximum number of records to show in the return.
Type
int (A numeric type defining a whole number. (example: 2))
Example
10Default
10
excludePriceAndVolumeFilteroptional
Pass this boolean parameter if you would like the API to exclude filter on volume and last price.
Type
boolean (A logical type representing the truth of a value as 'true' or 'false'.)
Example
trueOutputs
symbol
always returned
always returned
A symbol or code that identifies a financial instrument.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
name
always returned
always returned
The full name of the instrument.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
exchange
Exchange code for the marketplace where the financial instruments are listed.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
marketCap
always returned
always returned
The quantity of shares or contracts traded.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
fiftyTwoWkHigh
The highest price over the past 52 weeks.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
fiftyTwoWkHighDate
The date in which the high price was reached over the past 52 weeks.
date
A date in the format of YYYY-MM-DD.
A date in the format of YYYY-MM-DD.
fiftyTwoWkLow
The low price over the past 52 weeks.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
fiftyTwoWkLowDate
The date in which the low price was reached over the past 52 weeks.
date
A date in the format of YYYY-MM-DD.
A date in the format of YYYY-MM-DD.
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/getCompetitors.json?apikey=YOUR_API_KEY&symbol=AAPL&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&maxRecords=10&excludePriceAndVolumeFilter=true
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCompetitors.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbol=AAPL&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&maxRecords=10&excludePriceAndVolumeFilter=true
Response
{
"status": {
"code": 200,
"message": "Success."
},
"results": [
{
"symbol": "DELL",
"name": "Dell Technologies Inc",
"marketCap": 90057656250,
"fiftyTwoWkHigh": 168.08,
"fiftyTwoWkHighDate": "2025-11-03",
"fiftyTwoWkLow": 66.25,
"fiftyTwoWkLowDate": "2025-04-07"
},
{
"symbol": "HPQ",
"name": "HP Inc",
"marketCap": 23348849609,
"fiftyTwoWkHigh": 39.79,
"fiftyTwoWkHighDate": "2024-11-25",
"fiftyTwoWkLow": 21.21,
"fiftyTwoWkLowDate": "2025-04-09"
},
{
"symbol": "LNVGY",
"name": "Lenovo Group Ltd ADR",
"marketCap": 17130839844,
"fiftyTwoWkHigh": 35.09,
"fiftyTwoWkHighDate": "2025-02-21",
"fiftyTwoWkLow": 17.84,
"fiftyTwoWkLowDate": "2025-04-09"
},
{
"symbol": "OSS",
"name": "One Stop Systems Inc",
"marketCap": 126500000,
"fiftyTwoWkHigh": 7.2,
"fiftyTwoWkHighDate": "2025-09-19",
"fiftyTwoWkLow": 1.85,
"fiftyTwoWkLowDate": "2025-04-07"
}
]
}
XML
GET
GET https://ondemand.websol.barchart.com/getCompetitors.xml?apikey=YOUR_API_KEY&symbol=AAPL&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&maxRecords=10&excludePriceAndVolumeFilter=true
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCompetitors.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbol=AAPL&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&maxRecords=10&excludePriceAndVolumeFilter=true
Response
<?xml version="1.0" encoding="utf-8"?>
<getCompetitors>
<status>
<code>200</code>
<message>Success.</message>
</status>
<item>
<symbol>DELL</symbol>
<name>Dell Technologies Inc</name>
<marketCap>90057656250</marketCap>
<fiftyTwoWkHigh>168.08</fiftyTwoWkHigh>
<fiftyTwoWkHighDate>2025-11-03</fiftyTwoWkHighDate>
<fiftyTwoWkLow>66.25</fiftyTwoWkLow>
<fiftyTwoWkLowDate>2025-04-07</fiftyTwoWkLowDate>
</item>
<item>
<symbol>HPQ</symbol>
<name>HP Inc</name>
<marketCap>23348849609</marketCap>
<fiftyTwoWkHigh>39.79</fiftyTwoWkHigh>
<fiftyTwoWkHighDate>2024-11-25</fiftyTwoWkHighDate>
<fiftyTwoWkLow>21.21</fiftyTwoWkLow>
<fiftyTwoWkLowDate>2025-04-09</fiftyTwoWkLowDate>
</item>
<item>
<symbol>LNVGY</symbol>
<name>Lenovo Group Ltd ADR</name>
<marketCap>17130839844</marketCap>
<fiftyTwoWkHigh>35.09</fiftyTwoWkHigh>
<fiftyTwoWkHighDate>2025-02-21</fiftyTwoWkHighDate>
<fiftyTwoWkLow>17.84</fiftyTwoWkLow>
<fiftyTwoWkLowDate>2025-04-09</fiftyTwoWkLowDate>
</item>
<item>
<symbol>OSS</symbol>
<name>One Stop Systems Inc</name>
<marketCap>126500000</marketCap>
<fiftyTwoWkHigh>7.2</fiftyTwoWkHigh>
<fiftyTwoWkHighDate>2025-09-19</fiftyTwoWkHighDate>
<fiftyTwoWkLow>1.85</fiftyTwoWkLow>
<fiftyTwoWkLowDate>2025-04-07</fiftyTwoWkLowDate>
</item>
</getCompetitors>
CSV
GET
GET https://ondemand.websol.barchart.com/getCompetitors.csv?apikey=YOUR_API_KEY&symbol=AAPL&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&maxRecords=10&excludePriceAndVolumeFilter=true
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCompetitors.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbol=AAPL&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&maxRecords=10&excludePriceAndVolumeFilter=true
Response
symbol,name,marketCap,fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate
"DELL","Dell Technologies Inc","90057656250","168.08","2025-11-03","66.25","2025-04-07"
"HPQ","HP Inc","23348849609","39.79","2024-11-25","21.21","2025-04-09"
"LNVGY","Lenovo Group Ltd ADR","17130839844","35.09","2025-02-21","17.84","2025-04-09"
"OSS","One Stop Systems Inc","126500000","7.2","2025-09-19","1.85","2025-04-07"
PHP
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'symbol' => 'AAPL',
'fields' => 'fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate',
'maxRecords' => '10',
'excludePriceAndVolumeFilter' => 'true',
];
$result = $ondemand->getCompetitors($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.getCompetitors("YOUR_API_KEY", "AAPL", "fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate", "10", "true")
Perl
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getCompetitors('YOUR_API_KEY', 'AAPL', 'fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate', '10', 'true');
print $result;
Python
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getCompetitors('YOUR_API_KEY', 'AAPL', 'fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate', '10', 'true')
print(result)
Ruby
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getCompetitors,
message: {
apikey: 'YOUR_API_KEY',
symbol: 'AAPL',
fields: 'fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate',
maxRecords: '10',
excludePriceAndVolumeFilter: 'true',
}
)
response.body