Math Problem Generator API

Playground

초등학교 1학년부터 고등학교 3학년까지 수학 문제를 생성하는 REST API입니다. 학년(grade)을 난이도 시드로 사용하여 모든 연산에 대해 적절한 난이도의 문제를 생성합니다.

Base URL

https://studyroom.vercel.app

Endpoints

GET/api/math/generate

수학 문제를 생성합니다.

Query Parameters

ParameterTypeRequiredDescription
gradenumberYes학년 (1-12). 1-6: 초등, 7-9: 중등, 10-12: 고등
operationstringYes연산 종류 (아래 표 참조)
levelnumberNo세부 난이도 (1-5, 기본값: 1)
countnumberNo문제 수 (1-50, 기본값: 10)

Example Request

curl "https://studyroom.vercel.app/api/math/generate?grade=3&operation=addition&level=2&count=5"

Example Response

{
  "success": true,
  "problems": [
    {
      "question": "234 + 567 = ?",
      "answer": 801,
      "choices": [801, 799, 803, 798]
    },
    {
      "question": "456 + 123 = ?",
      "answer": 579,
      "choices": [579, 577, 581, 576]
    }
  ],
  "meta": {
    "grade": 3,
    "operation": "addition",
    "level": 2,
    "count": 5
  }
}
GET/api/math/operations

사용 가능한 연산 목록을 반환합니다.

Example Request

curl "https://studyroom.vercel.app/api/math/operations"

Example Response

{
  "operations": [
    "addition", "subtraction", "multiplication", "division",
    "comparison", "blank", "sequence", "clock", "fraction",
    "decimal", "divisor", "multiple", "average", "ratio", "percent"
  ]
}

Available Operations

OperationNameGrades
addition덧셈1-12
subtraction뺄셈1-12
multiplication곱셈2-12
division나눗셈2-12
comparison크기 비교1-12
blank빈칸 채우기1-12
sequence수열1-12
clock시계1-6
fraction분수3-12
decimal소수4-12
divisor약수4-12
multiple배수4-12
average평균5-12
ratio비율5-12
percent퍼센트5-12

Grade Mapping

1
초1
2
초2
3
초3
4
초4
5
초5
6
초6
7
중1
8
중2
9
중3
10
고1
11
고2
12
고3

CORS

모든 API 엔드포인트는 CORS가 활성화되어 있어 외부 도메인에서도 호출 가능합니다.

Error Handling

{
  "success": false,
  "error": "Invalid grade. Must be between 1 and 12."
}

studyroom.im