Get started with the Roskov API
The API uses JWT (JSON Web Tokens) for authentication. After registering or logging in, you'll receive an access token and refresh token.
POST /api/auth/register/
Content-Type: application/json
{
"username": "newuser",
"password": "securepassword",
"email": "user@example.com"
}
POST /api/auth/login/
Content-Type: application/json
{
"username": "newuser",
"password": "securepassword"
}
Response:
{
"user": {...},
"access": "eyJ0eXAiOiJKV1QiLCJhbGc...",
"refresh": "eyJ0eXAiOiJKV1QiLCJhbGc..."
}
Include the access token in the Authorization header for protected endpoints.
GET /api/auth/me/
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGc...
Response:
{
"id": 1,
"username": "newuser",
"email": "user@example.com"
}
GET /api/word-pairs/random/
Response:
{
"id": 1,
"french_word": "bonjour",
"russian_word": "здравствуйте",
"category": "greetings",
"level": 1,
...
}
Complete list of available API endpoints
/api/auth/register/
Register a new user account
/api/auth/login/
Login and receive JWT tokens
/api/auth/auto-create/
Automatically create a guest user
/api/auth/me/
Get current authenticated user (requires authentication)
/api/token/refresh/
Refresh JWT access token
/api/word-pairs/
List all word pairs
/api/word-pairs/random/
Get a random word pair
/api/word-pairs/by-level/?level=1
Get word pairs by level (1-5)
/api/word-pairs/new-words/
Get words not yet practiced (requires authentication)
/api/word-pairs/difficult-words/
Get words with highest mistake probability (requires authentication)
/api/word-pairs/multiple-choice-options/?word_pair_id=1&direction=fr_to_ru
Get word pair with multiple choice options
/api/game-attempts/submit_answer/
Submit an answer and get feedback (requires authentication)
/api/progress/
Get user progress (streaks, daily goals) (requires authentication)
/api/level-progress/
Get progress for all levels (requires authentication)
/api/current-level/
Get current active level (requires authentication)
/api/user-stats/summary/
Get summary statistics (requires authentication)
/api/rankings/
Get user rankings based on performance
/api/lessons/
List all lessons
/api/lessons/by-level/?level=1
Get lessons by level
/api/lessons/{id}/complete/
Mark a lesson as completed (requires authentication)
/api/health/
Health check endpoint