Skip to content

Latest commit

 

History

History
178 lines (120 loc) · 8.31 KB

DividendsApi.md

File metadata and controls

178 lines (120 loc) · 8.31 KB

factsetprices.DividendsApi

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

Method HTTP request Description
getSecurityDividends GET /factset-prices/v1/dividends Gets dividend information for a given date range and list of securities
getSecurityDividendsForList POST /factset-prices/v1/dividends Requests dividend information for a given date range and list of securities

getSecurityDividends

DividendsResponse getSecurityDividends(ids, opts)

Gets dividend information for a given date range and list of securities

Get the dividend amounts, dates, types, and flags over a specified date range. You may request future dates to receive information for declared dividends.

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, DividendsApi } = 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 DividendsApi();
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. 
  'currency': USD, // String | Currency code for adjusting prices. Default is Local. For a list of currency ISO codes, visit [Online Assistant Page 1470](https://oa.apps.factset.com/pages/1470).
  'adjust': SPLIT // String | Controls the split, spinoff, and dividend adjustments for the prices. <p>For more information, visit [Online Assistant Page 614](https://oa.apps.factset.com/pages/614)</p>   * **SPLIT** = Split ONLY Adjusted. This is used by default.   * **SPINOFF** = Splits & Spinoff Adjusted.   * **DIVADJ** = Splits, Spinoffs, and Dividends adjusted.   * **UNSPLIT** = No Adjustments. 
};

// Call api endpoint
apiInstance.getSecurityDividends(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]
currency String Currency code for adjusting prices. Default is Local. For a list of currency ISO codes, visit Online Assistant Page 1470. [optional]
adjust String Controls the split, spinoff, and dividend adjustments for the prices. <p>For more information, visit Online Assistant Page 614</p> * SPLIT = Split ONLY Adjusted. This is used by default. * SPINOFF = Splits & Spinoff Adjusted. * DIVADJ = Splits, Spinoffs, and Dividends adjusted. * UNSPLIT = No Adjustments. [optional] [default to 'SPLIT']

Return type

DividendsResponse

Authorization

FactSetApiKey, FactSetOAuth2

HTTP request headers

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

getSecurityDividendsForList

DividendsResponse getSecurityDividendsForList(dividendsRequest)

Requests dividend information for a given date range and list of securities

Get the dividend amounts, dates, types, and flags over a specified date range

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, DividendsApi } = 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 DividendsApi();
const dividendsRequest = new factsetprices.DividendsRequest(); // DividendsRequest | Request object for `Security` dividends.

// Call api endpoint
apiInstance.getSecurityDividendsForList(dividendsRequest).then(
  data => {

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

Parameters

Name Type Description Notes
dividendsRequest DividendsRequest Request object for `Security` dividends.

Return type

DividendsResponse

Authorization

FactSetApiKey, FactSetOAuth2

HTTP request headers

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