Python SDK FAQ

Alex Cota Updated by Alex Cota

These are some common questions users have when they are learning the capabilities of our Python SDK.

What should I do when I hit my API rate limit?

When the user attempts too many requests to the API within a short timeframe, the API will raise an ApiLimitError exception. Our support engineers recommend that you implement your own retry logic if this happens. However, if you have hit the 500 API calls per minute per user, consider making fewer calls to the API.

If you hit the rate limit, you’ll get a 429 status code and a retry-after response header that will contain a value for the number of seconds to wait before making a follow-up request.

Can I customize my queue/set prioritization?

Yes. To learn how to customize the order of the data rows in a queue, see Project.set_labeling_parameter_overrides(self, data) in our API reference. For a detailed explanation of how queue customization works in Labelbox, see Queue system.

Can I re-enqueue Labels?

This can be done with Label.bulk_delete(). It will automatically re-enqueue the labels. For instructions on how to do this with the GraphQL API, see Re-enqueue labels programmatically.

How can I sort the Labelbox objects I get from the API?

One-to-many relationship fetches can be sorted by calling a relationship and providing passing a value for order_by. You can only sort one field at a time in ascending or descending order. Currently, it's not possible to automatically sort top-level collections (such as Client.get_projects()) in a fetch. The example below fetches and alphabetically sorts in ascending order the datasets from a specified project.

project = client.get_project("<project_id>")
sorted_datasets = project.datasets(
If your Python SDK does not have the method I’m looking for, can I write my own custom GraphQL queries?

You can write your own custom GraphQL queries using Client.execute().

Can I add users with the Python API?

A method for adding users (in bulk or individually) to a project or an organization does not exist in the Python SDK.

If you are looking for a particular functionality that has not been mentioned in this page or previous pages in this section, please take a look at our comprehensive Python API reference.

Was this page helpful?

General concepts

API reference