The adjustments request returns splits and dividends data for a specified symbol. You can also request splits and dividends data for all symbols. You can use the adjustments command to get the last adjustment date for a symbol and decide whether to download all back-adjusted data or only data that is missing.
http://api.kibot.com?action=adjustments&symbol=[symbol]&startdate=[startdate]&enddate=[enddate]&splitsonly=[splitsonly]÷ndsonly=[dividendsonly]&symbolsonly=[symbolsonly]
The server returns TAB separated values with the first line defining the fields and their order. Here is an example:
Date
Symbol
Company
Action
Description
2/16/2010
MSFT
Microsoft Corp.
0.1300
Dividend
5/18/2010
The table below describes all the parameters that are accepted:
PARAMETER
DESCRIPTION
REQUIRED
POSSIBLE VALUES
action
Specifies the action to perform on the server
YES
adjustments
symbol
Specifies the symbol to process
NO
startdate
The start date of the data being requested (Inclusive)
Date (MM/DD/YYYY)
If not specified, then all data for a particular symbol is returned. If data for all symbols is requested, then the last 4 months are processed.
enddate
The end date of the data being requested (Inclusive)
If not specified, then the default value is the previous business day
splitsonly
Instructs the API to return only splits and reverse splits in the results
1, 0
If not specified, then all splits and dividends are returned
dividendsonly
Instructs the API to return only dividends in the results
symbolsonly
Instructs the API to return only list of symbols without any other details or formatting
If not specified, then all fields separated by TAB character are returned
After every split or a dividend, the data needs to be back-adjusted in order to match the new prices that are coming from the exchange. In order to update the existing data, use the adjustments command to get the last adjustment date for a symbol you are downloading.
If you need to update multiple symbols, the fastest and most efficient way to obtain the required adjustment data is to use symbol=allsymbols parameter to return data using a single HTTP request. The same result is obtained if you leave out the symbol parameter.
For example, if your existing data has "5/1/2011" as the last date for IBM, then before downloading the missing data first determine whether the data had been adjusted after that date by calling this URL:
http://api.kibot.com?action=adjustments&symbol=IBM&startdate=5/1/2011
1. If the response is "404 Not Found" then you can download historical data that is missing using "5/1/2011" as the start date.
2. If the server returns splits or dividends after "5/1/2011", then download the entire file.
URL:
http://api.kibot.com?action=adjustments&symbol=MSFT&startdate=2/16/2010
Response:
8/17/2010
11/16/2010
0.1600
2/15/2011
http://api.kibot.com?action=adjustments&symbol=WMT
3/10/2010
WMT
Wal-Mart Stores, Inc.
0.3025
5/12/2010
8/11/2010
3/9/2011
0.3650
http://api.kibot.com?action=adjustments&symbol=allsymbols&startdate=5/1/2011
© 2024 Oricsoft. All rights reserved. | Privacy Statement