Skip to main content
Many actions and workflows available in the Labelbox app can be automated using the Python SDK, which provides access to the Labelbox API.

Requirements

  • Make sure pip is installed and up-to-date.
  • Use the Workspace settings menu of the Labelbox app to create an API key. Store your key in a safe place, as you cannot view it after it has been created.
  • Python: 3.9 - 3.13

Install or upgrade SDK

After you create an API key, you can start using our Python SDK. To install, run either pip install labelbox orpip install "labelbox[data]" in your command line.
To upgrade to the latest version, use your package manager: pip install --upgrade labelbox To run the Python SDK in a Docker container, use the included Dockerfile as a starting place. Related info:

Authentication

You need an API key to authenticate your client. You can:
  • Save your key to an environment variable:
    Then, import and initialize the API Client.
  • Paste your API key directly into your script (not recommended)
Remember that your API key authorizes access to Labelbox, your account, and your data assets; treat it as carefully as any other set of credentials, and make sure the scope of the key is set according to the usage is meant for.