Evaluate an expression to a number

Evaluates a math expression, optionally substituting variables. Returns the exact and decimal result.

Request

POSThttps://math-solver.p.apihiver.com/v1/evaluate

JSON object. Required: expression.

Request Body

Edit the values below to test different scenarios.

Parameters and body structure are inherited from this endpoint's definition. Changes here only apply to this test run.

Language
Client
1curl --request POST \
2  --url https://math-solver.p.apihiver.com/v1/evaluate \
3  --header 'Accept: application/json' \
4  --header 'Content-Type: application/json' \
5  --header 'X-API-Key: YOUR_API_KEY' \
6  --data '{
7  "variables": {
8    "x": 4
9  },
10  "expression": "2*x+3"
11}'

Evaluate an expression to a number: Math Solver API reference

Evaluates a math expression, optionally substituting `variables`. Returns the exact and decimal result. This endpoint is part of the Math Solver API: Evaluate expressions, solve equations, and compute derivatives, integrals and simplifications — with exact and decimal answers.

Example response (200, application/json)

Success.

1{
2  "exact": "11",
3  "result": "11.00000000",
4  "is_number": true,
5  "expression": "2*x+3"
6}

Errors

  • 400 — A required parameter is missing or a value has the wrong format.
    1{
    2  "error": {
    3    "code": "INVALID_INPUT",
    4    "message": "expression: Field required"
    5  }
    6}

Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.