Labguru API provides create/read/update/delete access to almost all data in Labguru via REST endpoints with JSON response.

The API doc page contains all the currently available endpoints, as well as examples and a "Try it out" on page option to start testing immediately.

Please note that tests done on the document page are real requests and those will be performed on your workspace (from which the token was issued or the one you are logged in to in the browser).

We are continuously developing this document, and changes are performed based on our user's feedback. Therefore, you are welcome to contact us via [email protected] and join our dedicated Slack channel to be in direct contact with our API team and be informed about the latest updates.

We also provide a python and R wrappers - https://github.com/BioData/LabguruPython

If you would like to work with those libraries, please note that currently there are some examples provided, but not all available endpoints, those are available only in the API document.

How to get started?

You will need to authenticate using your Labguru user+password and an account/workspace number (if you have several). This number can be found in the URL of the Labguru account settings page. If your organization is using an SSO service, you will need to generate a personal token and use it directly in your API requests. To do that, please refer to this article.

You can start exploring and testing endpoints using the document, browse the list or use the search bar to find model names. Click the section to expand it.

Once a successful request has been executed, you can see the result below.

Terminology

Some endpoints will use a slightly different terminology than in the UI, and some do not appear in the UI at all. For more clarification please read below:

Elements โ€” the basic container of content on pages such as experiment/protocol/document/report. There are multiple types of elements, in this image you can see 2 types, some have a name property that can be modified.

Section โ€” called also experiment_procedures in the JSON.

Folders - you will see folders are referred to as milestones in the JSON.

Generic collections/items - Custom collections created by the account admins are referred to as generic collections and items respectively.

Vector - this is one row of a dataset.

Filter list of experiments by project

Now let's talk about added/filters parameters to the call.

This call will get you all the experiments in the account (default page size is 200)

curl https://[domain]/api/v1/experiments.json

In order to add parameters you can add this JSON to the request, it is possible to specify the project ID in this example where is says value

{
"token": "{{ _.token }}",
"kendo": true,
"meta": true,
"page_size": 50,
"page": 1,
"filter":{
"logic":"and",
"filters":{"0":
{"field":"project_id",
"operator":"eq",
"value":"69"}
}
}
}

If you don't know the project ID you can list the projects first. This kind of filter can be applied to all lists.

List all elements of an experiment filtered by type

Parameters can be added to the request as so, in this case we will get all elements of type samples in experiment id = 966

curl https://[domain]/api/v1/experiments/966/elements.json?token={{ token  }}&element_type=samples

Did this answer your question?