polycalc APIpolycalc.online ↗
Solve 2D beams and trusses, compute Mohr's circle stress transformations, and calculate composite section centroids via 4 structured JSON endpoints.
What is the polycalc API?
The polycalc.online API exposes 4 structural engineering calculation endpoints covering beam analysis, truss solving, Mohr's circle stress transformation, and composite centroid computation. The calculate_beam endpoint alone returns 201 discrete shear and moment diagram points along with support reactions, while calculate_truss classifies every member as tension or compression and returns nodal displacements. All results are delivered as structured JSON with no manual formula work required.
curl -X GET 'https://api.parse.bot/scraper/26bfbf68-b7da-4862-94d6-f29915aeadc4/calculate_beam?query_x=5&supports=%5B%7B%22type%22%3A%22pin%22%2C%22position%22%3A0%7D%2C%7B%22type%22%3A%22roller%22%2C%22position%22%3A10%7D%5D&beam_length=10&point_loads=%5B%7B%22position%22%3A5%2C%22magnitude%22%3A1000%7D%5D' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace polycalc-online-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: PolycalcOnline SDK — structural engineering calculations."""
import json
from parse_apis.polycalc_online_api import PolycalcOnline, InputFormatInvalid
client = PolycalcOnline()
# --- Beam analysis: simply supported beam with a point load ---
supports = json.dumps([
{"type": "pin", "position": 0},
{"type": "roller", "position": 10},
])
point_loads = json.dumps([{"position": 5, "magnitude": 1000}])
beam = client.beam_analyses.calculate(
beam_length=10,
supports=supports,
point_loads=point_loads,
query_x=5,
)
print(f"Beam span: {beam.beam_length}")
for r in beam.reactions:
print(f" {r.support_type} @ {r.position}: Fy={r.force_y}")
# Query point gives shear & moment at the requested location
if beam.query_point is not None:
qp = beam.query_point
print(f" At x={qp.x}: shear={qp.shear}, moment={qp.moment}")
# --- Mohr's circle: plane stress transformation ---
mohr = client.mohrs_circles.calculate(sigma_x=100, sigma_y=-50, tau_xy=30)
print(f"Principal stresses: σ1={mohr.principal_stresses.sigma_1}, σ2={mohr.principal_stresses.sigma_2}")
print(f"Max shear: τ_max={mohr.maximum_shear.tau_max}")
print(f"Circle center={mohr.circle_properties.center}, radius={mohr.circle_properties.radius}")
# --- Centroid of a composite section ---
shapes = json.dumps([
{"type": "rectangle", "width": 12, "height": 8, "center_x": 6, "center_y": 4},
{"type": "circle", "radius": 2, "center_x": 6, "center_y": 4, "hole": True},
])
try:
section = client.cross_sections.calculate(shapes=shapes)
except InputFormatInvalid as e:
print(f"Invalid input: {e.message}")
else:
print(f"Net area: {section.net_area}")
print(f"Centroid: ({section.centroid_x}, {section.centroid_y})")
print(f"Ix={section.ix}, Iy={section.iy}")
for part in section.parts:
label = "(hole)" if part.hole else "(solid)"
print(f" {part.type} {label}: area={part.area}")
# --- Truss analysis: simple triangle truss ---
nodes = json.dumps([
{"x": 0, "y": 0, "support": "pin"},
{"x": 4, "y": 0, "support": "roller"},
{"x": 2, "y": 3},
])
members = json.dumps([
{"start_node": 0, "end_node": 1, "E": 200e9, "A": 0.01},
{"start_node": 0, "end_node": 2, "E": 200e9, "A": 0.01},
{"start_node": 1, "end_node": 2, "E": 200e9, "A": 0.01},
])
loads = json.dumps([{"node": 2, "fx": 0, "fy": -10000}])
truss = client.truss_analyses.calculate(nodes=nodes, members=members, loads=loads)
print(f"Truss: {truss.num_nodes} nodes, {truss.num_members} members")
for mf in truss.member_forces:
print(f" Member {mf.member}: {mf.force:.1f} N ({mf.state})")
for rx in truss.reactions:
print(f" Node {rx.node} ({rx.support_type}): Fx={rx.force_x}, Fy={rx.force_y}")
print("exercised: beam_analyses.calculate / mohrs_circles.calculate / cross_sections.calculate / truss_analyses.calculate")
Solve a 2D beam using the direct stiffness method. Computes support reactions, shear force diagram, and bending moment diagram. Supports pin, roller, and fixed boundary conditions with point loads, distributed loads, and applied moments. Returns 201 discrete points along the beam for shear and moment diagrams. Optionally returns shear and moment at a specific query position. Sign conventions: positive reaction force_y = upward; positive shear = net upward force to left of cut; positive moment = sagging (tension on bottom); positive load magnitude = downward.
| Param | Type | Description |
|---|---|---|
| query_x | number | Position along beam to query exact shear and moment values. When provided, the response includes a query_point object with interpolated shear and moment at this location. |
| supportsrequired | string | JSON array of support objects. Each object has: type (pin, roller, or fixed) and position (distance from left end). Example: [{"type":"pin","position":0},{"type":"roller","position":10}] |
| beam_lengthrequired | number | Length of the beam (positive number, in consistent length units). |
| point_loads | string | JSON array of point load objects. Each has: position, magnitude (positive=downward), and optional angle (degrees from horizontal, default 90). Example: [{"position":5,"magnitude":1000}] |
| moment_loads | string | JSON array of moment load objects. Each has: position and magnitude. Example: [{"position":5,"magnitude":500}] |
| distributed_loads | string | JSON array of distributed load objects. Each has: start_position, end_position, start_magnitude, end_magnitude (positive=downward). Supports linearly varying loads. Example: [{"start_position":0,"end_position":10,"start_magnitude":100,"end_magnitude":100}] |
{
"type": "object",
"fields": {
"reactions": "array of reaction objects with support_type, position, force_y, and optional moment (for fixed supports)",
"beam_length": "number — the beam span",
"query_point": "object with x, shear, moment at the queried position (present only when query_x is provided)",
"shear_diagram": "array of 201 {x, shear} points along the beam",
"moment_diagram": "array of 201 {x, moment} points along the beam"
},
"sample": {
"data": {
"reactions": [
{
"force_y": 500,
"position": 0,
"support_type": "pin"
},
{
"force_y": 500,
"position": 10,
"support_type": "roller"
}
],
"beam_length": 10,
"query_point": {
"x": 5,
"shear": -500,
"moment": 2500
},
"shear_diagram": [
{
"x": 0,
"shear": 500
},
{
"x": 0.05,
"shear": 500
}
],
"moment_diagram": [
{
"x": 0,
"moment": 0
},
{
"x": 0.05,
"moment": 25
}
]
},
"status": "success"
}
}About the polycalc API
Beam and Truss Analysis
The calculate_beam endpoint solves a 2D beam using the direct stiffness method. You define the beam via beam_length, a supports array (pin, roller, or fixed), and optional point_loads, distributed_loads, and moment_loads arrays. The response includes a reactions array with force_y and, for fixed supports, a moment value. It also returns shear_diagram and moment_diagram as arrays of 201 {x, shear} and {x, moment} points. Pass query_x to receive exact shear and moment values at a specific position via the query_point field.
The calculate_truss endpoint accepts nodes (with coordinates and support conditions like pin, roller, or roller_x), members (with start/end node indices and optional material properties), and loads (nodal forces). It returns member_forces with a force value and a state field indicating tension or compression, plus reactions per support node and displacements (dx, dy) at every node.
Stress Transformation and Section Properties
The calculate_mohrs_circle endpoint takes three stress inputs — sigma_x, sigma_y, and tau_xy (shear stress, positive CCW on the x-face) — and returns principal_stresses with sigma_1, sigma_2, and angle_to_principal_degrees, plus maximum_shear with tau_max and angle_to_max_shear_degrees. The circle_properties object gives the Mohr's circle center and radius directly.
The calculate_centroid endpoint computes the composite centroid and second moments of area for an arbitrary cross-section built from rectangles, circles, and triangles. Each shape in the shapes array can be flagged as a hole to subtract it from the net section. The response provides centroid_x, centroid_y, net_area, global Ix and Iy, and a parts breakdown with per-shape area, local centroid coordinates, and local Ix_local / Iy_local values.
The polycalc API is a managed, monitored endpoint for polycalc.online — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when polycalc.online changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official polycalc.online API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Automate shear and bending moment diagram generation for simply supported or cantilevered beams under mixed loading
- Classify truss members as tension or compression in a parametric structural optimization loop
- Compute principal stresses and rotation angles for Mohr's circle verification in a mechanics-of-materials course tool
- Calculate composite section centroid and moments of inertia for custom I-beams or built-up sections with holes
- Generate beam reaction data programmatically to feed downstream deflection or stress calculations
- Validate hand calculations for structural engineering homework or exam preparation tools
- Build a structural analysis web application that exposes beam and truss results through a custom front-end
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does polycalc.online provide an official developer API?+
What does calculate_beam return beyond shear and moment diagrams?+
reactions array with support_type, position, and force_y for every support, plus a moment value at fixed supports. If you pass query_x, the response also includes a query_point object with exact shear and moment at that position. The diagrams themselves are arrays of 201 evenly spaced points.How does calculate_truss indicate whether a member is in tension or compression?+
member_forces array includes a numeric force field (positive for tension, negative for compression) and a state string that is either 'tension' or 'compression'. Node indices for both ends are also returned so you can map forces back to geometry.Does the API support 3D beam or frame analysis?+
calculate_beam) and 2D trusses (via calculate_truss) only. You can fork it on Parse and revise it to add a 3D frame or space-truss endpoint.Can I compute deflections or slope diagrams for beams?+
calculate_beam endpoint returns reactions, shear diagrams, and moment diagrams, but not deflection or slope curves. You can fork it on Parse and revise it to add deflection output using the existing stiffness-method solver.