You can programmatically access Studycounts' question generator using our RESTful API.

Our API is in beta. If you have any questions or feedback, please don't hesitate to contact us.

All API endpoints require a OAuth 2 authentication. Simple Arithmetic endpoints are free for all Studycounts users, to access more advanced topics via the API you will need a Student plan or greater.

  1. First, login to your account and create an "Access Token" via your My Account page.
  2. Finally, add a header to all of your API requests with the key name "Authorization" with a value of "Bearer access-token" where access-token is the actual token you created in step 1.

That's it! Keep your access tokens private. If you lose control of a token, delete it and create a new one via your My Account page.

The "rate limit" is the amount of times you may access the Studycounts API in a given ammount of time.

The rate limit for your request can be found in the response header as X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.

All endpoints are currently limited to 10 calls per user every 1 minute.

If you require more calls per minute please contact us.

To get a random math question for a given topic, use the following patern:

https://studycounts.com/api/v1/arithmetic/simple.json

Returns this JSON:

{
  "id": "ycfd",
  "question": "<mn>4</mn><mo> &Cross; </mo><mn>3</mn>",
  "choices": [
    "<math><mn>12</mn></math>",
    "<math><mn>72</mn></math>",
    "<math><mn>8</mn></math>",
    "<math><mn>24</mn></math>",
    "<math><mn>91</mn></math>"
  ],
  "correct_choice": 0,
  "instruction": "Evaluate",
  "category": "Arithmetic",
  "topic": "Simple",
  "difficulty": "Beginner"
}

The question and answer choices are returned in MathML markup.

You can request a specific difficulty level by assigning the values 'beginner,' 'intermediate,' or 'advanced' to 'difficulty' in the query string, like this:

https://studycounts.com/api/v1/arithmetic/simple.json?difficulty=beginner

Possible Topics

Below is an exhaustive list of possible question types. Note the formation of the URL.

Simple Arithmetic endpoints are free, all other topic endpoints require a Student plan or greater. All endpoints require authentication.

Arithmetic
  • Simple Arithmetic - /api/v1/arithmetic/simple.json
  • Fraction Arithmetic - /api/v1/arithmetic/fractions.json
  • Exponent & Radicals Arithmetic - /api/v1/arithmetic/exponents-and-radicals.json
  • Simple Trigonometry - /api/v1/arithmetic/simple-trigonometry.json
  • Matrices Arithmetic - /api/v1/arithmetic/matrices.json
Algebra
  • Linear Equations - /api/v1/algebra/linear-equations.json
  • Equations Containing Radicals- /api/v1/algebra/equations-containing-radicals.json
  • Equations Containing Absolute Values - /api/v1/algebra/equations-containing-absolute-values.json
  • Quadratic Equations - /api/v1/algebra/quadratic-equations.json
  • Higher Order Polynomial Equations - /api/v1/algebra/higherorder-polynomial-equations.json
  • Equations Involving Fractions - /api/v1/algebra/equations-involving-fractions.json
  • Exponential Equations - /api/v1/algebra/exponential-equations.json
  • Logarithmic Equations - /api/v1/algebra/logarithmic-equations.json
  • Trigonometric Equations - /api/v1/algebra/trigonometric-equations.json
  • Matrices Equations - /api/v1/algebra/matrices-equations.json
Calculus
  • Polynomial Differentiation - /api/v1/calculus/polynomial-differentiation.json
  • Trigonometric Differentiation - /api/v1/calculus/trigonometric-differentiation.json
  • Exponents Differentiation - /api/v1/calculus/exponents-differentiation.json
  • Polynomial Integration - /api/v1/calculus/polynomial-integration.json
  • Trigonometric Integration - /api/v1/calculus/trigonometric-integration.json
  • Exponents Integration - /api/v1/calculus/exponents-integration.json
  • Polynomial Definite Integrals - /api/v1/calculus/polynomial-definite-integrals.json
  • Trigonometric Definite Integrals - /api/v1/calculus/trigonometric-definite-integrals.json
  • Exponents Definite Integrals - /api/v1/calculus/exponents-definite-integrals.json
  • First Order Differential Equations - /api/v1/calculus/first-order-differential-equations.json
  • Second Order Differential Equations - /api/v1/calculus/second-order-differential-equations.json

To get a specific math question via its ID, use the following patern:

https://studycounts.com/api/v1/algebra/linear-equations/pbnpd.json

Returns this JSON:

{
  "id": "pbnpd",
  "question": "<mi>x</mi><mo> - </mo><mn>1</mn><mo> = </mo><mn>3</mn>",
  "choices": [
    "<math><mn>13</mn></math>",
    "<math><mn>1</mn></math>",
    "<math><mo>-</mo><mn>18</mn></math>",
    "<math><mn>4</mn></math>",
    "<math><mn>11</mn></math>"
  ],
  "correct_choice": 3,
  "instruction": "Solve for x",
  "category": "Algebra",
  "topic": "Linear Equations",
  "difficulty": "Beginner"
}

Note that possible answer choices are randomly generated every call.