Genocode.ai

API Reference

Genocode.ai exposes a simple REST API. All requests require an X-API-Key header.

POST/api/v1/analyze

Submit a new analysis job. Returns a job ID for status polling.

Request Body

{
  "rsids": ["rs429358", "rs7412", "rs1801133"],
  "top_n": 3
}

Response

{
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "pending"
}

Example

curl -X POST https://api.genocode.ai/api/v1/analyze \
  -H "Content-Type: application/json" \
  -H "X-API-Key: geno_YOUR_KEY" \
  -d '{"rsids": ["rs429358", "rs7412"], "top_n": 3}'
GET/api/v1/jobs/{id}

Check the status and progress of an analysis job. Poll every 2 seconds until status is 'completed' or 'failed'.

Response

{
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "running",
  "progress": 45,
  "progress_message": "Annotating variants (7/15)...",
  "report_html_url": null,
  "report_pdf_url": null,
  "error": null,
  "candidates_count": 0,
  "targets_count": 0
}

Example

curl https://api.genocode.ai/api/v1/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "X-API-Key: geno_YOUR_KEY"
GET/api/v1/reports/{id}.html

Retrieve the completed HTML report. Also available as PDF at /api/v1/reports/{id}.pdf.

Response

(HTML document)

Example

# HTML report
curl https://api.genocode.ai/api/v1/reports/a1b2c3d4.html \
  -H "X-API-Key: geno_YOUR_KEY" -o report.html

# PDF report
curl https://api.genocode.ai/api/v1/reports/a1b2c3d4.pdf \
  -H "X-API-Key: geno_YOUR_KEY" -o report.pdf

Status Codes

CodeMeaning
200Success
202Job accepted
400Invalid request
401Missing or invalid API key
404Not found
429Rate limit exceeded
500Internal server error

Job Status Values

StatusDescription
pendingJob queued, not yet started
runningAnalysis in progress
completedReport ready — URLs populated
failedError occurred