Getting started

Updated 20 hours ago by Alex Cota

Overview

We created this Python API so you can access all the functionalities of the Labelbox API without having to write GraphQL queries. This documentation will guide you through installation, setup, and some common use cases.

We released beta version 2.2 on Oct 18th, 2019. The Python API supports Python versions 3.6 and 3.7.

Python API features
  • Read, create, and modify objects and object-to-object relationships
  • Simplify your data import with bulk Data Row creation
  • Download a JSON export of labels
  • Prioritize, re-enqueue & adjust the count of labels in the labeling queue
  • Use webhooks with limitations
Future capabilities
  • Import model-assisted predictions

Installation & authentication

Step 1 Create your API key

All users wishing to access the Python API must have an API key for authentication. For instructions on creating a key, see API keys.

Step 2 Install

Install Labelbox using pip.

user@machine:~$ pip install labelbox
Step 3 Authenticate

Pass your API key as an environment variable. Then, import and initialize the API Client.

user@machine:~$ export LABELBOX_API_KEY="<your api key here>"
user@machine:~$ python3

from labelbox import Client
client = Client()

Passing in a custom endpoint is only applicable for on-premises use cases. If this applies to you, you may pass the API key and server endpoint explicitly when you initialize the Client object. Otherwise, refer to the step above.

from labelbox import Client
client = Client("<your api key here>", "https://your-server.com/labelbox/")

Next steps

Now that you have accessed the Labelbox API via the Python client, it is time to create your first project.

Was this section helpful? Give your feedback below.


How did we do?