getRelatedInstruments API
getRelatedInstruments
The getRelatedInstruments API from Barchart OnDemand provides the list of all symbols for a given company across different countries and exchanges.
View All APIsContact Us to Get Access
Inputs
symbolrequired
A symbol or code that identifies a financial instrument. Multiple symbols separated by a comma may be used.
Type
string (A sequence of characters. (example: GOOG))
Example
IBM
shareClassFigioptional
The unique share class code identifying an instrument globally.
Type
string (A sequence of characters. (example: GOOG))
Example
BBG001S5S399
figioptional
The unique code identifying an instrument across all exchanges in a country.
Type
string (A sequence of characters. (example: GOOG))
Example
BBG000BLNQ16
compositeFigioptional
Type
string (A sequence of characters. (example: GOOG))
Example
BBG000BLNNH6
Outputs
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)
symbolName
always returned
always returned
The name of the financial instrument.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
exchange
always returned
always returned
Exchange code for the marketplace where the financial instruments are listed.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
figi
always returned
always returned
This code is unique at exchange level, a pair of exchange and company is assigned a unique figi.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
compositeFigi
always returned
always returned
This code is shared in all exchanges across a country for a given company.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
shareClassFigi
always returned
always returned
This code is shared in all exchanges across the world for a given company.
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/getRelatedInstruments.json?apikey=YOUR_API_KEY&symbol=IBM&shareClassFigi=BBG001S5S399&figi=BBG000BLNQ16&compositeFigi=BBG000BLNNH6
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getRelatedInstruments.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbol=IBM&shareClassFigi=BBG001S5S399&figi=BBG000BLNQ16&compositeFigi=BBG000BLNNH6
Response
{
"status": {
"code": 200,
"message": "Success."
},
"results": [
{
"symbol": "IBM",
"symbolName": "International Business Machines",
"exchange": "NYSE",
"figi": "BBG000BLNQ16",
"compositeFigi": "BBG000BLNNH6",
"shareClassFigi": "BBG001S5S399"
},
{
"symbol": "IBM.BZ",
"symbolName": "International Business Machines",
"exchange": "BATS",
"figi": "BBG000BLNXP5",
"compositeFigi": "BBG000BLNNH6",
"shareClassFigi": "BBG001S5S399"
},
{
"symbol": "IBM.LN",
"symbolName": "International Business Machines Corp",
"exchange": "LSE",
"figi": "BBG000NBXGK5",
"compositeFigi": "BBG000NBW8B4",
"shareClassFigi": "BBG001S5S399"
},
{
"symbol": "IBM.D.EB",
"symbolName": "International Business Machines Corp",
"exchange": "BXE",
"figi": "BBG01FTSR3R7",
"compositeFigi": "BBG01FTSR3Q8",
"shareClassFigi": "BBG001S5S399"
},
{
"symbol": "IBM.D.IX",
"symbolName": "International Business Machines Corp",
"exchange": "BXE",
"figi": "BBG01FTSR495",
"compositeFigi": "BBG01FTSR486",
"shareClassFigi": "BBG001S5S399"
},
{
"symbol": "IBM.D.DX",
"symbolName": "International Business Machines Corp",
"exchange": "DXE",
"figi": "BBG01FTSR5F5",
"compositeFigi": "BBG01FTSR5D7",
"shareClassFigi": "BBG001S5S399"
}
]
}
XML
GET
GET https://ondemand.websol.barchart.com/getRelatedInstruments.xml?apikey=YOUR_API_KEY&symbol=IBM&shareClassFigi=BBG001S5S399&figi=BBG000BLNQ16&compositeFigi=BBG000BLNNH6
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getRelatedInstruments.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbol=IBM&shareClassFigi=BBG001S5S399&figi=BBG000BLNQ16&compositeFigi=BBG000BLNNH6
Response
<?xml version="1.0" encoding="utf-8"?>
<getRelatedInstruments>
<status>
<code>200</code>
<message>Success.</message>
</status>
<item>
<symbol>IBM</symbol>
<symbolName>International Business Machines</symbolName>
<exchange>NYSE</exchange>
<figi>BBG000BLNQ16</figi>
<compositeFigi>BBG000BLNNH6</compositeFigi>
<shareClassFigi>BBG001S5S399</shareClassFigi>
</item>
<item>
<symbol>IBM.BZ</symbol>
<symbolName>International Business Machines</symbolName>
<exchange>BATS</exchange>
<figi>BBG000BLNXP5</figi>
<compositeFigi>BBG000BLNNH6</compositeFigi>
<shareClassFigi>BBG001S5S399</shareClassFigi>
</item>
<item>
<symbol>IBM.LN</symbol>
<symbolName>International Business Machines Corp</symbolName>
<exchange>LSE</exchange>
<figi>BBG000NBXGK5</figi>
<compositeFigi>BBG000NBW8B4</compositeFigi>
<shareClassFigi>BBG001S5S399</shareClassFigi>
</item>
<item>
<symbol>IBM.D.EB</symbol>
<symbolName>International Business Machines Corp</symbolName>
<exchange>BXE</exchange>
<figi>BBG01FTSR3R7</figi>
<compositeFigi>BBG01FTSR3Q8</compositeFigi>
<shareClassFigi>BBG001S5S399</shareClassFigi>
</item>
<item>
<symbol>IBM.D.IX</symbol>
<symbolName>International Business Machines Corp</symbolName>
<exchange>BXE</exchange>
<figi>BBG01FTSR495</figi>
<compositeFigi>BBG01FTSR486</compositeFigi>
<shareClassFigi>BBG001S5S399</shareClassFigi>
</item>
<item>
<symbol>IBM.D.DX</symbol>
<symbolName>International Business Machines Corp</symbolName>
<exchange>DXE</exchange>
<figi>BBG01FTSR5F5</figi>
<compositeFigi>BBG01FTSR5D7</compositeFigi>
<shareClassFigi>BBG001S5S399</shareClassFigi>
</item>
</getRelatedInstruments>
CSV
GET
GET https://ondemand.websol.barchart.com/getRelatedInstruments.csv?apikey=YOUR_API_KEY&symbol=IBM&shareClassFigi=BBG001S5S399&figi=BBG000BLNQ16&compositeFigi=BBG000BLNNH6
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getRelatedInstruments.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbol=IBM&shareClassFigi=BBG001S5S399&figi=BBG000BLNQ16&compositeFigi=BBG000BLNNH6
Response
symbol,symbolName,exchange,figi,compositeFigi,shareClassFigi
"IBM","International Business Machines","NYSE","BBG000BLNQ16","BBG000BLNNH6","BBG001S5S399"
"IBM.BZ","International Business Machines","BATS","BBG000BLNXP5","BBG000BLNNH6","BBG001S5S399"
"IBM.LN","International Business Machines Corp","LSE","BBG000NBXGK5","BBG000NBW8B4","BBG001S5S399"
"IBM.D.EB","International Business Machines Corp","BXE","BBG01FTSR3R7","BBG01FTSR3Q8","BBG001S5S399"
"IBM.D.IX","International Business Machines Corp","BXE","BBG01FTSR495","BBG01FTSR486","BBG001S5S399"
"IBM.D.DX","International Business Machines Corp","DXE","BBG01FTSR5F5","BBG01FTSR5D7","BBG001S5S399"
PHP
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'symbol' => 'IBM',
'shareClassFigi' => 'BBG001S5S399',
'figi' => 'BBG000BLNQ16',
'compositeFigi' => 'BBG000BLNNH6',
];
$result = $ondemand->getRelatedInstruments($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.getRelatedInstruments("YOUR_API_KEY", "IBM", "BBG001S5S399", "BBG000BLNQ16", "BBG000BLNNH6")
Perl
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getRelatedInstruments('YOUR_API_KEY', 'IBM', 'BBG001S5S399', 'BBG000BLNQ16', 'BBG000BLNNH6');
print $result;
Python
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getRelatedInstruments('YOUR_API_KEY', 'IBM', 'BBG001S5S399', 'BBG000BLNQ16', 'BBG000BLNNH6')
print(result)
Ruby
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getRelatedInstruments,
message: {
apikey: 'YOUR_API_KEY',
symbol: 'IBM',
shareClassFigi: 'BBG001S5S399',
figi: 'BBG000BLNQ16',
compositeFigi: 'BBG000BLNNH6',
}
)
response.body