Skip to content
Documentation sections

Calculate

POSThttps://rftools.io/api/py/v1/calculate

Runs any of the 255 calculators with the inputs you would type on its page, in the units the page shows, and returns every output, the warnings and the provenance as JSON.

Authenticate with the X-API-Key header. Keys start with rfc_ and are created on the dashboard. Every call counts against the account's monthly allowance: 5 on Free, 100 on Pro, 10,000 on API.

Request body

CalculateRequest
FieldDescription
slugrequiredstringThe calculator, by the slug in its page's address, e.g. rf-link-budget. Every slug is listed under Slugs and inputs.
inputsrequiredobject of numbersInput values keyed by the calculator's input keys, in the units its reference lists. Send every input: most are required, and a call without one is refused (400); an optional one left out takes the default the reference shows. A key the calculator does not read is ignored with a warning.

Inputs for rf-link-budget

Generated from the calculator's definition. An input outside its range is still computed and flagged in the provenance. Every calculator's inputs are under Slugs and inputs.

Inputs of rf-link-budget
NameUnitRangeDefaultDescription
txPowernumberdBm−30 … 10030Transmitter output power
txGainnumberdBi−30 … 603TX antenna gain in dBi
txCableLossnumberdB0 … 201TX cable + connector losses (positive value)
frequencynumberMHz0.1 … 10000002400Center frequency
distancenumberkm0.001 … 10000001Distance between TX and RX
rainFadenumberdB0 … 500Rain attenuation per ITU-R P.838. Use 0 for line-of-sight ground links; 3–20 dB for satellite links above 10 GHz in heavy rain zones.
atmosphericLossnumberdB0 … 200.5Gaseous absorption (O₂ at 60 GHz: ~15 dB/km; H₂O at 22 GHz: ~0.2 dB/km). Use 0.5 dB typical for sub-6 GHz terrestrial links.
pointingLossnumberdB0 … 100Antenna misalignment loss. Pencil-beam dishes: 0.5–3 dB. Omnidirectional or wide-beam antennas: 0 dB.
extraLossCountnumbernone0 … 40How many extra loss terms the budget includes, such as polarisation mismatch, body loss or foliage
extraLoss1numberdB0 … 500An extra loss in the path, such as polarisation mismatch, body loss, foliage or a wall
extraLoss2numberdB0 … 500An extra loss in the path, such as polarisation mismatch, body loss, foliage or a wall
extraLoss3numberdB0 … 500An extra loss in the path, such as polarisation mismatch, body loss, foliage or a wall
extraLoss4numberdB0 … 500An extra loss in the path, such as polarisation mismatch, body loss, foliage or a wall
rxGainnumberdBi−30 … 603RX antenna gain in dBi
rxCableLossnumberdB0 … 201RX cable + connector losses
rxSensitivitynumberdBm−160 … 0-90Minimum receivable signal level
targetMarginnumberdB0 … 6010The fade margin the link must keep above the receiver sensitivity. The status passes at or above it and fails below 0 dB.

Response

CalculateResponse
FieldDescription
slugstringThe calculator, as asked for.
valuesobject of numbersEach output by key, in the units its reference lists. null where a value is unbounded or undefined, such as the return loss of a perfect match.
warningsstring[]The calculator's own warnings, then the API's: an input not read, an input outside the range the calculator is stated for.
errorsstring[]The calculator's errors; empty on success.
provenanceobjectHow the values were computed: method, engine version, formula reference, assumptions and valid range. See Provenance.

The outputs of rf-link-budget, in values:

Outputs of rf-link-budget
FieldUnitDescription
fspldBFree Space Path Loss
eirpdBmEffective Isotropic Radiated Power
rxPowerdBmReceived Power
linkMarginheadlinedBLink Margin
maxRangeKmkmMax Range
totalAdditionalLossdBSum of rain fade, atmospheric loss, pointing loss and any extra loss terms
maxRangeAtTargetkmThe distance at which the link margin falls to the target margin
wavelengthmmWavelength
fresnelRadiusmRadius of the first Fresnel zone at the middle of the path. Keep at least 60 % of it clear of obstacles.

Errors

Errors of POST /calculate
StatusPython exceptionWhen
400ValidationErrorThe request cannot be answered as sent: an input that is not a finite number, a solve that cannot be set up, a job body outside its contract, or a batch that is empty or over its limit. Nothing is counted.
401AuthErrorNo key was sent (the body carries keyUrl), or the key is not one we issued, or was revoked. Never about the allowance.
402QuotaErrorThe account's monthly allowance is spent, on every metered route. Nothing was counted. Retry-After gives the seconds until resetAt.
404NotFoundNo such calculator slug, job type or job. Nothing is counted.
422ValidationErrorThe body does not parse: a required field is missing, or a value is of the wrong type (an input sent as text). Answered before the route runs.
429RateLimitErrorToo many requests in a minute for the credential, or too many jobs queued or running at once. Retry-After says when to try again.
500APIErrorThe result was computed but could not be returned, or a solve failed. Nothing was charged.
503APIErrorThe key or the allowance counter could not be checked, or a job could not be queued. Nothing was queued or charged; try again.

Every check runs before anything is counted: the key, the calculator, then the inputs. See Errors for each body.

Try it

Send a request from this page with your own key. It counts like any other call.

A request needs a key, and counts against its account's allowance. Get a free key.