News Volume
The following endpoints retrieves the daily News Volume of entities.
Volume Ts
Returns the News Volume timeseries of an entity.
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://data.api.yukkalab.com/9-3-5/2023-12-13-0/api/company/apple/volume_ts?date_from=2024-07-01&date_to=2024-07-05' \
-H 'accept: application/json' \
-H "Authorization: Bearer $YUKKA_TOKEN"
Return type
JSON
Example Response
{"volume_ts":[{"volume":6524,"date":"2024-07-01"},{"volume":6424,"date":"2024-07-02"},{"volume":5576,"date":"2024-07-03"},{"volume":3794,"date":"2024-07-04"}],"used_cache":true,"cache_key":"auto_cache_volume_ts_5a23e8173160e89475368f6bb0611a5a4ad80dd815607fbde6241b72b6677634"}
import requests
import os
import pandas as pd
# getting the data
headers = {'Authorization': f'Bearer {os.environ["YUKKA_TOKEN"]}'}
url = f'https://data.api.yukkalab.com/9-3-5/2023-12-13-0/api/company/apple/volume_ts?date_from=2024-07-01&date_to=2024-07-05'
data = requests.get(url, headers=headers).json()
# transform into dataframe:
df = pd.DataFrame(data['volume_ts'])
print(df)
Return type
pd.DataFrame(columns=[date, volume])
Example Response
volume date
0 6524 2024-07-01
1 6424 2024-07-02
2 5576 2024-07-03
3 3794 2024-07-04
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| 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;] |
Authorization
JSON Web Token. Issued by Yukka.
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
Volume Ts Itemized
Returns the News Volume timeseries of multiple entities
Example
- 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://data.api.yukkalab.com/9-3-5/2023-12-13-0/v2/api/portfolio/volume_ts_itemized?date_from=2024-07-01&date_to=2024-07-05' \
-H 'accept: application/json' \
-H "Authorization: Bearer $YUKKA_TOKEN" \
-d '["company:apple", "company:sap"]'
Return type
JSON
Example Response
{"volume_ts_itemized":[{"entity_info":{"type":"company","alpha_id":"apple","compound_key":"company:apple"},"volume_ts":[{"volume":6524,"date":"2024-07-01"},{"volume":6424,"date":"2024-07-02"},{"volume":5576,"date":"2024-07-03"},{"volume":3794,"date":"2024-07-04"}]},{"entity_info":{"type":"company","alpha_id":"sap","compound_key":"company:sap"},"volume_ts":[{"volume":314,"date":"2024-07-01"},{"volume":266,"date":"2024-07-02"},{"volume":216,"date":"2024-07-03"},{"volume":227,"date":"2024-07-04"}]}],"used_cache":true,"cache_key":"auto_cache_volume_ts_itemized_v2_3452f165762b7fa23f8871684ace95b0cbd56ebe24f20de58f79283d0a26a029","last_updated":"2024-07-25T09:24:59.874356+00:00"}
import requests
import os
import pandas as pd
# getting the data
headers = {'Authorization': f'Bearer {os.environ["YUKKA_TOKEN"]}'}
url = f'https://data.api.yukkalab.com/9-3-5/2023-12-13-0/v2/api/portfolio/volume_ts_itemized?date_from=2024-07-01&date_to=2024-07-05'
json_data = ['company:apple', "company:sap"]
data = requests.post(url, headers=headers, json=json_data).json()
# transform into dict of dataframes:
results = {}
for events in data['volume_ts_itemized']:
df = pd.DataFrame(events['volume_ts'])
results[events['entity_info']['compound_key']] = df
print(results)
Return type
Dict[str, pd.DataFrame(columns=[date, volume])]
Example Response
{'company:apple': volume date
0 6524 2024-07-01
1 6424 2024-07-02
2 5576 2024-07-03
3 3794 2024-07-04, 'company:sap': volume date
0 314 2024-07-01
1 266 2024-07-02
2 216 2024-07-03
3 227 2024-07-04}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| 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;] |
Authorization
JSON Web Token. Issued by Yukka.
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |