Skip to main content

Recipes

Runnable Python scripts that show common integration patterns against the /v1 API. Each is self-contained, depends only on requests, and reads its key from GI_API_KEY. Run any of them directly.

  • Health probe checks that the API is reachable, your key is valid, and the per-task model lists load before you do any other work.
  • Promoters for a gene list fetches each gene's sequence from Ensembl and runs promoter prediction, emitting one BED-style row per detected region.
  • Async annotation polling submits a large annotation job with Prefer: respond-async and polls to completion using HTTP status to discriminate progress from terminal states.
  • Rate-limit-aware retry wraps requests to read the RateLimit-* headers, honour Retry-After on 429, back off on 5xx, and never retry permanent 4xx errors.
  • Typed error handling switches on error.code rather than message text, mapping each documented code to a retryable, permanent, or server-bug bucket with the action to take.

See the error reference and limits for the codes and caps these recipes build on.