PressureCode provides a REST API that can be called from any programming language, AI agent, Excel/Google Sheets plugin, or automation tool. All endpoints return JSON.
https://pressure-app-20.tail4f030f.ts.netAuthorization: Bearer <token> or X-API-Key: pc_.../api/excel/<endpoint>?param1=value1¶m2=value2
All API calls require authentication. Two methods are supported:
POST /auth/login
Content-Type: application/json
{"email": "user@example.com", "password": "secret"}
Response: {"access_token": "eyJ...", "user": {...}}
Then use: Authorization: Bearer eyJ... on all subsequent requests.
Use header: X-API-Key: pc_your_api_key_here
API keys are shown in the user profile after login.
Calculate cylindrical shell under internal pressure. Returns utilization ratio, required thickness, and allowable pressure.
| Parameter | Type | Required | Description |
|---|---|---|---|
standard | string | Yes | EN13445, AD2000, ASMEVIII, ASMEI, EN12952 |
Do | float | Yes | Outside diameter [mm] |
t | float | Yes | Wall thickness [mm] |
P | float | Yes | Design pressure [bar] |
T | float | No | Temperature [°C] (default: 20) |
material | string | No | Material designation (default: P265GH) |
z | float | No | Joint efficiency 0-1 (default: 1.0) |
GET /api/excel/cylinder?standard=EN13445&Do=1200&t=20&P=25&T=300&material=P265GH
{
"utilization": 0.663,
"e_required_mm": 13.25,
"p_allowable_bar": 37.51,
"status": "PASS"
}
Dished head calculation (torispherical, ellipsoidal, hemispherical).
| Parameter | Type | Required | Description |
|---|---|---|---|
standard | string | Yes | Design code |
head_type | string | Yes | torispherical, ellipsoidal, hemispherical |
Do | float | Yes | Outside diameter [mm] |
t | float | Yes | Wall thickness [mm] |
P | float | Yes | Design pressure [bar] |
T, material | - | No | Optional (defaults: 20°C, P265GH) |
Tube bend check per EN 12952-3 Anhang A. Returns Bi/Bo factors, intrados/extrados stresses, and P_allow.
| Parameter | Type | Required | Description |
|---|---|---|---|
Do | float | Yes | Tube outside diameter [mm] |
t | float | Yes | Wall thickness [mm] |
bend_radius | float | Yes | Bend radius to centerline [mm] |
P | float | Yes | Design pressure [bar] |
T, material | - | No | Optional |
GET /api/excel/tube_bend?Do=38&t=3.2&bend_radius=45&P=56.5&T=294&material=P235GH
{
"Bi": 1.365, "Bo": 0.852,
"sigma_intrados_MPa": 55.1, "sigma_extrados_MPa": 89.1,
"P_allow_extrados_bar": 63.4,
"utilization": 0.89, "passed": true
}
Nozzle reinforcement check — returns allowable pressure at the opening.
| Parameter | Type | Required | Description |
|---|---|---|---|
standard | string | Yes | Design code |
shell_Do | float | Yes | Shell outside diameter [mm] |
shell_t | float | Yes | Shell wall thickness [mm] |
nozzle_Do | float | Yes | Nozzle outside diameter [mm] |
nozzle_t | float | Yes | Nozzle wall thickness [mm] |
P | float | Yes | Design pressure [bar] |
protrusion_outside | float | No | Outside protrusion [mm] (default: 50) |
protrusion_inside | float | No | Inside protrusion [mm] (default: 0) |
Temperature-dependent material property lookup.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Material: P265GH, P355GH, SA-516 Gr.70, ... |
prop | string | Yes | Rp02, Rm, E, alpha, density, poisson |
T | float | No | Temperature [°C] (default: 20) |
GET /api/excel/material?name=P265GH&prop=Rp02&T=300
{"value": 166.0, "unit": "MPa", "property": "Rp0.2", "temperature": 300}
Component mass in kg. Supports cylinder, dished_head, flat_end.
GET /api/excel/mass?component=cylinder&Do=1200&t=20&L=3000&material=P265GH
{"value": 1467.3, "unit": "kg"}
GET /api/excel/volume?component=cylinder&Do=1200&t=20&L=3000
{"value": 3166.7, "unit": "dm3"}
Required hydraulic test pressure per the applicable standard.
GET /api/excel/test_pressure?standard=EN12952&P=30&T=236&material=P355GH
{"value": 51.49, "unit": "bar"}
Next standard wall thickness from EN 10216/10220 or ASME B36.10/B36.19.
GET /api/excel/pipe_schedule?Do=219.1&t_min=15.84&standard=EN
{"value": 16.0, "source": "EN 10216 DN200", "unit": "mm"}
Same geometry against multiple standards. Returns a comparison table (array).
Vary one parameter, compute results at each step. Returns headers + rows (array).
PressureCode's API is designed to be called by AI agents (LLMs, copilots, automation). Here's how to integrate:
import requests
BASE = "https://pressure-app-20.tail4f030f.ts.net"
HEADERS = {"X-API-Key": "pc_your_key_here"}
# Check a cylinder
r = requests.get(f"{BASE}/api/excel/cylinder",
params={"standard": "EN13445", "Do": 1200, "t": 20, "P": 25, "T": 300, "material": "P265GH"},
headers=HEADERS)
result = r.json()
print(f"Utilization: {result['utilization']:.1%}") # 66.3%
print(f"Required thickness: {result['e_required_mm']} mm")
print(f"Status: {result['status']}")
# Get material property at temperature
r2 = requests.get(f"{BASE}/api/excel/material",
params={"name": "P355GH", "prop": "Rp02", "T": 300},
headers=HEADERS)
print(f"Rp0.2 at 300C: {r2.json()['value']} MPa")
Define PressureCode as a tool for your AI agent:
{
"name": "pressure_calculation",
"description": "Calculate pressure vessel wall thickness per EN 13445, ASME VIII, etc.",
"parameters": {
"type": "object",
"properties": {
"standard": {"type": "string", "enum": ["EN13445", "AD2000", "ASMEVIII", "ASMEI", "EN12952"]},
"component": {"type": "string", "enum": ["cylinder", "head", "cone", "flat_end"]},
"Do": {"type": "number", "description": "Outside diameter [mm]"},
"t": {"type": "number", "description": "Wall thickness [mm]"},
"P": {"type": "number", "description": "Design pressure [bar]"},
"T": {"type": "number", "description": "Temperature [C]"},
"material": {"type": "string"}
},
"required": ["standard", "component", "Do", "t", "P"]
}
}
# Calculate multiple components in sequence
components = [
{"name": "Drum", "Do": 1800, "t": 25, "P": 30, "T": 236, "mat": "P355GH"},
{"name": "Header", "Do": 219.1, "t": 12.7, "P": 30, "T": 236, "mat": "P235GH"},
{"name": "Tube", "Do": 38.1, "t": 3.6, "P": 30, "T": 296, "mat": "P235GH"},
]
for c in components:
r = requests.get(f"{BASE}/api/excel/cylinder",
params={"standard": "EN12952", "Do": c["Do"], "t": c["t"],
"P": c["P"], "T": c["T"], "material": c["mat"]},
headers=HEADERS)
d = r.json()
print(f"{c['name']:10s} util={d['utilization']:.1%} e_req={d['e_required_mm']:.1f}mm")
Returns a list of all available materials with their designations and standards.
| HTTP Code | Meaning | Action |
|---|---|---|
| 200 | Success | Parse JSON result |
| 400 | Invalid parameters | Check parameter names/values |
| 401 | Not authenticated | Add Authorization or X-API-Key header |
| 404 | Material not found | Check material designation spelling |
| 500 | Server error | Report bug |
| # | Endpoint | Description |
|---|---|---|
| 1 | /api/excel/cylinder | Cylindrical shell check/design |
| 2 | /api/excel/head | Dished head check |
| 3 | /api/excel/cone | Conical shell check |
| 4 | /api/excel/flat_end | Flat end / tube plate |
| 5 | /api/excel/nozzle | Nozzle on shell (utilization) |
| 6 | /api/excel/nozzle_reinf | Nozzle P_allow at opening |
| 7 | /api/excel/flange | Flange connection |
| 8 | /api/excel/support | Support (saddle, lug, etc.) |
| 9 | /api/excel/tee | Tee piece |
| 10 | /api/excel/reducer | Reducer / cone transition |
| 11 | /api/excel/pipe_bend | Pipe bend (general) |
| 12 | /api/excel/tube_bend | Tube bend EN 12952 (Bi/Bo) |
| 13 | /api/excel/material | Material property at temperature |
| 14 | /api/excel/mass | Component mass [kg] |
| 15 | /api/excel/volume | Inner volume [dm³] |
| 16 | /api/excel/test_pressure | Required test pressure |
| 17 | /api/excel/pipe_schedule | Next standard thickness |
| 18 | /api/excel/optimize | Optimize wall thickness |
| 19 | /api/excel/compare | Multi-standard comparison |
| 20 | /api/excel/sweep | Parameter sweep (array) |
| 21 | /api/excel/sensitivity | Sensitivity analysis |
| 22 | /api/excel/recommend_material | Material recommendation |
| 23 | /api/excel/reverse_engineer | Reverse engineering |
| 24 | /api/excel/materials | List all materials |