Quickstart
The StudyPlug API generates educational content items for K-5 students on demand (K-8 planned). This guide walks you through your first API call, browsing the curriculum catalog, and using seeds for reproducible output.
Your First Request
Section titled “Your First Request”Generate 5 addition problems with a single request. No API key required.
curl -X POST https://api.studyplug.org/api/v1/generate \ -H "Content-Type: application/json" \ -d '{"skill": "add-within-10", "grade": "kindergarten", "count": 5}'npm install studyplugimport { StudyPlug } from "studyplug";
const sp = new StudyPlug();const { data } = await sp.generate({ skill: "add-within-10", grade: "kindergarten", count: 5,});
console.log(data.items); // 5 arithmetic ContentItemsconsole.log(data.answerKey); // answers with explanationsThe response includes a data object with items (the generated content) and answerKey (the answers), plus a meta object with request metadata.
Browse the Catalog
Section titled “Browse the Catalog”The API organizes content into a hierarchy: grades contain subjects, which contain topics, which contain skills. Use the catalog endpoints to discover what is available.
# List all gradescurl https://api.studyplug.org/api/v1/grades
# Get a grade with its subjectscurl https://api.studyplug.org/api/v1/grades/grade-3
# List skills filtered by grade and subjectcurl "https://api.studyplug.org/api/v1/skills?grade=grade-3&subject=math"
# Search skills by keywordcurl "https://api.studyplug.org/api/v1/skills?q=fraction"// List all gradesconst { data: gradesData } = await sp.grades.list();console.log(gradesData.grades);
// Get a specific grade with its subjectsconst { data: gradeData } = await sp.grades.get("grade-3");console.log(gradeData.grade.subjects);
// Search skills by grade and subjectconst { data: skillsData } = await sp.skills.list({ grade: "grade-3", subject: "math",});console.log(skillsData.skills);
// Search skills by keywordconst { data: searchData } = await sp.skills.list({ q: "fraction" });console.log(searchData.skills);Generate Content by Skill
Section titled “Generate Content by Skill”Once you find a skill slug from the catalog, pass it to the generate endpoint. You can request a batch of items or a single item.
# Batch: 10 items (default)curl -X POST https://api.studyplug.org/api/v1/generate \ -H "Content-Type: application/json" \ -d '{"skill": "multiply-by-6"}'
# Single itemcurl -X POST https://api.studyplug.org/api/v1/generate/single \ -H "Content-Type: application/json" \ -d '{"skill": "multiply-by-6"}'// Batch: 10 items (default)const batch = await sp.generate({ skill: "multiply-by-6" });
// Single itemconst single = await sp.generate.single({ skill: "multiply-by-6" });console.log(single.data.item); // one ContentItemconsole.log(single.data.answer); // its answerDeterministic Output with Seeds
Section titled “Deterministic Output with Seeds”Pass a seed parameter to get the exact same content every time. This is useful for caching, testing, and sharing reproducible worksheets.
# Same seed = same output, every timecurl -X POST https://api.studyplug.org/api/v1/generate \ -H "Content-Type: application/json" \ -d '{"skill": "add-within-10", "count": 5, "seed": 42}'const result = await sp.generate({ skill: "add-within-10", count: 5, seed: 42,});// Run this again with seed: 42 and you get identical itemsSeeded requests are also cached server-side, so repeated calls with the same parameters return instantly.
Next Steps
Section titled “Next Steps”- Authentication — learn about API keys and rate limits
- Rate Limits — understand throttling and retry behavior
- Content Items — the universal ContentItem data model
- API Reference — full endpoint documentation
- SDK Reference — TypeScript SDK setup and usage