API & MCP
Everything a person can do on Gas Law Calculator: Ideal, van der Waals & Combined, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://prooflinegaslaw.usefulweb.app/api/v1/calculate– run Gas Law Calculator: Ideal, van der Waals & CombinedGET https://prooflinegaslaw.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Gas Law Calculator: Ideal, van der Waals & Combined
Type three of pressure, volume, amount and temperature with any units (bar, atm, kPa, mmHg; L, mL, m³; mol or grams; K, °C, °F) and get the fourth from the ideal gas law or the van der Waals equation. The real-gas mode shows the compressibility factor Z, how far the ideal gas is off, the critical point and the isotherm, and lists the liquid and gas solutions below the critical temperature. Ten preset gases take their van der Waals constants from their measured critical point; the combined gas law solves p₁V₁/T₁ = p₂V₂/T₂. Part of the Proofline math notebook.
| Field | Type | Default | Description |
|---|---|---|---|
mode | select (ideal, vdw, combined) | "ideal" | Gas law |
gas | select (custom, he, h2, n2, o2, ar, co, co2, ch4, nh3, h2o) | "co2" | Gas (van der Waals) |
a | number | — | a (L²·bar/mol², own gas) |
b | number | — | b (L/mol, own gas) |
formula | text | — | Formula (optional). Gives the molar mass, so the amount can be a mass and the result shows the mass and density. |
pressure | text | — | Pressure. Leave exactly one of pressure, volume, amount and temperature empty: that one is calculated. |
volume | text | — | Volume |
amount | text | — | Amount of gas. mol, or a mass in g with a formula or preset gas. |
temperature | text | — | Temperature |
p1 | text | — | p₁. Combined gas law: leave exactly one of the six values empty. |
v1 | text | — | V₁ |
t1 | text | — | T₁ |
p2 | text | — | p₂ |
v2 | text | — | V₂ |
t2 | text | — | T₂ |
Example request
Molar volume of an ideal gas at 0 °C and 1 atm
curl -X POST https://prooflinegaslaw.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"mode":"ideal","pressure":"1 atm","temperature":"0 °C","amount":"1 mol"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://prooflinegaslaw.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
proofline_gas_law - Local stdio connector:
node src/mcp-stdio.ts --tool=proofline-gas-law
{
"mcpServers": {
"proofline-gas-law": { "type": "http", "url": "https://prooflinegaslaw.usefulweb.app/mcp" }
}
}