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

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.

Inputs of Gas Law Calculator: Ideal, van der Waals & Combined
FieldTypeDefaultDescription
modeselect (ideal, vdw, combined)"ideal"Gas law
gasselect (custom, he, h2, n2, o2, ar, co, co2, ch4, nh3, h2o)"co2"Gas (van der Waals)
anumber—a (L²·bar/mol², own gas)
bnumber—b (L/mol, own gas)
formulatext—Formula (optional). Gives the molar mass, so the amount can be a mass and the result shows the mass and density.
pressuretext—Pressure. Leave exactly one of pressure, volume, amount and temperature empty: that one is calculated.
volumetext—Volume
amounttext—Amount of gas. mol, or a mass in g with a formula or preset gas.
temperaturetext—Temperature
p1text—p₁. Combined gas law: leave exactly one of the six values empty.
v1text—V₁
t1text—T₁
p2text—p₂
v2text—V₂
t2text—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)

{
  "mcpServers": {
    "proofline-gas-law": { "type": "http", "url": "https://prooflinegaslaw.usefulweb.app/mcp" }
  }
}