Trading volume
The following endpoints retrieve daily trading volume of a stock.
Trading Volume Ts
Returns the Trading volume timeseries of a stock
Examples
- Curl
- Python
Note: If you are using Windows, adjust the syntax:
- Replace line breaks (
\) with caret (^).- Use double quotes (
") instead of single quotes (').
curl -X 'GET' \
'https://quant.api.yukkalab.com/trading/company/apple/trading_volume_ts?date_from=2023-01-01&date_to=2023-01-05' \
-H 'accept: application/json' \
-H "Authorization: Bearer $YUKKA_TOKEN"
import requests
headers = {
'accept': 'application/json',
'Authorization': f'Bearer {token}',
}
params = {
'date_from': '2023-01-01',
'date_to': '2023-01-05',
}
response = requests.get('https://quant.api.yukkalab.com/trading/company/apple/trading_volume_ts', params=params,
headers=headers)
Example Response
{"exchange_code":"US","exchange_name":"USA Stocks","currency":"USD","ticker":"AAPL.US","trading_volume_ts":[{"date":"2023-01-03","trading_volume":112117504.0},{"date":"2023-01-04","trading_volume":89113600.0}],"entity_info":{"type":"company","alpha_id":"apple","compound_key":"company:apple"}}
Return type
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| entity_type | str | ||
| entity_id | str | ||
| date_from | date | Date to start from when using time ranges | [optional] |
| date_to | date | Date to end from (exclusively) when using time ranges | [optional] |
| default_time_back | str | Default period of time that is used when no end date is supplied | [optional][default to 1w;] |
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
Trading Volume Ts Itemized
Returns the Stock price timeseries of a stock
Examples
- Curl
- Python
Note: If you are using Windows, adjust the syntax:
- Replace line breaks (
\) with caret (^).- Use double quotes (
") instead of single quotes (').
curl -X 'POST' \
'https://quant.api.yukkalab.com/trading/portfolio/trading_volume_ts_itemized?date_from=2023-01-01&date_to=2023-01-05' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $YUKKA_TOKEN" \
-d '["company:apple", "company:sap"]'
import requests
headers = {
'accept': 'application/json',
# Already added when you pass json=
# 'Content-Type': 'application/json',
'Authorization': f'Bearer {token}',
}
params = {
'date_from': '2023-01-01',
'date_to': '2023-01-05',
}
json_data = [
'company:apple',
'company:sap',
]
response = requests.post(
'https://quant.api.yukkalab.com/trading/portfolio/trading_volume_ts_itemized',
params=params,
headers=headers,
json=json_data,
)
Return type
TradingVolumeTsItemizedResponse
Example Response
{"trading_volume_ts_itemized":[{"exchange_code":"US","exchange_name":"USA Stocks","currency":"USD","ticker":"AAPL.US","trading_volume_ts":[{"date":"2023-01-03","trading_volume":112117504.0},{"date":"2023-01-04","trading_volume":89113600.0}],"entity_info":{"type":"company","alpha_id":"apple","compound_key":"company:apple"}},{"exchange_code":"XETRA","exchange_name":"XETRA Exchange","currency":"EUR","ticker":"SAP.XETRA","trading_volume_ts":[{"date":"2023-01-02","trading_volume":923508.0},{"date":"2023-01-03","trading_volume":1462210.0},{"date":"2023-01-04","trading_volume":1651526.0}],"entity_info":{"type":"company","alpha_id":"sap","compound_key":"company:sap"}}]}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| request_body | List[str] | ||
| date_from | date | Date to start from when using time ranges | [optional] |
| date_to | date | Date to end from (exclusively) when using time ranges | [optional] |
| default_time_back | str | Default period of time that is used when no end date is supplied | [optional][default to 1w;] |
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |