@factset/sdk-factsetsupplychain
v2.0.1
Published
FactSet Supply Chain client library for JavaScript
Downloads
8
Readme
FactSet Supply Chain client library for JavaScript
Access the complex networks of key customer, suppliers, competitors and partners so that you can make insightful investment decisions. Relationship information is sourced from trusted primary sources and reverse-linked to non-disclosing parties, creating a comprehensive and consistent relationship graph. This API is rate-limited to 10 requests per second and 10 concurrent requests per user.
This TypeScript/JavaScript package is automatically generated by the OpenAPI Generator project:
- API version: 1.1.0
- SDK version: 2.0.1
- Build package: com.factset.sdk.codegen.FactSetJavascriptClientCodegen
For more information, please visit https://developer.factset.com/contact
Requirements
- Node.js >= 18
Installation
npm
npm install @factset/sdk-utils @factset/[email protected]yarn
yarn add @factset/sdk-utils @factset/[email protected]Usage
- Generate authentication credentials.
- Setup Node.js environment
Install and activate Node.js >=18. If you're using nvm:
nvm install 18 nvm use 18(optional) Install yarn.
- Install dependencies.
- Run the following:
[!IMPORTANT] The parameter variables defined below are just examples and may potentially contain non valid values. Please replace them with valid values.
Example Code
const { ApiClient, RelationshipsApi } = require('@factset/sdk-factsetsupplychain');
const { ConfidentialClient } = require('@factset/sdk-utils');
const apiClient = ApiClient.instance;
// Examples for each supported authentication method are below,
// choose one that satisfies your use case.
// (Preferred) OAuth 2.0: FactSetOAuth2
// See https://github.com/FactSet/enterprise-sdk#oauth-20
// for information on how to create the app-config.json file
//
// The confidential client instance should be reused in production environments.
// See https://github.com/FactSet/enterprise-sdk-utils-typescript#authentication
// for more information on using the ConfidentialClient class
apiClient.factsetOauth2Client = new ConfidentialClient('/path/to/app-config.json');
// Basic authentication: FactSetApiKey
// See https://github.com/FactSet/enterprise-sdk#api-key
// for information how to create an API key
// const FactSetApiKey = apiClient.authentications['FactSetApiKey'];
// FactSetApiKey.username = 'USERNAME-SERIAL';
// FactSetApiKey.password = 'API-KEY';
const apiInstance = new RelationshipsApi();
const ids = ["AAPL-USA"]; // [String] | The requested list of security identifiers. Accepted ID types include Market Tickers, SEDOL, ISINs, CUSIPs, or FactSet Permanent Ids. * Make Note - id limit of 500
const relationshipType = SUPPLIERS; // String | The category describing how the source company is connected to another organization. Use this parameter to filter results based on the business relationship type. Defined as: * **SUPPLIERS** = An organization that provides goods or services to the source company. The source company acts as the buyer in this relationship. (inverse of \"Customer\" relationships.) * **COMPETITORS** = An organization explicitly identified by the source company as a rival, usually operating in the same market or industry sector. * **CUSTOMERS** = An organization that receives goods or services from the source company. The source company acts as the seller in this relationship. (Reverse of \"Supplier\" relationships.) * **PARTNERS** = An organization in which the source company holds an ownership interest (i.e., the source company owns shares or equity in the partner). This is the counterpart to an investor relationship, where the external party has an ownership interest in the source company.
const opts = {
'companyType': PUBLIC_COMPANIES_ONLY, // String | Specifies the category of companies to include when filtering results: * **PUBLIC_COMPANIES_ONLY**: Include only relationships involving companies that are publicly traded. * **PRIVATE_COMPANIES_ONLY**: Include only relationships involving companies that are privately held (not publicly traded). * **ALL**: Include relationships involving both public and private companies.
'relationshipDirection': ALL // String | Filters the list of available relationship directions - * **ALL** = Include both direct and reverse relationships. * **DIRECT** = Include only relationships where the source company identified and named the connection to the target company. * **REVERSE** = Include only relationships where the target company identified and named the connection to the source company.
};
// Call api endpoint
apiInstance.getRelationships(ids, relationshipType, opts).then(
data => {
console.log('API called successfully. Returned data:');
console.log(data);
},
error => {
console.error(error);
},
);
Using a Proxy
To add a HTTP proxy for the API client, you can set the proxyUrl for the ApiClient instance:
const { ApiClient } = require('@factset/sdk-factsetsupplychain');
const apiClient = ApiClient.instance;
apiClient.setProxyUrl('http://username:[email protected]:8080');Documentation for API Endpoints
All URIs are relative to https://api.factset.com/content/factset-supply-chain/v1
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- factsetsupplychain.RelationshipsApi | getRelationships | GET /relationships | Returns Supply Chain Relationships Data. factsetsupplychain.RelationshipsApi | getRelationshipsForList | POST /relationships | Returns Supply Chain Relationships Data.
Documentation for Models
- factsetsupplychain.CompanyType
- factsetsupplychain.ErrorObject
- factsetsupplychain.ErrorObjectLinks
- factsetsupplychain.ErrorResponse
- factsetsupplychain.RelationshipDirection
- factsetsupplychain.RelationshipType
- factsetsupplychain.Relationships
- factsetsupplychain.RelationshipsRequest
- factsetsupplychain.RelationshipsRequestBody
- factsetsupplychain.RelationshipsResponse
Documentation for Authorization
FactSetApiKey
- Type: HTTP basic authentication
FactSetOAuth2
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes: N/A
Contributing
Please refer to the contributing guide.
Copyright
Copyright 2025 FactSet Research Systems Inc
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
