{"openapi":"3.1.0","info":{"title":"pH Calculator API","version":"1.0.0","description":"pH and acid–base maths as an API, computed locally and deterministically. The ph endpoint converts freely between the four ways of describing acidity — the pH, the pOH, the hydronium-ion concentration [H+] and the hydroxide concentration [OH−]: give any one and it returns the others using pH = −log₁₀[H+], [OH−] = Kw/[H+] and pH + pOH = pKw, and classifies the solution as acidic, neutral or basic. The strong endpoint gives the pH of a strong acid or strong base from its molarity ([H+] = c for an acid, [OH−] = c for a base), warning when the solution is so dilute that water self-ionisation matters. The buffer endpoint applies the Henderson–Hasselbalch equation, pH = pKa + log₁₀([A−]/[HA]), to a buffer from a pKa and the conjugate-base-to-acid ratio (given directly or as two concentrations), and also handles a base buffer from a pKb. Kw defaults to 1×10⁻¹⁴ (25 °C) and can be overridden for other temperatures. Everything is computed locally and deterministically, so it is instant and private. Ideal for chemistry and biology lab tools, titration and buffer-prep apps, water-treatment and aquarium software, and science education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is pH and acid–base chemistry; for solution dilution and molarity use a dilution API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/phcalc-api","description":"oanor gateway"}],"tags":[{"name":"pH"},{"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/buffer":{"get":{"operationId":"get_v1_buffer","tags":["pH"],"summary":"Henderson–Hasselbalch buffer","description":"","parameters":[{"name":"pka","in":"query","required":false,"description":"pKa (acid buffer)","schema":{"type":"string"},"example":"4.76"},{"name":"pkb","in":"query","required":false,"description":"Or pKb (base buffer)","schema":{"type":"string"}},{"name":"ratio","in":"query","required":false,"description":"Conjugate-base/acid ratio","schema":{"type":"string"},"example":"10"},{"name":"conjugate_base","in":"query","required":false,"description":"Or [A−] concentration","schema":{"type":"string"}},{"name":"acid","in":"query","required":false,"description":"And [HA] concentration","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"pH":5.76,"pKa":4.76,"pOH":8.24,"mode":"acid_buffer","formula":"pH = pKa + log10([A−]/[HA]).","classification":"acidic","ratio_base_over_acid":10},"meta":{"timestamp":"2026-06-04T10:18:55.903Z","request_id":"400a1044-abfb-47c6-8c6a-bdb50da724bd"},"status":"ok","message":"Henderson-Hasselbalch buffer","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/ph":{"get":{"operationId":"get_v1_ph","tags":["pH"],"summary":"pH / pOH / [H+] / [OH−] conversion","description":"","parameters":[{"name":"ph","in":"query","required":false,"description":"pH","schema":{"type":"string"}},{"name":"poh","in":"query","required":false,"description":"Or pOH","schema":{"type":"string"}},{"name":"hydronium","in":"query","required":false,"description":"Or [H+] (mol/L)","schema":{"type":"string"},"example":"0.001"},{"name":"hydroxide","in":"query","required":false,"description":"Or [OH−] (mol/L)","schema":{"type":"string"}},{"name":"kw","in":"query","required":false,"description":"Water ion product (default 1e-14)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"pH":3,"pKw":14,"pOH":11,"note":"pH = −log10[H+]; [OH−] = Kw/[H+]; pH + pOH = pKw (14 at 25 °C).","classification":"acidic","hydronium_concentration":0.001,"hydroxide_concentration":1.0e-11},"meta":{"timestamp":"2026-06-04T10:18:56.018Z","request_id":"573b8aef-f0e4-4f71-b132-06d27f37aa9e"},"status":"ok","message":"pH / pOH / [H+] / [OH-] conversion","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/strong":{"get":{"operationId":"get_v1_strong","tags":["pH"],"summary":"pH of a strong acid or base","description":"","parameters":[{"name":"type","in":"query","required":false,"description":"acid|base (default acid)","schema":{"type":"string"},"example":"acid"},{"name":"concentration","in":"query","required":true,"description":"Molarity (mol/L)","schema":{"type":"string"},"example":"0.01"},{"name":"kw","in":"query","required":false,"description":"Kw (default 1e-14)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"pH":2,"pOH":12,"type":"acid","formula":"strong acid: [H+] = c, pH = −log10(c).","concentration":0.01,"classification":"acidic","hydronium_concentration":0.01,"hydroxide_concentration":1.0e-12},"meta":{"timestamp":"2026-06-04T10:18:56.124Z","request_id":"fe87ebc9-0ae0-4c6c-9025-b744fc8eeb37"},"status":"ok","message":"pH of a strong acid or base","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":{"api":"phcalc","note":"pH / acid-base maths — computed locally and deterministically, no key, no third-party service. Kw defaults to 1e-14 (25 °C).","endpoints":["/v1/ph","/v1/strong","/v1/buffer","/v1/meta"],"default_pKw":14},"meta":{"timestamp":"2026-06-04T10:18:56.228Z","request_id":"f896586d-a878-498b-9421-de4f9c91a44e"},"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":30000,"rps_limit":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1500,"monthly_call_quota":250000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4900,"monthly_call_quota":2000000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/phcalc-api"}