Skip to content

Latest commit

 

History

History
180 lines (122 loc) · 9.21 KB

File metadata and controls

180 lines (122 loc) · 9.21 KB

factsetprices.SharesApi

All URIs are relative to https://api.factset.com/content

Method HTTP request Description
getSecurityShares GET /factset-prices/v1/shares Gets shares for a list of `ids` as of given date range.
getSecuritySharesForList POST /factset-prices/v1/shares Requests shares for a list of `ids` as of given date range.

getSecurityShares

SharesResponse getSecurityShares(ids, opts)

Gets shares for a list of `ids` as of given date range.

Gets security shares for a list of 'ids' and given date range. Share values returned include security-level and company-level.

Example

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, SharesApi } = require('@factset/sdk-factsetprices');
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 SharesApi();
const ids = ["AAPL-USA"]; // [String] | The requested list of security identifiers. Accepted ID types include Market Tickers, SEDOL, ISINs, CUSIPs, or FactSet Permanent Ids. <p>***ids limit** =  1000 per request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, its advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>*
const opts = {
  'startDate': 2019-01-01, // String | The start date requested for a given date range in **YYYY-MM-DD** format. If left blank, the API will default to previous close. Future dates (T+1) are not accepted in this endpoint. 
  'endDate': 2019-12-31, // String | The end date requested for a given date range in **YYYY-MM-DD** format. If left blank, the API will default to previous close. Future dates (T+1) are not accepted in this endpoint. 
  'frequency': D, // String | Controls the display frequency of the data returned.   * **D** = Daily   * **W** = Weekly, based on the last day of the week of the start date.   * **M** = Monthly, based on the last trading day of the month.   * **AM** = Monthly, based on the start date (e.g., if the start date is June 16, data is displayed for June 16, May 16, April 16 etc.).   * **CQ** = Quarterly based on the last trading day of the calendar quarter (March, June, September, or December).   * **FQ** = Fiscal Quarter of the company.   * **AY** = Actual Annual, based on the start date.   * **CY** = Calendar Annual, based on the last trading day of the calendar year.   * **FY** = Fiscal Annual, based on the last trading day of the company's fiscal year. 
  'calendar': FIVEDAY, // String | Calendar of data returned. SEVENDAY includes weekends. LOCAL calendar will default to the securities' trading calendar which excludes date records for respective holiday periods.
  'splitAdjust': "'SPLIT'" // String | Code to control split adjustments for shares count.
};

// Call api endpoint
apiInstance.getSecurityShares(ids, opts).then(
  data => {

    console.log('API called successfully. Returned data:');
    console.log(data);
  },
  error => {
    console.error(error);
  },
);

Parameters

Name Type Description Notes
ids [String] The requested list of security identifiers. Accepted ID types include Market Tickers, SEDOL, ISINs, CUSIPs, or FactSet Permanent Ids. <p>ids limit = 1000 per request</p> <p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, its advised for any requests with large request lines to be requested through the respective &quot;POST&quot; method.</p>
startDate String The start date requested for a given date range in YYYY-MM-DD format. If left blank, the API will default to previous close. Future dates (T+1) are not accepted in this endpoint. [optional]
endDate String The end date requested for a given date range in YYYY-MM-DD format. If left blank, the API will default to previous close. Future dates (T+1) are not accepted in this endpoint. [optional]
frequency String Controls the display frequency of the data returned. * D = Daily * W = Weekly, based on the last day of the week of the start date. * M = Monthly, based on the last trading day of the month. * AM = Monthly, based on the start date (e.g., if the start date is June 16, data is displayed for June 16, May 16, April 16 etc.). * CQ = Quarterly based on the last trading day of the calendar quarter (March, June, September, or December). * FQ = Fiscal Quarter of the company. * AY = Actual Annual, based on the start date. * CY = Calendar Annual, based on the last trading day of the calendar year. * FY = Fiscal Annual, based on the last trading day of the company's fiscal year. [optional] [default to 'D']
calendar String Calendar of data returned. SEVENDAY includes weekends. LOCAL calendar will default to the securities' trading calendar which excludes date records for respective holiday periods. [optional] [default to 'FIVEDAY']
splitAdjust String Code to control split adjustments for shares count. [optional] [default to 'SPLIT']

Return type

SharesResponse

Authorization

FactSetApiKey, FactSetOAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getSecuritySharesForList

SharesResponse getSecuritySharesForList(sharesRequest)

Requests shares for a list of `ids` as of given date range.

Gets security shares for a list of 'ids' and given date range. Share values returned include security-level and company-level.

Example

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, SharesApi } = require('@factset/sdk-factsetprices');
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 SharesApi();
const sharesRequest = new factsetprices.SharesRequest(); // SharesRequest | Request object for `Security` shares.

// Call api endpoint
apiInstance.getSecuritySharesForList(sharesRequest).then(
  data => {

    console.log('API called successfully. Returned data:');
    console.log(data);
  },
  error => {
    console.error(error);
  },
);

Parameters

Name Type Description Notes
sharesRequest SharesRequest Request object for `Security` shares.

Return type

SharesResponse

Authorization

FactSetApiKey, FactSetOAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json