A lightweight Go API that scrapes course schedule data from SIX ITB (Sistem Informasi Akademik ITB).
- Go 1.21+
- Valid SIX ITB session cookies (
nissinandkhongguan)
go run main.goThe server starts on :8080.
All requests must include the nissin and khongguan authentication cookies.
All responses use a standard JSON envelope:
// Success
{
"success": true,
"data": { ... }
}
// Error
{
"success": false,
"error": "descriptive error message"
}Returns the authenticated student's ID and current semester.
Response:
{
"success": true,
"data": {
"student_id": "10223085",
"semester": "2025-2"
}
}Returns the class schedule for a given student and semester.
Required query parameters:
| Parameter | Description |
|---|---|
student_id |
Student ID (from /api/user) |
semester |
Semester code, e.g. 2025-2 |
Optional query parameters:
| Parameter | Description |
|---|---|
fakultas |
Filter by faculty |
prodi |
Filter by program |
pekan |
Filter by week |
kegiatan |
Filter by activity |
refresh |
Set to true to bypass cache |
Example:
GET /api/schedule?student_id=10223085&semester=2025-2
Response:
{
"success": true,
"data": [
{
"code": "FI1210",
"name": "Fisika Dasar",
"sks": 3,
"class_no": "01",
"quota": 45,
"lecturers": ["Dosen A", "Dosen B"],
"notes": "",
"schedules": [
{
"day": "Senin",
"time": "07:00-09:00",
"room": "7602",
"activity": "Kuliah",
"method": "Offline"
}
]
}
],
"meta": {
"fetched_at": "2025-02-08T12:34:56Z",
"cached": false
}
}The meta field is included in schedule responses:
fetched_at— when the data was last fetched from SIXcached— whether the response was served from cache
Schedule responses are cached in memory for 5 minutes. To force a fresh fetch, add refresh=true to the query string.
go test -v ./...