API Reference

API Reference

Start the server:

srake server --port 8080

All endpoints are prefixed with /api/v1/.


Search

GET /api/v1/search

Query parameters:

ParameterTypeDescription
q / querystringSearch query
limitintMax results (default: 20)
offsetintSkip N results
organismstringFilter by organism
library_strategystringFilter by library strategy
platformstringFilter by platform
similarity_thresholdfloatVector similarity threshold (0.0-1.0)
min_scorefloatMinimum BM25 score
show_confidenceboolInclude confidence scores
mode / search_modestringSearch mode: text, vector, hybrid, database
formatstringResponse format
curl "http://localhost:8080/api/v1/search?q=cancer&limit=10"
curl "http://localhost:8080/api/v1/search?q=RNA-Seq&organism=homo+sapiens&platform=ILLUMINA"

POST /api/v1/search/advanced

Accepts a JSON body with the same parameters as the search query.


Studies

GET /api/v1/studies

List studies with pagination. Parameters: limit (max 100, default 20), offset.

GET /api/v1/studies/{accession}

Get a single study by accession.

GET /api/v1/studies/{accession}/metadata

Get the full metadata graph for a study (experiments, samples, runs, summary counts).

GET /api/v1/studies/{accession}/experiments

List experiments for a study.

GET /api/v1/studies/{accession}/samples

List samples for a study.

GET /api/v1/studies/{accession}/runs

List runs for a study. Parameter: limit.


Experiments, Samples, Runs

GET /api/v1/experiments/{accession}

Get experiment by accession.

GET /api/v1/samples/{accession}

Get sample by accession.

GET /api/v1/runs/{accession}

Get run by accession.


Statistics

GET /api/v1/stats

Database-wide counts (studies, experiments, samples, runs).

GET /api/v1/stats/organisms

Organism distribution with counts.

GET /api/v1/stats/platforms

Platform distribution with counts.

GET /api/v1/stats/strategies

Library strategy distribution with counts.


Export

POST /api/v1/export

Export search results. JSON body with query, format (json, csv, tsv, xml, jsonl), filters, limit.


Health

GET /api/v1/health

{"status": "healthy", "database": "ok", "timestamp": "2025-01-15T10:30:00Z"}

MCP (Model Context Protocol)

MCP support is available via the srake mcp command, which runs a stdio-based MCP server compatible with Claude Desktop, VS Code, and other MCP clients.

See srake mcp in the CLI reference for configuration details.