API · Electrical
xmoo Cable Sizing API
Size low-voltage cables to IEC 60364 and DIN VDE 0298-4 in one request – cross-section, protective device, voltage drop, automatic disconnection and short-circuit withstand, with the formula and values behind every step.
What it does
- Cable sizing from the design current or power: protective device (Ib ≤ In ≤ Iz, I2 ≤ 1.45 Iz), cross-section from the current-carrying capacity with temperature and grouping factors, voltage drop, fault loop and disconnection, short-circuit withstand. If voltage drop or disconnection require it, the cross-section is increased automatically.
- Current-carrying capacity for an installation: tabulated and corrected value for every cross-section, or the smallest one that carries a given current.
- Voltage drop of a cable, the longest length within the limit and the smallest cross-section that keeps it.
Each answer names the standard, table and column it used, and lists the calculation step by step in plain text – ready to show to your users or to put into a report. Nothing is stored. It is the same engine as the free cable sizing tool on this site (in German).
Standards
Current-carrying capacities and correction factors come from DIN VDE 0298-4:2023-06 (Tables 3–6, 17, 20–26, 29). Its values are those of HD 60364-5-52 / IEC 60364-5-52 Annex B, so the API fits every country that uses these tables. The calculation follows IEC 60364-4-43 (overload protection), IEC 60364-5-52 (voltage drop, resistive part) and IEC 60364-4-41 (automatic disconnection) with the minimum single-phase fault current to IEC 60909-0 (cmin = 0.9, conductor at its permissible short-circuit temperature). Supply voltages are 230 V / 400 V.
- Copper and aluminium (aluminium from 25 mm²), PVC 70 °C and cross-linked 90 °C insulation.
- Reference installation methods A1 to G, cross-sections up to 300 mm² (F and G up to 630 mm²).
- Protective devices: circuit breakers type B, C, D up to 63 A, gG fuses up to 250 A; TN and TT systems.
The API is a planning aid without warranty. It replaces neither professional design nor verification to IEC 60364-6. National deviations from these tables are not covered – check the rules that apply where you install.
Access
The API is offered through RapidAPI, where you subscribe to a plan, get your key and the host name for your requests. The listing is being prepared – the link will appear here as soon as it is live. Questions: julian@haag-automation.com.
All endpoints take and return JSON (Content-Type: application/json, body up to
64 KB). The examples expect your key and host in RAPIDAPI_KEY and
RAPIDAPI_HOST.
Endpoints
| Endpoint | Purpose |
|---|---|
| POST /v1/electrical/cable/size | Size a cable and its protective device, all checks |
| POST /v1/electrical/current-capacity | Current-carrying capacity Ir and Iz for one installation |
| POST /v1/electrical/voltage-drop | Voltage drop, longest length, smallest cross-section |
| GET /v1/electrical/tables | Allowed values: installation methods, groupings, temperatures, devices, cross-sections |
Field descriptions: api.xmoo.app/electrical/openapi.json
(OpenAPI 3.0). Descriptive texts are English; lang=de returns German.
Examples
Real answers of the API, shortened where marked. A test on our side sends these requests and checks that the answers still match.
Size a sub-distribution feeder
50 kW three-phase at cos φ 0.95, 30 m, installation method C, 35 °C, gG fuse, distribution circuit, 100 mΩ fault loop impedance up to the origin of the circuit:
curl -s -X POST "https://$RAPIDAPI_HOST/v1/electrical/cable/size" \ -H "x-rapidapi-key: $RAPIDAPI_KEY" \ -H "x-rapidapi-host: $RAPIDAPI_HOST" \ -H "Content-Type: application/json" \ -d @request.json
{
"supply": "three-phase",
"power": 50000,
"powerFactor": 0.95,
"length": 30,
"installationMethod": "C",
"ambientTemperature": 35,
"protectiveDevice": "gG",
"circuitType": "distribution",
"upstreamImpedance": 100
}
Answer, shortened to the main results and the first of six steps:
{
"status": "ok",
"result": {
"designCurrent": 75.97,
"protectiveDevice": {
"type": "gG",
"ratedCurrent": 80,
"conventionalCurrentI2": 128
},
"requiredCurrentCapacity": 88.28,
"crossSection": 25,
"tabulatedCapacity": 96,
"currentCapacity": 90.24,
"factors": {
"temperature": 0.94,
"grouping": 1
},
"voltageDrop": {
"volts": 2.68,
"percent": 0.67,
"ok": true
},
"disconnection": {
"maxTime": 5,
"disconnectionCurrent": 440,
"loopImpedance": 0.1669,
"minShortCircuitCurrent": 1240.58,
"ok": true
},
"shortCircuit": {
"k": 115,
"permissibleTime": 5.37,
"ok": true
},
"recommendation": {
"text": "NYM-J 5×25 mm², 3 × gG 80 A (e.g. NEOZED D03 or NH size 000/00)"
}
},
"sources": {
"standard": "DIN VDE 0298-4:2023-06",
"table": "Table 3",
"hd60364552": "B.52.4/6"
},
"steps": [
{
"step": 1,
"title": "Design current Ib",
"standard": null,
"status": "ok",
"lines": [
"Ib = P ÷ (√3 × U × cos φ) = 50,000 W ÷ (1.732 × 400 V × 0.95) = 75.97 A"
],
"nextStep": null
}
],
"notice": "Planning aid without warranty; it replaces neither professional design nor verification to IEC 60364-6."
}
status is ok when every check passes, failed when a condition
is not met (the step then says what to do in nextStep), incomplete when a
step could not be checked – for example without upstreamImpedance – and
note when the short-circuit check needs a manufacturer value.
Voltage drop of a final circuit
16 A single-phase, 25 m, 1.5 mm² copper:
{
"supply": "single-phase",
"current": 16,
"length": 25,
"crossSection": 1.5
}
{
"designCurrent": 16,
"voltage": 230,
"conductivity": 56,
"voltageDrop": {
"volts": 9.52,
"percent": 4.14,
"ok": false
},
"maxLength": 24.15,
"smallestCrossSectionWithinLimit": {
"crossSection": 2.5,
"volts": 5.71,
"percent": 2.48
},
"formula": "ΔU = 2 × L × I × cos φ ÷ (κ × A)",
"note": "Resistive part only, conductor at 20 °C; the inductive reactance of large cross-sections is not included."
}
4.14 % is above the default limit of 4 %: the cable may be at most 24.15 m long, or 2.5 mm² keeps the drop at 2.48 %.
Which cross-section carries 32 A?
Installation method B2, three loaded conductors, 40 °C ambient:
{
"installationMethod": "B2",
"loadedConductors": 3,
"ambientTemperature": 40,
"requiredCurrent": 32
}
Answer, shortened to the first three cross-sections of the list:
{
"conductor": "copper",
"insulation": "pvc-70",
"column": {
"installationMethod": "B2",
"loadedConductors": 3,
"arrangement": null
},
"factors": {
"temperature": 0.87,
"grouping": 1,
"soil": null,
"groupingCircuitsInTable": 1,
"total": 0.87
},
"smallestSufficient": {
"crossSection": 10,
"tabulatedCapacity": 46,
"currentCapacity": 40.02
},
"capacities": [
{
"crossSection": 1.5,
"tabulatedCapacity": 15,
"currentCapacity": 13.05
},
{
"crossSection": 2.5,
"tabulatedCapacity": 20,
"currentCapacity": 17.4
},
{
"crossSection": 4,
"tabulatedCapacity": 27,
"currentCapacity": 23.49
}
],
"sources": {
"standard": "DIN VDE 0298-4:2023-06",
"table": "Table 3",
"hd60364552": "B.52.4/5",
"factors": [
"Table 17",
"Table 22"
]
}
}
Errors
Errors come as JSON with a code, a message and, for input errors, the
field:
{
"error": {
"code": "missing_field",
"message": "\"crossSection\" is required.",
"field": "crossSection"
}
}
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_json, invalid_lang | Body is not a JSON object, unknown language |
| 401 | unauthorized | Request did not come through RapidAPI |
| 404, 405 | not_found, method_not_allowed | Unknown endpoint or wrong HTTP method |
| 413 | too_large | Body larger than 64 KB |
| 415 | unsupported_media_type | Body is not sent as application/json |
| 422 | missing_field, invalid_field, invalid_input | A required field is missing or a value is outside the tables – see field |
Use with AI agents (MCP)
RapidAPI offers its APIs as tools for AI agents through the Model Context Protocol (MCP). With your RapidAPI key, an agent can size a cable as a tool call – and show the user the steps behind the result.
Privacy and terms
The inputs are technical values; nothing is stored. API privacy notice · API terms of use · data processing agreement.
Provider
Haag Automation, Julian Haag, Mühlstraße 35, 74360 Ilsfeld, Germany · julian@haag-automation.com · xmoo is a brand of Haag Automation. All APIs