MPC Lab API Documentation

Explore our API to generate random problems across various subjects, and learn how to integrate the MPC Lab NPM package into your project.

API Documentation

Use the API to generate problems in mathematics, physics, and chemistry by specifying topics and subtopics.

Endpoint:

GET /api/problems/:topics/:subtopics/:...

Request Parameters:

  • topics (string): The topics to generate the problem for.
  • subtopics (string): The subtopics to generate the problem for.
  • ... (string): Additional subtopics, if applicable.

Query Parameters:

  • options (object): Problem generation options, customized to your needs. (Optional, object (Use JSON string))

Response:

{
  "status": "success",
  "data": {},
  "message": "Problem generated successfully."
}
View full API documentation on GitHub

NPM Package Usage

The MPC Lab NPM package offers an easy-to-use interface for integrating our problem generator directly into your Node.js project.

Installation

npm install mpclab

Simple Usage:

const ProblemGenerator = require("mpclab");

const generator = new ProblemGenerator();
const problem = generator.generateOne([
  "math",
  "algebra",
  "linear-equations",
  "standardForm"
]);

console.log(problem);

Advanced Usage:

View on NPM

For advanced customization and problem generation, refer to our GitHub repository for detailed instructions.