Gene2AI Genomics Analysis API — Integrate AI-powered genetic analysis into your applications.
https://gene2aiapi-mjdnfevz.manus.spaceAll REST endpoints are accessible at this base URL. Use /api/upload-url and /api/query-result for production.
All API calls require HMAC-MD5 authentication via HTTP Headers. Three headers are required:
idVerify ID — "UP02" for upload, "GE01" for querytokenHMAC-MD5 token (16 hex chars)timeUTC time string in format "YYYY-MM-DD HH:MM"# Token = md5(verify_id + secret + time)[4:20]
# Time format: "YYYY-MM-DD HH:MM" (UTC)
import hashlib
from datetime import datetime, timezone
verify_id = "UP02"
secret = "your_secret_here"
time_str = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M")
raw = f"{verify_id}{secret}{time_str}"
full_hash = hashlib.md5(raw.encode()).hexdigest()
token = full_hash[4:20] # 16 hex charsCreates an analysis job and returns an upload URL for the genetic data file.
id: UP02
token: a1b2c3d4e5f6g7h8
time: 2026-03-02 14:30
Content-Type: application/json{
"key": "gene2ai_user12345_1709389800",
"type": "txt", // "txt" | "zip"
"format": "23andme" // "23andme" | "ancestry"
}{
"code": 0,
"msg": "success",
"data": {
"key": "gene2ai_user12345_1709389800",
"url": "https://api.gene2.ai/api/genomics/upload/gene2ai_user12345_..."
}
}code: 0Job created successfullycode: 1HMAC token validation failedcode: 2key, type, or format missingcode: 3Unsupported format or type valuecurl -X POST 'https://gene2aiapi-mjdnfevz.manus.space/api/upload-url' \
-H 'Content-Type: application/json' \
-H 'id: UP02' \
-H 'token: YOUR_TOKEN' \
-H 'time: 2026-03-02 14:30' \
-d '{
"key": "gene2ai_user12345_1709389800",
"type": "txt",
"format": "23andme"
}'The analysis result contains five categories of findings, each enriched by our LLM layer for user-friendly descriptions.
health_risksFields: condition, risk, confidence, snps, description
Values: low | average | slightly_elevated | elevated | high
drug_responseFields: drug, sensitivity, gene, recommendation, snps
Values: normal | increased | reduced
traitsFields: trait, value, confidence, snps
Values: confidence: 0.0–1.0
nutritionFields: nutrient, need, confidence, snps
Values: decreased | normal | increased
ancestryFields: regions[].region, regions[].percentage
Values: percentage: 0–100
import hashlib, time, requests
from datetime import datetime, timezone
BASE_URL = "https://gene2aiapi-mjdnfevz.manus.space"
def make_token(verify_id, secret):
t = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M")
raw = f"{verify_id}{secret}{t}"
h = hashlib.md5(raw.encode()).hexdigest()
return h[4:20], t
# Step 1: Request upload URL
token, time_str = make_token("UP02", "your_upload_secret")
resp = requests.post(f"{BASE_URL}/api/upload-url",
headers={
"Content-Type": "application/json",
"id": "UP02",
"token": token,
"time": time_str
},
json={
"key": "gene2ai_user001_" + str(int(time.time())),
"type": "txt",
"format": "23andme"
}
)
data = resp.json()
assert data["code"] == 0
job_key = data["data"]["key"]
upload_url = data["data"]["url"]
# Step 2: Upload the file
with open("genome_data.txt", "rb") as f:
requests.put(upload_url, data=f.read(),
headers={"Content-Type": "text/plain"})
# Step 3: Poll for results
while True:
token, time_str = make_token("GE01", "your_query_secret")
resp = requests.post(f"{BASE_URL}/api/query-result",
headers={
"Content-Type": "application/json",
"id": "GE01",
"token": token,
"time": time_str
},
json={"key": job_key}
)
result = resp.json()
status = result["data"]["status"]
if status in ("succeeded", "failed"):
print(result["data"]["result"])
break
time.sleep(5)