MyFAP API CLI
English | Tiếng Việt
Introduction
An unofficial CLI that talks to the internal APIs of the myFAP mobile app to check class schedules, exam dates, grades (the family disappointment edition), and student profile info.
Disclaimer
- Unofficial tool: This is an independent project built for personal and educational use. It is not affiliated with, authorized, maintained, or endorsed by FPT University (FPTU) or the official myFAP development team.
- Use at your own risk: This software is provided "as is", without warranty of any kind. The author is not responsible for any account issues, inaccurate data, service disruptions, or other damages resulting from using this CLI. Always double-check important academic records such as exam schedules, final grades, and tuition fees on the official FAP portal or the official myFAP app.
- Warnings on internal APIs and session security:
- Reverse-engineered internal APIs: This tool relies on undocumented internal endpoints extracted from the myFAP Android client. Upstream changes can break functionality, alter responses, or block requests at any time without notice.
- Plaintext local session: After logging in, your OAuth tokens and
authen_keyare stored in plaintext JSON at~/.myfap-api-cli/session.json(or the path passed to--config). Never share this file or commit exported.json/.icsstudent data to public repositories. Runmyfap logoutwhen finished on shared machines. - Responsible usage: Avoid automated high-frequency polling or scraping that puts unnecessary load on upstream servers.
Key Features
- Cross-platform support (Windows, macOS, Linux)
- Log in via FEID or Google OAuth
- View class schedules (weekly or full semester)
- View grades (per subject or full semester)
- Check attendance (per subject or full semester)
- Check submitted student applications
- Read campus news and announcements
- View student profile and Student Services (DVSV) info
- Export semester class schedules and exam schedules to ICS for Google Calendar or other calendar apps
- And more...
Usage
-
Install the CLI:
pip install myfap
-
List available campuses:
myfap campuses -
Log in to the myFAP API via FEID:
myfap login --campus HN
After logging in, your session is saved at
~/.myfap-api-cli/session.json. -
Log in for the Xavalo (HCM) campus:
myfap login -c HCM
-
Fetch your class schedule (automatically picks the latest semester):
myfap schedule
Command Reference
| Command | Description |
|---|---|
version |
Show the CLI version |
doctor |
Check local configuration; add --online to test the v2 bootstrap connection |
login |
Log in or reuse an existing session; add --force to force re-authentication |
logout |
Delete the local session |
refresh |
Refresh tokens and session state |
campuses |
List campuses for the selected API version |
semesters |
List available semesters |
schedule |
View semester class schedule; use --ics to export an ICS calendar |
week-timetable |
View weekly or daily class timetable |
exams |
View exam schedule; use --ics to export an ICS file, add --full for extra fields |
courses |
List courses for a semester |
marks |
View semester grades, per-course details, or summary with --summary |
transcript |
View full academic transcript; --pretty parses the HTML table into JSON |
attendance |
Check attendance by semester or filter by subject and class |
applications |
List submitted student applications |
news |
Read or search campus news |
info student |
View student profile information |
info photo |
Fetch student photo data as JSON |
info campus |
View Student Services (DVSV) contact details |
other training |
View training points by semester |
other survey |
Check pending surveys |
other feedback |
Check open feedbacks |
other feedbacks |
List student feedbacks; v2 only |
other profile |
Check profile update requests |
other notification |
View student notifications |
other fee |
View tuition fees and payment status |
other balance |
View account balance |
other subjects |
List subjects; optionally filter by semester |
other rating list |
View rating list; v1 only |
Environment Variables
Two environment variables are supported by default:
MYFAP_TIMEOUT: override the default request timeout in seconds (default:10s; subject listing uses30s)MYFAP_API_VER: override the API version (default:v2)
Notes
When --semester is omitted, the CLI picks the current semester from recent startDate values (at least one past semester needs a valid startDate for auto-selection to work, which holds true unless you are a freshman whose first semester has not started yet). For week-timetable, --date determines the year if --year is omitted.
Options
Examples:
myfap --api-version v2 --campus HN schedule --ics
myfap schedule --ics --api-version v2 --campus HN
myfap info student --timeout 20 --stdout
If the same option is passed at multiple command levels, the subcommand value takes precedence. If repeated at the same level, the last value wins.
| Option | Description |
|---|---|
--help |
Show commands and options help |
--config <path> |
Path to a custom session config file (default: ~/.myfap-api-cli/session.json) |
--timeout <seconds> |
Server request timeout in seconds; can also be set via MYFAP_TIMEOUT |
--api-version <v1 or v2> |
Select API version. Precedence: CLI option, MYFAP_API_VER, session version, then default v2. Legacy sessions without a version still default to v1 |
-c, --campus <campus> |
Campus code. Precedence: CLI option then session. APHL is the default only for v1; v2 requires choosing a campus if no compatible code is stored in the session |
-s, --semester <semester> |
Semester name (e.g., Fall2026) |
-cid, --courseid <id> |
Internal numeric course ID, only available on marks (e.g., 82934 from the semester grade table, not subject codes like PRO192 or SWE201c) |
-w, --week <week> |
Week number, only available on week-timetable |
-y, --year <year> |
Academic year, only available on week-timetable |
-d, --date <YYYY-MM-DD> |
Specific date, only available on week-timetable |
-sc, --subjectcode <code> |
Subject code, only available on attendance |
-cn, --classname <class> |
Class name, only available on attendance |
--ics |
Export to ICS for easy import into Google Calendar or other calendar apps; supported on schedule (classes) and exams (exam schedule) |
--full |
Include all extra fields when exporting ICS on exams (default exports key fields: subject, exam room, and result announcement date) |
-p, --pretty |
Parse the raw HTML grade tables into JSON; supported on marks and transcript |
--output, -o <dir> |
Output directory instead of the current working directory |
--stdout |
Print output to stdout instead of saving a file |
-f, --force |
Force re-login and ignore session.json; only available on login |
Further Documentation
(Note: detailed documentation under docs/ is currently written in Vietnamese.)
- Choosing API v1 or v2:
v2is the default when no session exists; precedence rules and usingv1 - Usage Examples
- Setting up a dev environment with uv
- CI and Artifact Checks
Credits
- Internal APIs reverse engineered from myFAP Android: version 2.0.6, versionCode 31
- JADX: decompiling and unpacking the Android APK
- Hermes decomp: decompiling
index.android.bundleinto readable JavaScript - Burp Suite Community Edition: intercepting packets and dynamic analysis of myFAP
- Playwright: handles the browser OAuth login flow
- Typer & Rich: CLI framework and terminal UI
- Beautiful Soup: HTML parsing and extraction
- ics.py: generating and normalizing iCalendar files for calendar imports
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for myfap 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| myfap-0.2.0.tar.gz | 40.6 kB | With provenance | Details for myfap-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| myfap-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for myfap-0.2.0-py3-none-any.whl |
Total release size: 82.0 kB
Release files / myfap-0.2.0.tar.gz
| Download URL | myfap-0.2.0.tar.gz |
|---|---|
| Size | 40.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05abee97ed3de44e35c6b4f28a5dba71331c1472efeac460ce581348a96cc187
|
|
BLAKE2b-256 checksum How to use checksums |
4fb2ce6f1cdfca0a80819e59791e8152e7101b7110cf52e0b451bcbe5add95a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / myfap-0.2.0-py3-none-any.whl
| Download URL | myfap-0.2.0-py3-none-any.whl |
|---|---|
| Size | 41.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86a38446af32a132d01e35ab59424be3c7613735779c1aceea6a8ee991d2f3ec
|
|
BLAKE2b-256 checksum How to use checksums |
d2330b9e166587564b9a4bc234d360aaef0587cbe48a67243a6586affe63024d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for myfap 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for myfap-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.