@factset/sdk-standarddatafeed
v2.0.1
Published
Standard Datafeed client library for JavaScript
Downloads
273
Readme
Standard Datafeed client library for JavaScript
The Standard DataFeed (SDF) Download API provides an alternative method for users to request and retrieve SDF packages (schemas & bundles). This service is not a direct replacement and does not have 100% feature parity with the Loader Application. This API provides an alternative for users who are unable to utilize the Loader application due to the following reasons:
Inability to install 3rd party executables due to Corporate Security policies.
Inability to utilize the Loader application due to limitations or restrictions with the environment used to consume Standard Datafeed.
Clients who are utilizing existing delivery methods like FTP, who may want to use a more secure & modern solution.
This API allows users to retrieve
- Both SDF and the QFL (Quant Factor Library (Factor Family & Factor Groups)) packages they have subscriptions for, with data available since January 1, 1995.
Additional parameters are available to filter requests to get the exact files users are looking for.
QFL data is delivered through Content API & Bulk Data API (SDF API).
Content API: Provides direct access to FactSet-hosted QFL data. Suitable for interactive, ad hoc QFL requests. Constraints on large extracts. Costs are based on consumption, i.e. more calls can result in more costs.
Bulk Data API: Provides access to download locations of zip files for client download. Suitable for production processes within a client environment. Cost is based on the use case and fixed unless scope changes (same as other SDFs).
Please find all the content-related comprehensive documentation here.
This TypeScript/JavaScript package is automatically generated by the OpenAPI Generator project:
- API version: 2.0.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, SDFAndQFLContentLibraryApi } = require('@factset/sdk-standarddatafeed');
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 SDFAndQFLContentLibraryApi();
const opts = {
'schema': fgp_v1, // String | Name of the schema.
'bundle': fgp_global_prices_am_v1, // String | Name of the bundle.
'type': "'delta'", // String | Type of the file. Note: - Full files are snapshots of the bundle capturing the most recent version of the bundle generated every weekend. When requesting 'Full' files, ensure that the date range includes weekend dates. - Delta files include the incremental changes (inserts, updates, deletes), since the last file and have incremental sequence numbers.
'startDate': 2023-01-01, // String | The earliest date of the feed file the API should fetch based on the file timestamp. Consider the following points: - Dates provided in `startDate` and `endDate` along with `schema` parameter: The returned dataset is limited to a maximum of latest 30 days' worth of records. - Format: Should be absolute (YYYY-MM-DD).
'startDateRelative': 56, // Number | The earliest date of the feed file the API should fetch based on the file timestamp. Consider the following points: - Dates provided in `startDate` and `endDate` along with `schema` parameter: The returned dataset is limited to a maximum of latest 30 days' worth of records. - Format: Specify the date using a relative term as an integer: '0' for today, '-1' for yesterday, '-2' for two days ago, and so forth. Negative values are used to represent past dates. *Note:* - *Either `startDate` or `startDateRelative` should be used, but not both.* - *If both `startDate` and `startDateRelative` are provided in the same request, the API will return an error.* - *If users provide future dates in requests for `startDate` or `startDateRelative`, the API will not return any data.*
'endDate': 2023-01-28, // String | The latest date of the feed file the API should fetch for based on the file timestamp. - Format: Should be absolute - YYYY-MM-DD.
'endDateRelative': 56, // Number | The latest date of the feed file the API should fetch for based on the file timestamp. - Format: Specify the date using a relative term as an integer: '0' for today, '-1' for yesterday, '-2' for two days ago, and so forth. Negative values are used to represent past dates. *Note:* - *Either `endDate` or `endDateRelative` should be used, but not both.* - *If both `endDate` and `endDateRelative` are provided in the same request, the API will return an error.* - *If users provide future dates in requests for `endDate` or `endDateRelative`, the API will not return any data.*
'paginationLimit': 20, // Number | Specifies the number of results to return per page.
'paginationOffset': 0, // Number | Specifies the starting point for pagination. This parameter is used to identify the beginning of next set of results.
'sort': ["null"] // [String] | Enables sorting data in ascending or descending chronological order based on startDate.
};
// Call api endpoint
apiInstance.getListFiles(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-standarddatafeed');
const apiClient = ApiClient.instance;
apiClient.setProxyUrl('http://username:[email protected]:8080');
Documentation for API Endpoints
All URIs are relative to https://api.factset.com/bulk-documents/sdf/v2
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- standarddatafeed.SDFAndQFLContentLibraryApi | getListFiles | GET /list-files | Returns delta & full files for the schemas. standarddatafeed.SDFAndQFLContentLibraryApi | gethistoricalFiles | GET /historical-files | Returns full historic data of specified schema and bundle. standarddatafeed.SchemaApi | getListSchemaswithoutwithooutRequiredParameters | GET /list-schemas | List of Standard DataFeed (SDF) schemas. standarddatafeed.SchemaApi | getSchemaDetails | GET /schema-details | Schema Details.
Documentation for Models
- standarddatafeed.ErrorExample
- standarddatafeed.ErrorResponse
- standarddatafeed.HistoricalFile
- standarddatafeed.HistoricalFileObject
- standarddatafeed.HistoricalFileObjectObject
- standarddatafeed.ListFile
- standarddatafeed.ListFileObject
- standarddatafeed.ListFileObjectObject
- standarddatafeed.ListSchema
- standarddatafeed.ListSchemaObject
- standarddatafeed.Meta
- standarddatafeed.Pagination
- standarddatafeed.SchemaDetail
- standarddatafeed.SchemaDetailObject
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 2022 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.0
Unless 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.