Get list of all bonuses issued

Get all the bonuses you issued in Toloka.

Steps to follow

1. Import Toloka-Kit

Connect the Toloka-Kit library to your script.

import toloka.client as toloka

2. Instantiate TolokaClient

Replace the sample API key with your own one.

toloka_client = toloka.
TolokaClient
('PlaceYourRealApiKey_Here', 'PRODUCTION');

3. Print bonus IDs, public titles, and amount

Iterate through all the bonuses calling the get_user_bonuses() method.

for bonus in toloka_client.
get_user_bonuses
():

print(bonus.id, bonus.public_title.get('EN'), bonus.amount)

You should get an output with the bonus IDs, public titles, and amount which looks like this.

3139 Perfect job! 0.500
3258 Completed much faster than others 1.000

Complete code: Get list of all bonuses issued

import toloka.client as toloka
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')
for bonus in toloka_client.get_user_bonuses():
print(bonus.id, bonus.public_title.get('EN'), bonus.amount)
List of classes and methods used in this recipe

See also

Last updated: February 7, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming