Skip to content
Get started
Getting started

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.

All API requests are made to:

https://platform.labric.co/api

Authenticate by including your API key as a Bearer token in the Authorization header:

Terminal window
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.

  1. Log in to Labric
  2. Go to Settings > API Keys
  3. Click New, give your key a name, and select the scopes you need
  4. Copy the key immediately — it won’t be shown again

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()
ResourceDescription
FilesUpload, list, and download files from your organization
DatasetsQuery structured experimental data
JobsCreate and execute automated Python scripts
InstrumentsManage paired lab instruments and devices
ExperimentsOrganize and retrieve experiment metadata
DashboardsBuild 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 variableDescription
LABRIC_API_KEYEphemeral API key scoped to read + write
LABRIC_API_BASE_URLAPI base URL
LABRIC_JOB_EXECUTION_IDCurrent execution ID
LABRIC_ORGANIZATION_IDYour organization ID
LABRIC_FILE_DIRDirectory containing input files
LABRIC_FILE_COUNTNumber of input files
LABRIC_FILE_ID_<N>File ID for each input file
LABRIC_FILE_PATH_<N>File path for each input file