Skip to navigation

Getting Started with the V3 Python SDK

Install, authenticate, and make your first request with the Benchling V3 Python SDK.

The Benchling V3 Python SDK provides typed access to the Benchling V3 API from Python.

V3 SDK vs. V2 SDK

This is the SDK for Benchling’s V3 API. It is a separate package (benchling-v3-sdk-python) from the V2 benchling-sdk. Install the one that matches the API version you are calling.

Installation

pip install benchling-v3-sdk-python

Authenticate

You can authenticate with either an API key or OAuth client credentials.

To use an API key, get one from your Benchling account settings:

from benchling_v3_sdk import Benchling
benchling = Benchling(
base_url="https://yourcompany.benchling.com",
api_key="<your-api-key>",
early_access="true",
)

To use OAuth client credentials, create an app to generate a client ID and secret:

from benchling_v3_sdk import Benchling
benchling = Benchling(
base_url="https://yourcompany.benchling.com",
client_id="<your-client-id>",
client_secret="<your-client-secret>",
early_access="true",
)

Pass early_access="true" to either client to enable beta endpoints.

Make a request

Now make a request. For example, to list DNA sequences:

for dna_sequence in benchling.dna_sequence.list():
print(dna_sequence.id, dna_sequence.name)

Next steps

  • For code walkthroughs of the interactions you’re most likely to need, including pagination, async tasks, error handling, and retries, see Common SDK Interactions and Examples.
  • For the full set of resources and methods that the SDK exposes, see the API reference.

Support

For questions or issues, contact support@benchling.com.