Get list of tasks

Get all the tasks in the pool with the ID specified in the request.

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 task IDs, creation date, and overlap

Find out the ID of the pool you want to view the tasks in. Then, iterate through all the tasks in the pool calling the get_tasks() method.

for task in toloka_client.
get_tasks
(pool_id='1227652'):

print(task.id, task.created.date(), task.overlap)

You should get an output with the skill IDs, names, and private comments which looks like this.

00022da5a7--6388b40547c84000494cdc58 2022-12-01 3
00022da5a7--6388b40547c84000494cdc59 2022-12-01 3
00022da5a7--6388b40547c84000494cdc5a 2022-12-01 5
00022da5a7--6388b40547c84000494cdc5b 2022-12-01 3
00022da5a7--6388b40547c84000494cdc60 2022-12-01 3
00022da5a7--6388b40547c84000494cdc6b 2022-12-01 3

Complete code: Get list of tasks

import toloka.client as toloka
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')
for task in toloka_client.get_tasks(pool_id='1227652'):
print(task.id, task.created.date(), task.overlap)
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