{"openapi":"3.1.0","info":{"title":"Ideal Gas Law API","version":"1.0.0","description":"Ideal-gas-law maths as an API, computed locally and deterministically. The ideal endpoint solves PV = nRT for whichever quantity you leave out: provide any three of pressure, volume, amount of substance (moles) and temperature, and it returns the fourth in several units. The combined endpoint applies the combined gas law, P₁V₁/T₁ = P₂V₂/T₂: give a first state and two quantities of the second state and it finds the missing one — handy for \"what happens to the volume if I double the pressure\" questions. The density endpoint computes the density of an ideal gas from the pressure, temperature and molar mass (ρ = P·M / R·T). Pressure accepts pascals, kPa, bar, atm, psi, mmHg and Torr; volume accepts m³, litres, mL and cubic feet; temperature accepts kelvin, Celsius and Fahrenheit; and the gas constant R is 8.314462618 J/(mol·K). Everything is computed in SI internally and is instant and private. Ideal for chemistry and physics education, lab and process tools, HVAC and scuba calculations, and engineering software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is ideal-gas thermodynamics; for the chemical elements and periodic-table data use an elements API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/gaslaw-api","description":"oanor gateway"}],"tags":[{"name":"Gas"},{"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/combined":{"get":{"operationId":"get_v1_combined","tags":["Gas"],"summary":"Combined gas law","description":"","parameters":[{"name":"p1","in":"query","required":true,"description":"State 1 pressure","schema":{"type":"string"},"example":"1"},{"name":"v1","in":"query","required":true,"description":"State 1 volume","schema":{"type":"string"},"example":"1"},{"name":"t1","in":"query","required":true,"description":"State 1 temperature","schema":{"type":"string"},"example":"273"},{"name":"p2","in":"query","required":false,"description":"State 2 pressure","schema":{"type":"string"},"example":"2"},{"name":"v2","in":"query","required":false,"description":"State 2 volume","schema":{"type":"string"}},{"name":"t2","in":"query","required":false,"description":"State 2 temperature","schema":{"type":"string"},"example":"273"},{"name":"pressure_unit","in":"query","required":false,"description":"Pressure unit","schema":{"type":"string"},"example":"atm"},{"name":"volume_unit","in":"query","required":false,"description":"Volume unit","schema":{"type":"string"},"example":"l"},{"name":"temperature_unit","in":"query","required":false,"description":"Temp unit","schema":{"type":"string"},"example":"K"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"v2":{"m3":0.0005,"ml":500,"ft3":0.017657333,"litres":0.5},"note":"Combined gas law: P₁V₁/T₁ = P₂V₂/T₂. Provide state 1 and two of state 2.","input":{"t1_k":273,"p1_pa":101325,"v1_m3":0.001},"variable":"v2","solved_for":"v2"},"meta":{"timestamp":"2026-06-04T01:59:13.164Z","request_id":"b0368af6-3d71-493b-8460-1d03a8257076"},"status":"ok","message":"Combined gas law","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/density":{"get":{"operationId":"get_v1_density","tags":["Gas"],"summary":"Ideal-gas density","description":"","parameters":[{"name":"pressure","in":"query","required":true,"description":"Pressure","schema":{"type":"string"},"example":"101325"},{"name":"pressure_unit","in":"query","required":false,"description":"Unit","schema":{"type":"string"},"example":"pa"},{"name":"temperature","in":"query","required":true,"description":"Temperature","schema":{"type":"string"},"example":"288"},{"name":"temperature_unit","in":"query","required":false,"description":"K|C|F","schema":{"type":"string"},"example":"K"},{"name":"molar_mass","in":"query","required":true,"description":"Molar mass","schema":{"type":"string"},"example":"28.96"},{"name":"molar_mass_unit","in":"query","required":false,"description":"g|kg (default g)","schema":{"type":"string"},"example":"g"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Ideal-gas density ρ = P·M / (R·T). Molar mass defaults to g/mol (air ≈ 28.96).","input":{"pressure_pa":101325,"temperature_k":288,"molar_mass_kg_per_mol":0.02896},"density_g_per_l":1.22543,"density_kg_per_m3":1.22543},"meta":{"timestamp":"2026-06-04T01:59:13.253Z","request_id":"ee3fbf52-6bdd-43c1-976e-4e62078085f2"},"status":"ok","message":"Gas density","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/ideal":{"get":{"operationId":"get_v1_ideal","tags":["Gas"],"summary":"Solve PV = nRT","description":"","parameters":[{"name":"pressure","in":"query","required":false,"description":"Pressure (+pressure_unit)","schema":{"type":"string"},"example":"1"},{"name":"pressure_unit","in":"query","required":false,"description":"pa|kpa|bar|atm|psi|mmhg","schema":{"type":"string"},"example":"atm"},{"name":"volume","in":"query","required":false,"description":"Volume (+volume_unit)","schema":{"type":"string"}},{"name":"volume_unit","in":"query","required":false,"description":"m3|l|ml|ft3","schema":{"type":"string"},"example":"l"},{"name":"moles","in":"query","required":false,"description":"Amount (mol)","schema":{"type":"string"},"example":"1"},{"name":"temperature","in":"query","required":false,"description":"Temperature (+temperature_unit)","schema":{"type":"string"},"example":"0"},{"name":"temperature_unit","in":"query","required":false,"description":"K|C|F","schema":{"type":"string"},"example":"C"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"PV = nRT, R = 8.314462618 J/(mol·K). Provide three quantities; the fourth is returned in several units.","input":{"moles":1,"pressure_pa":101325,"temperature_k":273.15},"volume":{"m3":0.02241397,"ml":22413.97,"ft3":0.79154186,"litres":22.41397},"variable":"volume","solved_for":"volume"},"meta":{"timestamp":"2026-06-04T01:59:13.356Z","request_id":"636326db-4d06-4a2a-b2cf-c4dcd8099562"},"status":"ok","message":"Ideal gas law","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":{"note":"Computed in SI internally (Pa, m³, K, mol). R = 8.314462618 J/(mol·K).","units":{"volume":["m3","l","liter","litre","ml","cm3","ft3","gal"],"pressure":["pa","kpa","mpa","bar","mbar","atm","psi","mmhg","torr","inhg"],"temperature":["K","C","F"]},"service":"gaslaw","endpoints":{"/v1/ideal":"Solve PV = nRT for the missing one of pressure, volume, moles or temperature.","/v1/density":"Ideal-gas density from pressure, temperature and molar mass.","/v1/combined":"Combined gas law P₁V₁/T₁ = P₂V₂/T₂: solve a second-state variable."},"description":"Ideal-gas-law maths: PV = nRT (solve any variable), the combined gas law, and gas density.","constant_R_j_per_mol_k":8.314462618},"meta":{"timestamp":"2026-06-04T01:59:13.456Z","request_id":"8969aa7d-c145-4ea3-b72b-e647d2c70f7a"},"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":12535,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1405,"monthly_call_quota":22150,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3395,"monthly_call_quota":271500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7195,"monthly_call_quota":1400000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/gaslaw-api"}