Daily Stock Data API
This API provides access to daily stock data, beta values, mutual fund profiles, and residuals. It supports time range filtering, field selection, and data retrieval in JSON or CSV format. Authentication is required via API key.
Base URL
https://api.riskmodels.net/daily-stock-data-api
Authentication
All endpoints require an API key to be passed in the request header:
apikey: <your-api-key>
Endpoints
1. GET /daily – Retrieve Daily Stock Data
Retrieve daily stock data, optionally filtered by time range, specific fields, and format.
Example Request:
curl --header "apikey: <API_KEY>" \
--request GET "https://api.riskmodels.net/daily-stock-data-api/daily?symbols=AAPL,GOOG&start_time=2024-10-04&end_time=2024-10-04&fields=close,volume,symbol"
Parameters:
Name | In | Type | Required | Description |
---|---|---|---|---|
symbols | query | string | Yes | Comma-separated list of stock tickers to filter by. |
start_time | query | string | Yes | Start of the time range (YYYY-MM-DD). |
end_time | query | string | No | End of the time range (YYYY-MM-DD). |
fields | query | string | No | Comma-separated list of fields (e.g., close,volume ). |
format | query | string | No | Format to retrieve data (json or csv). Default: json . |
Response Example:
[
{
"symbol": "AAPL",
"close": 149.55,
"volume": 9812314,
},
{
"symbol": "GOOG",
"close": 168.56,
"volume": 11435318,
}
]
2. GET /betas – Retrieve Beta Data
Retrieve beta values for specific symbols and factors.
Example Request:
curl --header "apikey: <API_KEY>" \
--request GET "https://api.riskmodels.net/daily-stock-data-api/betas?symbols=AAPL,GOOG&start_time=2024-10-04&end_time=2024-10-04&fact=Mkt"
Parameters:
Name | In | Type | Required | Description |
---|---|---|---|---|
symbols | query | string | Yes | Comma-separated list of stock tickers to filter by. |
fact | query | string | Yes | Factor name to filter by. |
start_time | query | string | Yes | Start of the time range (YYYY-MM-DD). |
end_time | query | string | No | End of the time range (YYYY-MM-DD). |
format | query | string | No | Format to retrieve data (json or csv). Default: json . |
Response Example:
[
{
"teo": "2024-10-04",
"symbol": "AAPL",
"factor_beta": 0.861774725720499,
"fact": "Mkt"
},
{
"teo": "2024-10-04",
"symbol": "GOOG",
"factor_beta": 0.969178634609282,
"fact": "Mkt"
}
]
3. GET /facts – Retrieve Facts Data
Retrieve fact return values filtered by factor and date.
Example Request:
curl --header "apikey: <API_KEY>" \
--request GET "https://api.riskmodels.net/daily-stock-data-api/facts?fact=Energy&start_time=2024-10-04&end_time=2024-10-07"
Parameters:
Name | In | Type | Required | Description |
---|---|---|---|---|
fact | query | string | Yes | Factor to filter by (e.g., Energy, Mkt). |
start_time | query | string | Yes | Start of the time range (YYYY-MM-DD). |
end_time | query | string | No | End of the time range (YYYY-MM-DD). |
format | query | string | No | Format to retrieve data (json or csv). Default: json . |
Response Example:
[
{
"teo": "2024-10-04T00:00:00",
"fact": "Energy",
"factor_return": 0.47414848827427347
},
{
"teo": "2024-10-07T00:00:00",
"fact": "Energy",
"factor_return": 0.7559717995628776
}
]
4. GET /gross – Retrieve Gross Data
Retrieve gross return values filtered by symbols and date.
Example Request:
curl --header "apikey: <API_KEY>" \
--request GET "https://api.riskmodels.net/daily-stock-data-api/gross?symbols=GOOGL,AAPL&start_time=2024-10-04&end_time=2024-10-05
Parameters:
Name | In | Type | Required | Description |
---|---|---|---|---|
symbols | query | string | Yes | Comma-separated list of stock tickers to filter by. |
start_time | query | string | Yes | Start of the time range (YYYY-MM-DD). |
end_time | query | string | No | End of the time range (YYYY-MM-DD). |
format | query | string | No | Format to retrieve data (json or csv). Default: json . |
Response Example:
[
{
"teo": "2024-10-04T00:00:00",
"symbol": "GOOGL",
"gross_return": 0.7235
},
{
"teo": "2024-10-04T00:00:00",
"symbol": "AAPL",
"gross_return": 0.5007
}
]
5. GET /resids – Retrieve Residuals Data
Retrieve residual data for specific symbols over a time range.
Example Request:
curl --header "apikey: <API_KEY>" \
--request GET "https://api.riskmodels.net/daily-stock-data-api/resids?symbols=AAPL,GOOG&start_time=2024-10-04&end_time=2024-10-04"
Parameters:
Name | In | Type | Required | Description |
---|---|---|---|---|
symbols | query | string | Yes | Comma-separated list of stock tickers to filter by. |
start_time | query | string | Yes | Start of the time range (YYYY-MM-DD). |
end_time | query | string | No | End of the time range (YYYY-MM-DD). |
format | query | string | No | Format to retrieve data (json or csv). Default: json . |
Response Example:
[
{
"teo": "2024-10-04",
"residual_return": -0.202475783971016,
"symbol": "AAPL"
},
{
"teo": "2024-10-04",
"residual_return": -0.0489799958486298,
"symbol": "GOOG"
}
]
6. GET /symbol_list – Retrieve Top Stock Symbols
Retrieve top_n symbol list by top_by such as mktcap
, mktcap_rank
, close
, return
, turnover
, volume
. Sector specific
symbol list can be retrieve by specifying option sector_code parameter.
Example Request:
curl --header "apikey: <API_KEY>" \
--request GET "https://api.riskmodels.net/daily-stock-data-api/symbol_list?top_n=5"
Parameters:
Name | In | Type | Required | Description |
---|---|---|---|---|
sector_code | query | string | No | To retrieve symbol list specific to given sector. Default: None. |
top_n | query | integer | Yes | Number of top stock symbols to return. Default: 10. |
top_by | query | string | No | Column to sort by (e.g., mktcap, mktcap_rank, close, turnover, volume, return). Default: mktcap. |
ascending | query | boolean | No | Whether to sort in ascending order. Default: false. |
Response Example:
{
"symbols": [
"AAPL",
"NVDA",
"MSFT",
"AMZN",
"META"
]
}