Get list of pools

Get the list of the pools with the CLOSED status in your project.

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. List pools

Find out the ID of the project for which you want to get all the pools with the CLOSED status. Then iterate through all the pools calling the get_pools() method.

for pool in toloka_client.
get_pools
(project_id='118252', status='CLOSED'):

print(pool.id, pool.status, pool.private_name)

You should get an output that contains the IDs of the pools, their statuses, and private names. It will look like this.

36502086 Status.CLOSED Pool 1
36756115 Status.CLOSED Pool 2

Complete code: Get list of pools

import toloka.client as toloka
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')
for pool in toloka_client.get_pools(project_id='118252', status='CLOSED'):
print(pool.id, pool.status, pool.private_name)
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