Install
openclaw skills install bunpro-syncSync Bunpro Japanese grammar learning progress from the API to local storage for analysis and insights. Use when the user wants to backup their Bunpro progress, track grammar mastery, analyze review patterns, or monitor JLPT level progression. Works with the community-documented Bunpro Frontend API.
openclaw skills install bunpro-syncSync your Bunpro grammar learning progress locally for analysis and insights.
⚠️ Important: This uses a community-documented API. The official Bunpro API Key from settings does NOT work - you need the Frontend API Token from your browser.
This skill fetches your Japanese grammar progress from Bunpro and stores it in a local SQLite database. Track SRS stages, review forecasts, JLPT progress, and identify grammar leeches (items that keep falling back).
Bunpro has two different API tokens that serve different purposes:
bunpro.jp/settings/accountd406663ff421af27c87caaa62eefdb7a (32 hex characters)eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9... (long JWT, 200+ chars)Method 1: Console (Recommended)
Object.fromEntries(
new URLSearchParams(
document.cookie.replace(/; /g, '&')
)
).frontend_api_token
eyJ)Method 2: Local Storage
token, authToken, or frontend_api_tokeneyJ)Method 3: Network Tab
/user or /queue)Authorization: Bearer eyJ...⚠️ Token Expiry: The Frontend API Token expires eventually (days/weeks). When you get 401 errors, repeat the steps above to get a fresh token.
# Using environment variable (recommended)
export BUNPRO_FRONTEND_API_TOKEN="eyJ0eXAiOiJKV1Qi..."
python3 scripts/sync.py
# Or pass token directly (less secure)
python3 scripts/sync.py --token "eyJ0eXAiOiJKV1Qi..."
# Store in specific directory
python3 scripts/sync.py --data-dir ~/bunpro-data
# Only user info
python3 scripts/sync.py --user-only
# Only study queue
python3 scripts/sync.py --queue-only
# Only reviews
python3 scripts/sync.py --reviews-only
python3 scripts/sync.py --full
userYour account info including level, XP, buncoin, lifetime status.
grammar_pointsGrammar content including title, meaning, structure, JLPT level, unit/lesson.
reviewsYour SRS progress on each grammar point (stage, next review, burned status).
study_queueItems scheduled for future review.
due_itemsItems currently available for review (includes is_leech flag).
user_statsAggregated statistics (SRS overview, forecasts, JLPT progress, activity).
review_historiesReview session history (last session, last 24h).
sync_metaInternal table tracking last sync timestamps.
-- Grammar mastery by JLPT level
SELECT jlpt_level, COUNT(*) as total,
SUM(CASE WHEN burned = 1 THEN 1 ELSE 0 END) as burned
FROM reviews r
JOIN grammar_points g ON r.grammar_point_id = g.id
GROUP BY jlpt_level;
-- Upcoming reviews
SELECT DATE(next_review) as day, COUNT(*)
FROM reviews
WHERE next_review > datetime('now')
GROUP BY day
ORDER BY day
LIMIT 7;
-- Grammar leeches
SELECT g.title, g.meaning, d.streak, r.srs_stage_string
FROM due_items d
JOIN grammar_points g ON d.reviewable_id = g.id
LEFT JOIN reviews r ON d.reviewable_id = r.reviewable_id
WHERE d.is_leech = 1
ORDER BY d.streak ASC;
# Show SRS distribution
python3 scripts/queries.py srs
# Show upcoming review forecast
python3 scripts/queries.py forecast
# Show grammar mastery by JLPT level
python3 scripts/queries.py grammar --jlpt 5
# Show currently due reviews
python3 scripts/queries.py due
# Show grammar leeches
python3 scripts/queries.py leeches
# Show overall progress
python3 scripts/queries.py progress
# Show recent activity
python3 scripts/queries.py activity
https://api.bunpro.jp/api/frontend401 Unauthorized:
eyJ0eXAi...)500 Server Error:
Empty data:
references/api-structure.md - Full endpoint documentationscripts/sync.py - Main sync tool with CLIscripts/queries.py - Query helper with common reportsreferences/api-structure.md - Bunpro API reference