Skip to content
Documentation sections

Batch

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

Up to 50 calculations in one request, any mix of calculators: a parameter sweep, or a design's figures together. Each item is computed exactly as /calculate computes it.

The batch endpoint is part of the API plan. Each item computed counts as one call; an item refused before it is computed costs nothing.

Request body

BatchRequest
FieldDescription
calculationsrequiredarray1 to 50 items, each {slug, inputs} as /calculate takes them. More is refused with 400 and the limit.

Response

BatchResponse
FieldDescription
resultsarrayOne item per calculation, in order.
results[].slugstringThe item's calculator.
results[].values, warnings, errors, provenanceas /calculateA computed item: exactly what /calculate returns for it.
results[].error, errorKindstringAn item that was not computed: why (an unknown slug, an input that is not a finite number). It was not counted.

The results are in the order of the request. Check each item: a computed one has values and provenance; one that was not has error and errorKind. A failure in one item never fails the others.

Refusals

  • 400: no calculations (At least one calculation is required), or more than 50, with the limit.
  • 401: no key, or a key that is not valid.
  • 402: the allowance cannot cover the items to compute; nothing was counted.
  • 403: the account's plan has no batch access; the body names the plan that has it.