Not all methods are fully described, refer to https://s-api.letovo.ru/api/documentation for more information.
In your project directory:
npm i letovo-api
Then you can include it in a file like this:
const Letovo = require("letovo-api");
Here's how you get your marks using the API:
const Letovo = require("letovo-api");
(async () => {
const me = new Letovo("USERNAME", "PASSWORD");
await me.login();
console.log(me.userID, me.studentID);
console.log((await me.marks()).data);
})();
More methods can be found below.
Creates a Letovo instance.
user
- your username in format20XXlastname.fm
password
- your passwordimmediateAuth
- if set to true, executesLetovo.login
andLetovo.loginOld
when created.
Student ID (number)
User ID (number)
student.letovo.ru student ID (number)
Logs in on s.letovo.ru
Logs in on student.letovo.ru
Logs out from s.letovo.ru
Returns info about the logged in user. Format:
{
"user": {
"id": ******,
"name": "****",
"email": "*************@student.letovo.ru",
"user_type": "student",
"is_email_verified": 1,
"is_current_password": 1,
"phone": "79*********",
"parent_id": 0,
"student_id": *****,
"is_phone_verified": 0,
"bad_pwd_count": 0,
"is_blocked_by_badpwd_limit": 0,
"bad_ad_pwd_count": 0,
"is_disable": 0,
"roles": []
},
"user_settings": {
"id": ***,
"user_id": ******,
"language": "Ru",
"tutorial_school_progress_done": 0,
"widget_active_schedule": 1,
"widget_active_schoolprogress": 1,
"widget_active_favorites": 1,
"active_qa_sections": [
{
"name_code": "diagnostics",
"name_rus": "Диагностики",
"name_eng": "Diagnostics",
"options": "{\"allowed_user_types\": [\"parent\", \"student\"]}"
},
{
"name_code": "olympiads",
"name_rus": "Олимпиады",
"name_eng": "Olympiads",
"options": "{\"allowed_user_types\": [\"parent\", \"student\"]}"
},
{
"name_code": "requests",
"name_rus": "Запросы",
"name_eng": "Requests",
"options": "{\"allowed_user_types\": [\"parent\", \"student\"]}"
},
{
"name_code": "schoolprogress",
"name_rus": "Успеваемость",
"name_eng": "Schoolprogress",
"options": "{\"allowed_user_types\": [\"parent\", \"student\"]}"
}
]
}
}
Sends the verification code for accessing extra information to your phone.
Verifies your phone with the provided code.
Returns your schedule for a specific day. The argument day
is of type Date().
Returns your schedule for a specific day. The argument day
is of type Date() (any day in week).
Returns your schedule for a specific day. The argument day
is of type Date() (any day in year).
Returns your current progress in Letovo Diploma. Format:
{
"diploma_letovo_table": [
{ ... }
]
}
Returns all possible Letovo Diploma rewards.
Returns all olympiads you participated in.
Returns your marks. Period is either 1
or 2
.