Case study / Open Source Builder
Ryuk-me/UMS-Api
FastAPI wrapper for LPU's portal that turns session-based pages into structured JSON for CGPA, attendance, and placement data.
At a glance
- LPU's portal has no official API.
- Core flow: Credentials -> LPU Auth -> Session -> Scraper
- Primary stack: Python, FastAPI, BeautifulSoup, aiohttp
Request flow
Credentials → scraped portal → JSON
Student credentials go in, the API logs into LPU's portal and holds the session cookie, scrapes the authenticated HTML, and returns structured data — no manual portal navigation needed.
Credentials
Student sends registration number + password to /api/v1/user/login
LPU Auth
API POSTs to LPU's portal → receives ASP.NET_SessionId cookie
Session
Cookie stored per request — reused until it expires, then refreshed
Scraper
Authenticated GET to portal → BeautifulSoup extracts CGPA, attendance, profile
Response
JSON with name, CGPA, attendance, profile image (Base64)
Credentials
Student sends registration number + password to /api/v1/user/login
LPU Auth
API POSTs to LPU's portal → receives ASP.NET_SessionId cookie
Session
Cookie stored per request — reused until it expires, then refreshed
Scraper
Authenticated GET to portal → BeautifulSoup extracts CGPA, attendance, profile
Response
JSON with name, CGPA, attendance, profile image (Base64)
Contributions
What I built
- Built dual-portal login — separate auth flows for the UMS academic portal and the placement portal.
- Implemented /api/v1/user/me to return name, CGPA, attendance, and profile image in one call.
- Added LPU Live directory search, Docker Compose setup, Pytest coverage, and a Postman collection.
Technical decisions
Key engineering decisions
- Session cookies are managed per request — the API handles the full cookie lifecycle so callers don't need to.
- Profile images come back as Base64 strings because LPU's portal doesn't expose direct image URLs.
- aiohttp for async HTTP so multiple requests to the portal can run concurrently.
Challenges
Constraints and challenges
- LPU's portal has no official API — every endpoint was reverse-engineered from browser traffic and form submissions.
- Any markup change upstream silently breaks the scrapers with no contract or versioning to rely on.
- LPU Live search requires tokens manually extracted from the browser, which limits how far automation can go.
Outcomes
Impact
- Students can fetch CGPA, attendance, and placement data programmatically instead of manual portal navigation.
- Supports both academic and placement portals under one API service.
- Includes Docker Compose, tests, and Postman collection for fast local setup.