API Reference
Genocode.ai exposes a simple REST API. All requests require an X-API-Key header.
POST
/api/v1/analyzeSubmit 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}.htmlRetrieve 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
| Code | Meaning |
|---|---|
| 200 | Success |
| 202 | Job accepted |
| 400 | Invalid request |
| 401 | Missing or invalid API key |
| 404 | Not found |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Job Status Values
| Status | Description |
|---|---|
| pending | Job queued, not yet started |
| running | Analysis in progress |
| completed | Report ready — URLs populated |
| failed | Error occurred |