Introduction
This API call is used to retrieve daily historical stock data for the specified symbol from a database and returns the results as either JSON or CSV. The API call takes in the symbol, format (JSON or CSV), maxRows (optional), and maxDate (optional) as parameters and returns a list of daily historical stock data for the symbol. The data can be returned in either JSON or CSV format.
Endpoint
/daily-stock-history/:symbol/:format/:maxRows/:maxDate
Parameters
- symbol (string, required) – The stock symbol for which to retrieve historical data.
- format (string, optional) – The format to return the data in. Valid options: ‘json’ or ‘csv’. Defaults to ‘json’.
- maxRows (integer, optional) – The maximum number of rows to return. Defaults to no limit.
- maxDate (date, optional) – The maximum date for the data. Format: ‘yyyy-mm-dd’. Defaults to the latest available date.
Examples
List of several example calls, URLs, and responses to show users how to interact with the API call. These examples should include a variety of input parameters to demonstrate the different scenarios that the API call can handle.
- https://api.deltaneutral.net/daily-stock-history/AAPL/json/100/2023-04-22?apikey=DEMOAPIKEY
- https://api.deltaneutral.net/daily-stock-history/GOOG/csv?apikey=DEMOAPIKEY
Related Calls
None
Error Handling
If no data comes back, please check for valid input parameters.
Example Response
[{
"quotedate":"4/20/2023",
"symbol":"AAPL",
"open_price":165.05,
"high_price":166.4521,
"low_price":164.49,
"close_price":165.02,
"volume":56563180,
"adjustedClose":165.02
}]