{"openapi":"3.1.0","info":{"title":"Population Genetics API","version":"1.0.0","description":"Population-genetics maths as an API, computed locally and deterministically. The hardy-weinberg endpoint applies the Hardy-Weinberg principle, p² + 2pq + q² = 1 — give a dominant allele frequency p, a recessive q, or the homozygous-recessive (affected) frequency q² and it returns all the allele and genotype frequencies, including the carrier frequency 2pq. The punnett endpoint crosses two parent genotypes and returns the offspring genotype and phenotype ratios, handling a single gene (a monohybrid 1:2:1 / 3:1 cross), two genes (a dihybrid 9:3:3:1 cross) and up to four genes by independent assortment. The carrier endpoint takes the incidence of a recessive disease — as a fraction or one-in-N — and returns the recessive allele frequency q = √incidence, the carrier frequency 2pq, the one-in-N carrier rate and, for a given population, the expected number of carriers and affected individuals. Everything is computed locally and deterministically, so it is instant and private. Ideal for genetics-education, genetic-counselling, breeding and biology app developers, inheritance and risk tools, and biology teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is population genetics; for DNA sequence analysis use a DNA API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/genetics-api","description":"oanor gateway"}],"tags":[{"name":"Genetics"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/carrier":{"get":{"operationId":"get_v1_carrier","tags":["Genetics"],"summary":"Carrier frequency","description":"","parameters":[{"name":"incidence","in":"query","required":false,"description":"Affected fraction (q²)","schema":{"type":"string"},"example":"0.0004"},{"name":"one_in","in":"query","required":false,"description":"Or 1 in N affected","schema":{"type":"string"}},{"name":"population","in":"query","required":false,"description":"Population for expected counts","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"For a recessive disease, q = √(affected frequency); the carrier frequency is 2pq. Carriers vastly outnumber the affected.","inputs":{"incidence":0.0004},"carrier_one_in":25.51,"carrier_frequency":0.0392,"affected_frequency":0.0004,"dominant_allele_freq_p":0.98,"recessive_allele_freq_q":0.02},"meta":{"timestamp":"2026-06-05T03:09:02.163Z","request_id":"b6fe5a3f-f49d-4599-97b6-3e44730122ef"},"status":"ok","message":"Carrier frequency","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/hardy-weinberg":{"get":{"operationId":"get_v1_hardy_weinberg","tags":["Genetics"],"summary":"Hardy-Weinberg","description":"","parameters":[{"name":"p","in":"query","required":false,"description":"Dominant allele frequency (0–1)","schema":{"type":"string"},"example":"0.6"},{"name":"q","in":"query","required":false,"description":"Or recessive allele frequency","schema":{"type":"string"}},{"name":"aa_frequency","in":"query","required":false,"description":"Or homozygous-recessive frequency q²","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Hardy-Weinberg: p² + 2pq + q² = 1. q² is the recessive (affected) frequency; 2pq is the carrier frequency.","inputs":{"source":"p"},"heterozygous_Aa":0.48,"carrier_frequency":0.48,"dominant_allele_freq_p":0.6,"homozygous_dominant_AA":0.36,"homozygous_recessive_aa":0.16,"recessive_allele_freq_q":0.4},"meta":{"timestamp":"2026-06-05T03:09:02.263Z","request_id":"59cfb750-e965-490a-958a-1bb749ae33db"},"status":"ok","message":"Hardy-Weinberg","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/punnett":{"get":{"operationId":"get_v1_punnett","tags":["Genetics"],"summary":"Punnett cross","description":"","parameters":[{"name":"parent1","in":"query","required":true,"description":"Parent 1 genotype (e.g. Aa, AaBb)","schema":{"type":"string"},"example":"Aa"},{"name":"parent2","in":"query","required":true,"description":"Parent 2 genotype","schema":{"type":"string"},"example":"Aa"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Offspring distribution from independent assortment. Phenotype 'A_' means at least one dominant allele; 'aa' is homozygous recessive.","inputs":{"genes":1,"parent1":"Aa","parent2":"Aa"},"genotypes":[{"percent":25,"fraction":0.25,"genotype":"AA","out_of_16":4},{"percent":50,"fraction":0.5,"genotype":"Aa","out_of_16":8},{"percent":25,"fraction":0.25,"genotype":"aa","out_of_16":4}],"phenotypes":[{"percent":75,"fraction":0.75,"phenotype":"A_"},{"percent":25,"fraction":0.25,"phenotype":"aa"}]},"meta":{"timestamp":"2026-06-05T03:09:02.361Z","request_id":"ad52aa69-be45-4afd-a9d2-4c7ceef0ca2e"},"status":"ok","message":"Punnett cross","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"notes":"Frequencies are 0–1. Genotypes are written as allele pairs (Aa, AaBb …); a capital letter is the dominant allele. Independent assortment is assumed.","service":"genetics-api","formulae":{"hardy_weinberg":"p² + 2pq + q² = 1","carrier_frequency":"2pq, with q = √(affected frequency)"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/carrier":"Carrier frequency and counts from a recessive-disease incidence.","GET /v1/punnett":"Offspring genotype and phenotype ratios from two parent genotypes.","GET /v1/hardy-weinberg":"Genotype frequencies from an allele frequency (or the recessive incidence)."},"description":"Population-genetics calculator: Hardy-Weinberg genotype and allele frequencies, Punnett-square crosses for one or more genes, and carrier frequency from a recessive-disease incidence."},"meta":{"timestamp":"2026-06-05T03:09:02.424Z","request_id":"0c43b2ca-8442-4654-9ac4-cc8792e21a13"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":2000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":500,"monthly_call_quota":25000,"rps_limit":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1500,"monthly_call_quota":150000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4900,"monthly_call_quota":759000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/genetics-api"}