Math Equations API

FREEMIUM
By Kleon Leo Piraino | Updated hace 2 meses | Education
Popularity

5.9 / 10

Latency

455ms

Service Level

100%

Health Check

100%

Back to All Tutorials (1)

Docs

API Documentation

Welcome to the documentation for the API endpoints. This API provides simple arithmetic operations through various endpoints. Below you will find details on how to interact with these endpoints.

Endpoints

1. /easy

Description

This endpoint generates simple arithmetic equations and their solutions based on the specified operation or a randomly selected one if none is provided.

Method

  • GET

Parameters

  • operation (optional): Specifies the type of arithmetic operation to perform. Valid values include:
    • addition: Adds two numbers.
    • subtraction: Subtracts first number from second.
    • multiplication: Multiplies two numbers.
    • division: Divides one number by another.

Request

GET /easy?operation=addition

Response

{ "equation": "37 + 64", "solution": 101 }

Example without query parameter

Request

GET /easy

Response

{ "equation": "76 / 19", "solution": 4 }

In the absence of a query parameter specifying the operation, the API will randomly select one of the available operations (addition, subtraction, multiplication, or division) and generate an equation and solution accordingly.

2. /medium

Description

This endpoint generates medium complexity arithmetic equations and their solutions based on the specified operation or a randomly selected one if none is provided. Equation includes three numbers.

Method

  • GET

Parameters

  • operation (optional): Specifies the type of arithmetic operation to perform. Valid values include:
    • addition: Adds three numbers.
    • subtraction: Subtracts three numbers.
    • multiplication: Multiplies three numbers.
    • division: Divides three numbers.

Request

GET /medium?operation=multiplication

Response

{ "equation": "6 * 7 * 3", "solution": 126 }

Example without query parameter

Request

GET /medium

Response

{ "equation": "8 / 2 / 4", "solution": 1 }

In the absence of a query parameter specifying the operation, the API will randomly select one of the available operations (addition, subtraction, multiplication, or division) and generate an equation and solution accordingly.

3. /hard

Description

This endpoint generates complex arithmetic equations and their solutions.

Method

  • GET

Parameters

This endpoint does not accept any query parameters.

Request

GET /hard

Response

{ "equation": "(39 - 99) * 27", "solution": -1620 }

4. /veryhard

Description

This endpoint generates highly complex arithmetic equations using logarithms, powers, square and cube roots, and their solutions.

Method

  • GET

Parameters

This endpoint does not accept any query parameters.

Request

GET /veryhard

Response

{ "equation": "3logâ‚‚(4^3)", "solution": 18 }