Introduction
Get started with the Labric API for programmatic access to your data.
Labric is a platform for managing scientific data, lab instruments, and automated analysis workflows. The Labric API gives you programmatic access to your data — query datasets, manage files, trigger jobs, and more.
Base URL
Section titled “Base URL”All API requests are made to:
https://platform.labric.co/apiAuthentication
Section titled “Authentication”Authenticate by including your API key as a Bearer token in the Authorization header:
curl https://platform.labric.co/api/files \ -H "Authorization: Bearer lbk_your_api_key"API keys use the format lbk_<prefix>_<secret>. Each key can be scoped to read, write, or admin permissions.
Getting an API key
Section titled “Getting an API key”- Log in to Labric
- Go to Settings > API Keys
- Click New, give your key a name, and select the scopes you need
- Copy the key immediately — it won’t be shown again
Using the Python SDK
Section titled “Using the Python SDK”If you’re working in a Labric Job, you don’t need to manage keys at all. The environment is pre-configured with a LABRIC_API_KEY and the SDK is available out of the box:
from labric import Labric
client = Labric()Core resources
Section titled “Core resources”| Resource | Description |
|---|---|
| Files | Upload, list, and download files from your organization |
| Datasets | Query structured experimental data |
| Jobs | Create and execute automated Python scripts |
| Instruments | Manage paired lab instruments and devices |
| Experiments | Organize and retrieve experiment metadata |
| Dashboards | Build and manage data visualizations |
See the API Reference for full endpoint documentation.
Jobs let you write Python scripts that run automatically when files are uploaded, or on demand via the API. When a job executes, Labric provisions a sandboxed environment with:
| Environment variable | Description |
|---|---|
LABRIC_API_KEY | Ephemeral API key scoped to read + write |
LABRIC_API_BASE_URL | API base URL |
LABRIC_JOB_EXECUTION_ID | Current execution ID |
LABRIC_ORGANIZATION_ID | Your organization ID |
LABRIC_FILE_DIR | Directory containing input files |
LABRIC_FILE_COUNT | Number of input files |
LABRIC_FILE_ID_<N> | File ID for each input file |
LABRIC_FILE_PATH_<N> | File path for each input file |