import requests
url = "https://app.strandai.com/api/v1/samples"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://app.strandai.com/api/v1/samples \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.strandai.com/api/v1/samples', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.strandai.com/api/v1/samples",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.strandai.com/api/v1/samples"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.strandai.com/api/v1/samples")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.strandai.com/api/v1/samples")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"ownership": "mine",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"filename": "<string>",
"status": "<string>",
"fileSize": "<string>",
"fields": {},
"createdAt": "2023-11-07T05:31:56Z",
"appUrl": "<string>"
}
],
"nextCursor": "<string>",
"appUrl": "<string>"
}{
"error": "<string>",
"message": "<string>",
"required": 123,
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"required": 123,
"retryAfterSeconds": 123
}List samples
List the calling organization’s samples, the public cohort, or both. Cursor-paginated newest-first; all always emits mine first and de-duplicates owned public samples in favor of the mine representation. Credit-free.
The facet parameters are byte-identical to the ones the Strand web app puts in a filtered /samples URL, so a browser query string is a valid API query string and vice versa. Facets compose with AND; status and workflow values compose with OR; repeated marker and field values compose with AND. Tags is addressed through the predefined Tags field definition. The retired tag parameter is rejected with 400 rather than ignored. Unknown values, malformed clauses and over-cap arrays are also rejected.
A public release supports title search (q) only. Under scope=all any other facet suppresses the public block; under scope=public it is a 400.
import requests
url = "https://app.strandai.com/api/v1/samples"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://app.strandai.com/api/v1/samples \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.strandai.com/api/v1/samples', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.strandai.com/api/v1/samples",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.strandai.com/api/v1/samples"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.strandai.com/api/v1/samples")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.strandai.com/api/v1/samples")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"ownership": "mine",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"filename": "<string>",
"status": "<string>",
"fileSize": "<string>",
"fields": {},
"createdAt": "2023-11-07T05:31:56Z",
"appUrl": "<string>"
}
],
"nextCursor": "<string>",
"appUrl": "<string>"
}{
"error": "<string>",
"message": "<string>",
"required": 123,
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"required": 123,
"retryAfterSeconds": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
mine, public, all 1 <= x <= 100Opaque cursor returned as nextCursor; not bound to page size.
1Case-insensitive substring match against the sample's display name or filename. The only facet a public release can answer.
1 - 200Repeatable lifecycle-status filter. Values compose with OR.
5ready, preprocessing, uploading, upload_failed, preprocess_failed Inclusive lower bound on upload date in years 0001-9999, as a UTC calendar day. Must not be later than uploaded_to.
^(?!0000-)\d{4}-\d{2}-\d{2}$Inclusive upper bound on upload date in years 0001-9999, as a UTC calendar day: the whole day is matched.
^(?!0000-)\d{4}-\d{2}-\d{2}$Repeatable run-state filter: ready_no_job (preprocessed, never submitted), in_flight (a non-terminal job exists), has_results (a completed marker prediction exists). Values compose with OR.
3ready_no_job, in_flight, has_results Repeatable per-marker state filter of the form NAME:state, where state is requested or completed. Marker names cannot contain : or ,. Values compose with AND.
20^[^,:]{1,100}:(requested|completed)$Repeatable custom-field filter of the form DEFINITION_UUID:op[:VALUE]. op is one of eq, contains, gte, lte, is_empty, is_not_empty; the first four carry a value that is JSON-encoded and then URL-encoded (so "high", 3, true). Operators are checked against the definition's type. Org-defined fields have no meaning on the public cohort. Under scope=all a field facet returns matching organization-owned samples and suppresses public rows; under scope=public it is rejected. Values compose with AND.
20^[0-9a-fA-F-]{36}:(eq|contains|gte|lte)(:.+)$|^[0-9a-fA-F-]{36}:(is_empty|is_not_empty)$Was this page helpful?