POLYMER GENOMICS
Docs·API · MCP · SDK
§ DOCS · API v1 · MCP · Python SDK

Documentation

REST API, Model Context Protocol server, and Python SDK for genome-wide DNA biophysics. Every response carries provenance, evidence class, and content hash.

§ 01

Overview

The Polymer API serves the material channel of the genome — stacking energy, curvature, flexibility, groove geometry — computed at base-pair resolution across 50 layers. Every response includes api_version, data_version, an evidence class (M / K / D / S / H), source URI, license, and a content hash so agents and downstream pipelines can audit and cache.

Base URL
https://api.polymerbio.org
API Version
v1 · stable
SDK
pip install polymer-genomics
§ 02

Quickstart

Install the SDK and fetch your first region. The example uses the TP53 locus on hg38.

bash
pip install polymer-genomics
python
from polymer_genomics import PolymerClient

client = PolymerClient(api_key="POLY_...")

region = client.regions.fetch("hg38", "chr17:7668421-7687490")
print(region.stacking_dg37.mean)            # -8.42 kcal/mol
print(region.cpg_sites.count)                # 47
print(region.evidence_classes)               # {'thermodynamics': 'D', 'cpg_sites': 'K'}

Without an SDK, hit the REST API directly. Use the curl below — any HTTP client works.

bash
curl 'https://api.polymerbio.org/v1/genes/hg38/TP53' \
  -H 'X-API-Key: $POLYMER_API_KEY'
§ 03

Authentication

All requests must include the X-API-Key header. Request a key at polymerbio.org/developers. Free tier: 1,000 requests/day. Rate limits are returned in X-RateLimit-Remaining.

§ 04

Endpoints

Reference endpoints return curated data with provenance. Compute endpoints run the physics linter or aggregate over a region. All responses include data_version and content-hash headers.

Reference

GET/v1/regions/{build}/{region}Region biophysics

Fetch genome-wide biophysics columns for a region. Returns stacking ΔG, melting Tm, curvature, groove geometry, A-form / Z-form propensities at 1 kb resolution.

Parameters
build*path · stringGenome build (hg38 or hg37).
region*path · string1-based closed UCSC region, e.g. chr17:7668421-7687490.
layersquery · stringComma-separated layer ids to include.
curl
curl https://api.polymerbio.org/v1/regions/hg38/chr17:7668421-7687490 \
  -H 'X-API-Key: $POLYMER_API_KEY'
python
from polymer_genomics import PolymerClient

client = PolymerClient(api_key=POLYMER_API_KEY)
region = client.regions.fetch("hg38", "chr17:7668421-7687490")
print(region.stacking_dg37.mean)
GET/v1/genes/{build}/{symbol}Gene profile

Gene-level profile: coordinates, transcripts, constraint metrics, biosynthetic cost, expression context across GTEx tissues.

Parameters
build*path · stringGenome build.
symbol*path · stringHGNC gene symbol or Ensembl ID.
curl
curl https://api.polymerbio.org/v1/genes/hg38/TP53
python
gene = client.genes.fetch("hg38", "TP53")
print(gene.constraint.pli, gene.constraint.loeuf)
GET/v1/aggregation/{build}/{region}Region aggregation

Pre-binned aggregate counts of layer features in a region. Useful for genome-wide overviews. Default bin size: 1 Mb.

Parameters
build*path · stringGenome build.
region*path · stringUCSC region string.
layersquery · stringLayer ids to aggregate.
resolutionquery · integer= 1000000Bin width in bp.
curl
curl 'https://api.polymerbio.org/v1/aggregation/hg38/chr17:1-83257441?layers=cpg_sites'
python
agg = client.aggregation.fetch("hg38", "chr17:1-83257441", layers=["cpg_sites"], resolution=1_000_000)
GET/v1/probes/{build}/{probe_id}Methylation probe

Probe-level metadata for EPIC v2 / v1 / 450K. Returns position, context (island/shore/shelf/open sea), gene overlap, design type.

Parameters
build*path · stringGenome build.
probe_id*path · stringIllumina probe ID, e.g. cg13580121.
curl
curl https://api.polymerbio.org/v1/probes/hg38/cg13580121
python
probe = client.probes.fetch("hg38", "cg13580121")
print(probe.position, probe.context)
GET/v1/layersList layers

List all available data layers with version, license, evidence class, and content hash.

Parameters
buildquery · stringFilter to a single build.
curl
curl https://api.polymerbio.org/v1/layers
python
layers = client.layers.list()
for l in layers:
    print(l.id, l.version, l.evidence_class)

Compute

POST/v1/evaluateSequence evaluation

Physics linter for any DNA sequence. Returns thermodynamic profile, CpG islands, structural form propensities, and 13 anti-hallucination flag codes.

Parameters
sequence*body · stringDNA sequence (ACGTN, ≤ 100 kb).
namebody · stringIdentifier for this run.
analysisbody · string= fullfull | thermodynamics | structural | flags
curl
curl -X POST https://api.polymerbio.org/v1/evaluate \
  -H 'Content-Type: application/json' \
  -d '{"sequence":"ATGCGATCGATCG...","analysis":"full"}'
python
result = client.evaluate("ATGCGATCGATCG...", analysis="full")
print(result.summary.gc_content, result.flag_counts.warnings)
§ 05

MCP for agents

The Model Context Protocol server exposes 70 tools to LLM agents — 38 reference and 32 compute. Connect via stdio for local agents or HTTP/SSE for hosted deployments.

bash
# Local stdio (Claude Desktop, etc.)
uv run polymer-mcp serve

# Hosted HTTP/SSE
polymer-mcp serve --transport sse --port 8050
ToolSignatureDescription
polymer.regions.fetch(build, region, layers?)Genome-wide biophysics for a region.
polymer.genes.fetch(build, symbol)Gene-level profile with constraint metrics.
polymer.probes.fetch(build, probe_id)EPIC v2 / v1 / 450K probe metadata.
polymer.evaluate(sequence, analysis?)Physics linter on a DNA sequence.
polymer.aggregation(build, region, layers, resolution)Pre-binned layer counts.
polymer.search.genes(q, build?)Gene typeahead search.
polymer.clocks.predict(betas, clock)Apply DNAm clock coefficients to a beta matrix.
polymer.transposome.score(region, family?)TE/ERV scoring + awakening propensity.
Showing 8 of 70. See full list at /developers.
§ 06

Errors

All errors return a JSON body with code, message, and optional details. Status codes follow standard HTTP conventions.

StatusCodeDescription
400INVALID_REGIONRegion string does not parse as a UCSC interval.
400INVALID_BUILDBuild must be hg38 or hg37.
400INVALID_SEQUENCESequence contains non-ACGTN characters or is too short.
401MISSING_API_KEYProvide X-API-Key header.
403RATE_LIMITEDRate limit exceeded; retry after Retry-After seconds.
404GENE_NOT_FOUNDNo gene matches the provided symbol or Ensembl ID.
404PROBE_NOT_FOUNDNo probe matches the provided ID for this platform.
413REGION_TOO_LARGERegion exceeds 10 Mb. Use /v1/aggregation for genome-wide views.
422UNSUPPORTED_LAYERLayer is not available for the requested build.
429TOO_MANY_REQUESTSRequest quota for this minute exhausted.
500INTERNAL_ERRORUnexpected server error; transient. Retry with backoff.
504COMPUTE_TIMEOUTQuery exceeded the 30-second compute window.