Events
The following endpoints retrieves daily Events a company was involved in.
The columns of the response are the Event names for the events the company was involed in.
Events Ts
Returns the Events 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/v2/api/company/apple/events_ts?date_from=2024-07-01&date_to=2024-07-05&temporality=FUTURE&factuality=FACT' \
-H 'accept: application/json' \
-H "Authorization: Bearer $YUKKA_TOKEN"
Return type
JSON
Example Response
{"events_ts":[{"date":"2024-07-01","count":2,"sub_event":{"type":"sub_event","id":"E10_A","name":"Production Increase"}},{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E13_A","name":"Restructure/Job Cuts"}},{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E17_C","name":"Data Breach"}},{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E17_D","name":"Data Security Improvement"}},{"date":"2024-07-01","count":14,"sub_event":{"type":"sub_event","id":"E19_B","name":"Strategic Alliance"}},{"date":"2024-07-01","count":57,"sub_event":{"type":"sub_event","id":"E2_A","name":"Product Launch"}},{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E2_B","name":"Product Cancellation/Delay"}},{"date":"2024-07-01","count":11,"sub_event":{"type":"sub_event","id":"E2_C","name":"Product Launch Announcement"}},{"date":"2024-07-01","count":4,"sub_event":{"type":"sub_event","id":"E34_E","name":"Green Steel Development"}},{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E53_A","name":"Lawsuit"}},{"date":"2024-07-01","count":3,"sub_event":{"type":"sub_event","id":"E53_B","name":"Investigation"}},{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E6_B","name":"Acquisition"}},{"date":"2024-07-01","count":2,"sub_event":{"type":"sub_event","id":"E9_B","name":"Sales Volume Decrease"}},{"date":"2024-07-02","count":23,"sub_event":{"type":"sub_event","id":"E19_B","name":"Strategic Alliance"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E1_A","name":"QF Reporting Growth"}},{"date":"2024-07-02","count":30,"sub_event":{"type":"sub_event","id":"E2_A","name":"Product Launch"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E2_B","name":"Product Cancellation/Delay"}},{"date":"2024-07-02","count":7,"sub_event":{"type":"sub_event","id":"E2_C","name":"Product Launch Announcement"}},{"date":"2024-07-02","count":22,"sub_event":{"type":"sub_event","id":"E33_B","name":"Decarbonisation"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E34_A","name":"Energy Efficiency"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E41_A","name":"Stock Price Up"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E53_A","name":"Lawsuit"}},{"date":"2024-07-02","count":16,"sub_event":{"type":"sub_event","id":"E55_A","name":"Fine"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E5_A","name":"Market Expansion"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E6_C","name":"Share Purchase"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E6_F","name":"Company Spin-off"}},{"date":"2024-07-02","count":5,"sub_event":{"type":"sub_event","id":"E8_B","name":"C-Level and Board Appointments"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E9_A","name":"Sales Volume Increase"}},{"date":"2024-07-03","count":1,"sub_event":{"type":"sub_event","id":"E17_D","name":"Data Security Improvement"}},{"date":"2024-07-03","count":43,"sub_event":{"type":"sub_event","id":"E19_B","name":"Strategic Alliance"}},{"date":"2024-07-03","count":8,"sub_event":{"type":"sub_event","id":"E1_C","name":"QF Announcement"}},{"date":"2024-07-03","count":43,"sub_event":{"type":"sub_event","id":"E2_A","name":"Product Launch"}},{"date":"2024-07-03","count":2,"sub_event":{"type":"sub_event","id":"E2_B","name":"Product Cancellation/Delay"}},{"date":"2024-07-03","count":5,"sub_event":{"type":"sub_event","id":"E2_C","name":"Product Launch Announcement"}},{"date":"2024-07-03","count":1,"sub_event":{"type":"sub_event","id":"E33_A","name":"CO2 Emissions"}},{"date":"2024-07-03","count":1,"sub_event":{"type":"sub_event","id":"E33_B","name":"Decarbonisation"}},{"date":"2024-07-03","count":1,"sub_event":{"type":"sub_event","id":"E47_A","name":"Unethical Business Activity"}},{"date":"2024-07-03","count":14,"sub_event":{"type":"sub_event","id":"E55_A","name":"Fine"}},{"date":"2024-07-03","count":2,"sub_event":{"type":"sub_event","id":"E6_C","name":"Share Purchase"}},{"date":"2024-07-03","count":10,"sub_event":{"type":"sub_event","id":"E8_B","name":"C-Level and Board Appointments"}},{"date":"2024-07-04","count":1,"sub_event":{"type":"sub_event","id":"E17_A","name":"Cyber Attack"}},{"date":"2024-07-04","count":2,"sub_event":{"type":"sub_event","id":"E19_B","name":"Strategic Alliance"}},{"date":"2024-07-04","count":3,"sub_event":{"type":"sub_event","id":"E2_A","name":"Product Launch"}},{"date":"2024-07-04","count":2,"sub_event":{"type":"sub_event","id":"E2_B","name":"Product Cancellation/Delay"}},{"date":"2024-07-04","count":3,"sub_event":{"type":"sub_event","id":"E2_C","name":"Product Launch Announcement"}},{"date":"2024-07-04","count":1,"sub_event":{"type":"sub_event","id":"E5_A","name":"Market Expansion"}},{"date":"2024-07-04","count":2,"sub_event":{"type":"sub_event","id":"E6_B","name":"Acquisition"}},{"date":"2024-07-04","count":1,"sub_event":{"type":"sub_event","id":"E6_C","name":"Share Purchase"}},{"date":"2024-07-04","count":1,"sub_event":{"type":"sub_event","id":"E9_A","name":"Sales Volume Increase"}}],"used_cache":false,"cache_key":"auto_cache_events_ts_v2_eab264e53123ba3f2f8f91c1b81cc85729b280c1327d2febd6eb21477a799193_b5692dcf9a9668820250afe39265f0db902daf4ca6e4960835a6525b9a2d8e56","last_updated":"2024-07-25T09:07:58.805172+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/company/apple/events_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['events_ts'])
df['sub_event'] = df['sub_event'].apply(lambda x: x['name'])
df = df.pivot(index='date', columns='sub_event')['count']
Return type
pd.DataFrame(columns=[date, [events]])
Example Response
date Acquisition Alternative Energy Development ... Waste Treatment/Recycling Workplace Discrimination Workplace Equality
0 2024-07-01 8.0 NaN ... 1.0 8.0 3.0
1 2024-07-02 9.0 1.0 ... NaN 4.0 2.0
2 2024-07-03 3.0 NaN ... 1.0 9.0 1.0
3 2024-07-04 2.0 NaN ... NaN 1.0 1.0
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;] |
| factuality | List[str] | What factuality of events fo consider. One of ["FACT", "UNKNOWN", "POSSIBLE", "COUNTERPROBABLE", "NONE", "COUNTERPOSSIBLE", "COUNTERFACT", "PROBABLE"] | [optional] [default to ["FACT", "UNKNOWN", "POSSIBLE", "COUNTERPROBABLE", "NONE", "COUNTERPOSSIBLE", "COUNTERFACT", "PROBABLE"]] |
| temporality | List[str] | What temporality of events fo consider. One of ["UNKNOWN", "PRESENT", "NONE", "PAST", "FUTURE"] | [optional] [default to ["UNKNOWN", "PRESENT", "NONE", "PAST", "FUTURE"]] |
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 | - |
Events Ts Itemized
Returns the Events timeseries of multiple entities. The columns of the response are the Event_id for the events the company was involed in. see [#TODO: link] for the mapping from event_ids to Event Names.
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/events_ts_itemized?date_from=2024-07-01&date_to=2024-07-05&temporality=FUTURE&factuality=POSSIBLE' \
-H 'accept: application/json' \
-H "Authorization: Bearer $YUKKA_TOKEN" \
-d '["company:apple", "company:sap"]'
Return type
JSON
Example Response
{"events_ts_itemized":[{"events_ts":[{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E10_A","name":"Production Increase"}},{"date":"2024-07-01","count":10,"sub_event":{"type":"sub_event","id":"E19_B","name":"Strategic Alliance"}},{"date":"2024-07-01","count":21,"sub_event":{"type":"sub_event","id":"E2_A","name":"Product Launch"}},{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E41_A","name":"Stock Price Up"}},{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E41_B","name":"Stock Price Down"}},{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E42_A","name":"Reorganization"}},{"date":"2024-07-01","count":3,"sub_event":{"type":"sub_event","id":"E45_C","name":"Strategic Expenditure Cut"}},{"date":"2024-07-01","count":1,"sub_event":{"type":"sub_event","id":"E6_B","name":"Acquisition"}},{"date":"2024-07-01","count":3,"sub_event":{"type":"sub_event","id":"E9_A","name":"Sales Volume Increase"}},{"date":"2024-07-02","count":6,"sub_event":{"type":"sub_event","id":"E19_B","name":"Strategic Alliance"}},{"date":"2024-07-02","count":13,"sub_event":{"type":"sub_event","id":"E2_A","name":"Product Launch"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E2_B","name":"Product Cancellation/Delay"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E2_C","name":"Product Launch Announcement"}},{"date":"2024-07-02","count":2,"sub_event":{"type":"sub_event","id":"E45_C","name":"Strategic Expenditure Cut"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E53_A","name":"Lawsuit"}},{"date":"2024-07-02","count":5,"sub_event":{"type":"sub_event","id":"E55_A","name":"Fine"}},{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E9_B","name":"Sales Volume Decrease"}},{"date":"2024-07-03","count":5,"sub_event":{"type":"sub_event","id":"E2_A","name":"Product Launch"}},{"date":"2024-07-03","count":2,"sub_event":{"type":"sub_event","id":"E2_C","name":"Product Launch Announcement"}},{"date":"2024-07-03","count":1,"sub_event":{"type":"sub_event","id":"E5_A","name":"Market Expansion"}},{"date":"2024-07-03","count":2,"sub_event":{"type":"sub_event","id":"E6_B","name":"Acquisition"}},{"date":"2024-07-03","count":5,"sub_event":{"type":"sub_event","id":"E9_A","name":"Sales Volume Increase"}},{"date":"2024-07-04","count":1,"sub_event":{"type":"sub_event","id":"E19_B","name":"Strategic Alliance"}},{"date":"2024-07-04","count":4,"sub_event":{"type":"sub_event","id":"E2_A","name":"Product Launch"}},{"date":"2024-07-04","count":4,"sub_event":{"type":"sub_event","id":"E5_A","name":"Market Expansion"}}],"entity_info":{"type":"company","alpha_id":"apple","compound_key":"company:apple"},"used_cache":true,"cache_key":"auto_cache_events_ts_v2_eab264e53123ba3f2f8f91c1b81cc85729b280c1327d2febd6eb21477a799193_c3943c91e51d1336ac38f908644322679c01fb1fb672c12522cf17bd0e5280c1","last_updated":"2024-07-25T09:04:38.834903+00:00"},{"events_ts":[{"date":"2024-07-02","count":1,"sub_event":{"type":"sub_event","id":"E41_A","name":"Stock Price Up"}},{"date":"2024-07-04","count":1,"sub_event":{"type":"sub_event","id":"E41_B","name":"Stock Price Down"}}],"entity_info":{"type":"company","alpha_id":"sap","compound_key":"company:sap"},"used_cache":true,"cache_key":"auto_cache_events_ts_v2_eab264e53123ba3f2f8f91c1b81cc85729b280c1327d2febd6eb21477a799193_eb9a9bcfc327617298f94090603e769273d93b97791755f0ed720a06cd463f23","last_updated":"2024-07-25T09:04:38.834870+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/events_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['events_ts_itemized']:
df = pd.DataFrame(events['events_ts'])
df['sub_event'] = df['sub_event'].apply(lambda x: x['name'])
df = df.pivot(index='date', columns='sub_event')['count'].reset_index().rename_axis(None, axis=1)
results[events['entity_info']['compound_key']] = df
print(results)
Return type
Dict[str, pd.DataFrame(columns=[date, [events]])]
Example Response
{'company:sap':
date Acquisition Buy Rating Hold Rating IPO ... Strategic Alliance Target Price Target Price Downgrade Target Price Upgrade Workplace Equality
0 2024-07-01 1.0 37.0 7.0 NaN ... 27.0 9.0 5.0 9.0 1.0
1 2024-07-02 1.0 46.0 5.0 NaN ... 5.0 8.0 2.0 11.0 NaN
2 2024-07-03 NaN 1.0 NaN NaN ... NaN NaN NaN NaN NaN
3 2024-07-04 NaN 10.0 NaN 1.0 ... 3.0 4.0 NaN 3.0 NaN
, 'company:apple':
date Acquisition Alternative Energy Development ... Waste Treatment/Recycling Workplace Discrimination Workplace Equality
0 2024-07-01 8.0 NaN ... 1.0 8.0 3.0
1 2024-07-02 9.0 1.0 ... NaN 4.0 2.0
2 2024-07-03 3.0 NaN ... 1.0 9.0 1.0
3 2024-07-04 2.0 NaN ... NaN 1.0 1.0
}
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;] |
| factuality | List[str] | What factuality of events fo consider. One of ["FACT", "UNKNOWN", "POSSIBLE", "COUNTERPROBABLE", "NONE", "COUNTERPOSSIBLE", "COUNTERFACT", "PROBABLE"] | [optional] [default to ["FACT", "UNKNOWN", "POSSIBLE", "COUNTERPROBABLE", "NONE", "COUNTERPOSSIBLE", "COUNTERFACT", "PROBABLE"]] |
| temporality | List[str] | What temporality of events fo consider. One of ["UNKNOWN", "PRESENT", "NONE", "PAST", "FUTURE"] | [optional] [default to ["UNKNOWN", "PRESENT", "NONE", "PAST", "FUTURE"]] |
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 | - |