{"id":25220401,"url":"https://github.com/adridevelopsthings/xschool-node","last_synced_at":"2026-05-08T19:33:04.744Z","repository":{"id":57690473,"uuid":"473352111","full_name":"AdriDevelopsThings/xschool-node","owner":"AdriDevelopsThings","description":"Get your xschool marks.","archived":false,"fork":false,"pushed_at":"2023-01-22T17:06:47.000Z","size":29,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-28T13:48:04.244Z","etag":null,"topics":["nodejs","typescript","xschool"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdriDevelopsThings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-23T20:43:24.000Z","updated_at":"2022-04-30T20:17:06.000Z","dependencies_parsed_at":"2023-02-12T17:16:07.968Z","dependency_job_id":null,"html_url":"https://github.com/AdriDevelopsThings/xschool-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AdriDevelopsThings/xschool-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdriDevelopsThings%2Fxschool-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdriDevelopsThings%2Fxschool-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdriDevelopsThings%2Fxschool-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdriDevelopsThings%2Fxschool-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdriDevelopsThings","download_url":"https://codeload.github.com/AdriDevelopsThings/xschool-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdriDevelopsThings%2Fxschool-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274744061,"owners_count":25341136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","typescript","xschool"],"created_at":"2025-02-10T21:53:12.643Z","updated_at":"2026-05-08T19:33:04.696Z","avatar_url":"https://github.com/AdriDevelopsThings.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xschool for nodejs\n\n## Installation\n\n```shell\nnpm install xschool\n```\n\nor when you are using yarn\n\n```shell\nyarn add xschool\n```\n\n## How to use\n\n```javascript\nimport { XSchoolApi } from 'xschool'\n\nconst api = new XSchoolApi(endpoint, username, password, otpKey)\nawait api.login()\nconst terms = await api.getMarks()\n\n// An example to get the mark average in the current term of bob in the subject 'Deutsch'\n\nconst currentTerm = terms.filter(term =\u003e term.current)[0]\nconst titleTerm = currentTerm.title\nconst student = currentTerm.students.filter(student =\u003e student.firstname == 'Bob')[0]\nconst subject = student.subjects.filter(subject =\u003e subject.title == 'Deutsch')[0]\n// .filter(note =\u003e note) because some notes are empty\nconst marks = subject.marks.map(mark =\u003e mark.mark).filter(mark =\u003e mark)\nconst noteAverage = marks.reduce((p, c) =\u003e p + c, 0) / marks.length\nconsole.log(`Your mark average in German is ${noteAverage}`)\n```\n\n### What does endpoint?\n\nYour school have a subdomain of xschool.de. For example: your-school.xschool.de. The endpoint for this domain would be `https://your-school.xschool.de`. Don't put a `/` at the end of the url.\n\n### What does otpKey mean?\n\nXschool requires 2 factor authentication via Email or Google Authenticator. We want to use Google Authenticator here. You can enable Google Authenticator in settings. Xschool will give you a QR code. You have to scan it with a other QR code scanner and get the raw string behind the QR code. The string will be for example: `otpauth://totp/YOUR_USERNAME?secret=YOUR_SECRET\u0026issuer=XSCHOOL`. Your `otpKey` is `YOUR_SECRET` in this url. You can scan your QR code with Google Authenticator now. XSchool needs your generated otp code to verify the 2 factor registration.\n\n## Better use\nWhen you make the first request the api have to authenticate you. The authentication details (Authorization codes) are saved in the cookies. If you save them the api doesn't have to make much requests again to authenticate you. Make it like that:\n\n```javascript\nimport { XSchoolApi } from 'xschool'\n\nlet cookies = {}\n\nif (cookiesWasSaved)\n    cookies = JSON.parse(readCookiesFromFileDisk()) // you can use a json file for example\n\nconst api = new XSchoolApi(endpoint, username, password, otpKey, cookies) // you can pass the cookies in the constructor\nif (!cookiesWasSaved)\n    await api.login() // you have to re-login because you didn't save your cookies\n    writeCookiesToFileDisk(JSON.stringify(api.getCookies()))\n\nconst terms = await api.getMarks()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadridevelopsthings%2Fxschool-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadridevelopsthings%2Fxschool-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadridevelopsthings%2Fxschool-node/lists"}