With the ClearCalcs API, you can integrate the same calculations that are available on our website into your own applications.
This enhanced API allows engineers to seamlessly integrate our existing calculators into their workflows, or work with us to create, customize, or extend calculators for tailored solutions. Fully versioned and programmatically generated, our API is designed for maximum flexibility and is currently in preview with select partners. Reach out today to enquire about access.
Interested in joining our exclusive API trial program? We’re selectively inviting industry leaders and innovators who are eager to integrate or customize our calculators within their workflows. If you believe your team could benefit from early access, please reach out to us with details about your intended use case. Our team will review applications on a case-by-case basis, and successful applicants will receive an invitation to participate. This is a unique opportunity to shape the future of engineering workflows—don’t miss out.
To apply, fill out our contact form here.
The /api/solutions
endpoint is used to queue up calculations in our servers and to retrieve the solutions once they're complete
POST app.clearcalcs.com/api/solutions
This is the request structure in curl.
curl api-token:{INSERT_API_KEY_HERE}https://app.clearcalcs.com/api/solutions \
-h "Content-Type: application/json" \
-d '{"data": {"attributes": {"calculations": [ INSERT_CALCULATION_OBJECTS_HERE ]}}}'
This POST
request allows you to queue up calculations via a single api call. The request body should be in the form shown below
{
"data": {
"attributes": {
# Up to 200 calculations can be sent at once.
"calculations": [] # Array of calculation objects
}
}
}
Each calculation
object should be in the form specified in the schema docs.
This is an sample calculation
object for an Australian Truss Analysis Wizard calculation
{
# This URL is also a JSON Schema detailing available inputs and outputs.
"$module": "https://app.clearcalcs.com/api/schemas/modules/AU/trussAnalysis/v1.json",
# Your internal identifier for this calculation.
"$id": "RT1",
# Display name if calculation is viewed within the ClearCalcs platform. Can be the same as `$id`.
"$name": "RT1",
# See `#input` definition in the `$module` JSON Schema for available inputs.
# Use custom type, as we'll be specifying all the nodes and elements manually
"type_assembly": "Custom Truss",
# Member types used by element definitions
"material": "CFS",
# Top Chord Member (member type 0)
"MemberT_cfs_AUNZ": "C300-24 (Lysaght®)",
# Webs Member (member type 1)
"MemberW_cfs_AUNZ": "C300-24 (Lysaght®)",
# Bottom Chord Member (member type 2)
"MemberB_cfs_AUNZ": "C300-24 (Lysaght®)",
# Nodes in truss
"nodes_custom": [
{"X": 0, "Y": 0},
{"X": 3000, "Y": 0},
{"X": 6000, "Y": 0},
{"X": 1500, "Y": 3000},
{"X": 4500, "Y": 3000},
],
# Elements in truss, between nodes above
"elements_custom": [
{"member_type_num": 2, "start_node_num": 0, "end_node_num": 1, "start_conn": "Fixed", "end_conn": "Fixed"},
{"member_type_num": 2, "start_node_num": 1, "end_node_num": 2, "start_conn": "Fixed", "end_conn": "Fixed"},
{"member_type_num": 1, "start_node_num": 0, "end_node_num": 3, "start_conn": "Pinned", "end_conn": "Pinned"},
{"member_type_num": 0, "start_node_num": 3, "end_node_num": 4, "start_conn": "Fixed", "end_conn": "Fixed"},
{"member_type_num": 1, "start_node_num": 3, "end_node_num": 1, "start_conn": "Pinned", "end_conn": "Pinned"},
{"member_type_num": 1, "start_node_num": 1, "end_node_num": 4, "start_conn": "Pinned", "end_conn": "Pinned"},
{"member_type_num": 1, "start_node_num": 4, "end_node_num": 2, "start_conn": "Pinned", "end_conn": "Pinned"},
],
# Supports on nodes
"supports_custom": [
{"node_num": 0, "type": "Pinned"},
{"node_num": 2, "type": "Pinned"},
],
# Loads
"distLoads_custom": [
{"element_num": 3, "w": 1, "x_s": 0, "x_e": 3000, "theta": -90},
],
"pointLoads_custom": [
],
"momentLoads_custom": [
]
}
The POST
request will create separate sheets for each of your calculations in a new project. You can either go into clearcalcs and see them there or via a GET
request. When you make a POST
request you should get a solution_id
in the response's [“data”][“id”]
field. You can put that in the GET
request show below to get the status and/or results of your calculations.
GET app.clearcalcs.com/api/solutions/{solution_id}
The status of the calculations will be in response[“data”][“attributes”][“state”]
.
Possible status values are:
completed
failed
processing
If the status is completed
you should be able to view the results in response[“data”][“attributes”][“results”]
.