Scores
The following endpoints retrieve daily Scores for a company.
The Scores are based on the Events, whose weight and impact change, depending on the score type.
Score Ts
Returns the Score timeseries of an entity for a specific score.
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/score_ts?date_from=2024-07-01&date_to=2024-07-05&score_type=esg&lang=de&lang=en&disable_industry_materiality=True' \
-H 'accept: application/json' \
-H "Authorization: Bearer $YUKKA_TOKEN"
Return type
JSON
Example Response
{"score_ts":[{"score":1.0002195595279455,"date":"2024-07-01"},{"score":0.9931755834846335,"date":"2024-07-02"},{"score":0.9734146092138343,"date":"2024-07-03"},{"score":0.9450486432939865,"date":"2024-07-04"}],"score_ts_last_score":{"score":0.9450486432939865,"date":"2024-07-04"},"used_cache":true,"cache_key":"auto_cache_score_ts_43e9823052030988f847db6518061adfbe3c88aad0ca3f5952fcd54cd0c941eb"}
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/score_ts?score_type=esg&date_from=2024-07-01&date_to=2024-07-05'
data = requests.get(url, headers=headers).json()
# transform into dataframe:
df = pd.DataFrame(data['score_ts'])
print(df)
Return type
pd.DataFrame(columns=[date, score])
Example Response
score date
0 1.000220 2024-07-01
1 0.993176 2024-07-02
2 0.973415 2024-07-03
3 0.945049 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;] |
| score_type | str | Which score type to compute. One of [esg, general_risk, e_standard, s_standard, g_standard, esg_risk, immediate_risk, credit_watch] | [optional][default to general_risk] |
| lang | List[str] | Which languages of news type to compute. One of [en, de, zh, ru, it, fr, es]. The languages zh, ru, it, fr, es are in beta | [optional][default to [en, de, zh, ru, it, fr, es ]] |
| disable_industry_materiality | bool | Only applicable when score_type="esg". When True, don't use industry specific ESG weights, rather use general ESG weights | [optional][default to False] |
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 | - |
Score Ts Itemized
Returns the Score 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/score_ts_itemized?date_from=2024-07-01&date_to=2024-07-05&score_type=esg&disable_industry_materiality=True' \
-H 'accept: application/json' \
-H "Authorization: Bearer $YUKKA_TOKEN" \
-d '["company:apple", "company:sap"]'
Return type
JSON
Example Response
{"score_ts_itemized":[{"score_ts":[{"score":1.0002195595279455,"date":"2024-07-01"},{"score":0.9931755834846335,"date":"2024-07-02"},{"score":0.9734146092138343,"date":"2024-07-03"},{"score":0.9450486432939865,"date":"2024-07-04"}],"score_ts_last_score":{"score":0.9450486432939865,"date":"2024-07-04"},"used_cache":true,"cache_key":"auto_cache_score_ts_43e9823052030988f847db6518061adfbe3c88aad0ca3f5952fcd54cd0c941eb","last_updated":"2024-07-25T09:04:39.962364+00:00","entity_info":{"type":"company","alpha_id":"apple","compound_key":"company:apple"}},{"score_ts":[{"score":2.1719072624708313,"date":"2024-07-01"},{"score":2.264101607842854,"date":"2024-07-02"},{"score":2.0952682073503714,"date":"2024-07-03"},{"score":2.016748091132656,"date":"2024-07-04"}],"score_ts_last_score":{"score":2.016748091132656,"date":"2024-07-04"},"entity_info":{"type":"company","alpha_id":"sap","compound_key":"company:sap"},"used_cache":true,"cache_key":"auto_cache_score_ts_de4c68f7868be3641cd6b12b7fc22e58f47c0d78b9505bfc98005849c19e510e","last_updated":"2024-07-25T09:04:39.962279+00:00"}]}
# 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/score_ts_itemized?score_type=esg&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['score_ts_itemized']:
df = pd.DataFrame(events['score_ts'])
results[events['entity_info']['compound_key']] = df
print(results)
Return type
Dict[str, pd.DataFrame(columns=[date, score])]
Example Response
{'company:apple':
score date
0 1.000220 2024-07-01
1 0.993176 2024-07-02
2 0.973415 2024-07-03
3 0.945049 2024-07-04,
'company:sap':
score date
0 2.171907 2024-07-01
1 2.264102 2024-07-02
2 2.095268 2024-07-03
3 2.016748 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;] |
| score_type | str | Which score type to compute. One of [esg, general_risk, e_standard, s_standard, g_standard, esg_risk, immediate_risk, credit_watch] | [optional][default to general_risk] |
| lang | List[str] | Which languages of news type to compute. One of [en, de, zh, ru, it, fr, es]. The languages zh, ru, it, fr, es are in beta | [optional][default to [en, de, zh, ru, it, fr, es ]] |
| disable_industry_materiality | bool | Only applicable when score_type="esg". When True, don't use industry specific ESG weights, rather use general ESG weights | [optional][default to False] |
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 | - |