Skip to content

Department and lecture search

A small server that returns departments and lectures as JSON. A front end only needs these two URLs.

The example server’s HTTP requests (all GET), and the library methods it calls. Names follow Python snake_case; Node.js takes a camelCase options object and Java takes positional arguments. No login is needed.

Example server

URL Parameter Required Meaning
/departments No parameters
/lectures department No Department code
name No Course name (substring). Requiring one of the two is a rule of this example server

Library methods

Method Parameter Type Required Default Meaning
departments category_code string Yes Organization category (20 undergraduate)
year string Yes Year
semester_code string Yes Semester code (10 first, 20 second, 11 and 21 seasonal)
lectures category_code, year, semester_code string Yes Same as above
department_code string No empty string Department code
course_name string No empty string Course name
instructor_name string No empty string Instructor name. With all three conditions empty you get the whole term

The example code targets undergraduate ("20"); year and semester ("20" = second semester) are constants at the top of the code. All code values are the school’s own; list them with organization_categories() and terms(...) (Department and term codes).

The JSON the example server returns. The top block is the response of GET /departments, the bottom one of GET /lectures?...; values only show the shape. Key names follow the Python example; in the Node.js example course_number is courseNumber. The Java controller returns the library models (Department, Lecture) as they are, so it has more fields, named in camelCase.

[
{ "code": "3517", "college": "인공지능융합대학", "name": "AI로봇학과" },
{ "code": "3331", "college": "연계전공", "name": "스마트투어리즘매니지먼트소프트웨어" }
]
[
{
"course": "알고리즘및실습",
"department": "컴퓨터공학과",
"schedule": "화13:00-15:00",
"credits": "3.0",
"course_number": "009954"
}
]
Field Meaning
code Department code. Pass it as-is to /lectures?department=
college / name College / department (or major) name
course / department Course name / offering department name
schedule Weekday and time (school text, for example 화13:00-15:00)
credits Credits (string)
course_number Course number. Usable to continue to the curriculum lookup

For every field the library returns, see Course listings and Department and term codes.

On failure: when the school server fails you get the last cached value or an empty list, without an exception. The example server returns it as an empty array ([]).

  • Department code, course name and instructor name of lectures are all optional. With all of them empty you get the whole term: a response of several MB (Course listings), so the example server requires a condition. If you need everything, query department by department.
  • Lecture results include the instructor name (instructor). The examples return only selected fields; decide which fields to expose when you publish this.
  • Course-name search matches substrings. Some names return 0 results, so show an empty-result hint.
  • A lecture’s course_number and department_code lead on to the department curriculum entry (grade, semester, course overview) with curriculum_courses. Curriculum
import java.util.List;
import kr.suhsaechan.sejongpeia.publicdata.SejongPublicData;
import kr.suhsaechan.sejongpeia.publicdata.model.Department;
import kr.suhsaechan.sejongpeia.publicdata.model.Lecture;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
class LectureSearchController {
private static final String UNDERGRADUATE_CATEGORY = "20";
private static final String YEAR = "2026";
private static final String SEMESTER = "20";
private final SejongPublicData publicData;
LectureSearchController(SejongPublicData publicData) {
this.publicData = publicData;
}
@GetMapping("/departments")
List<Department> departments() {
return publicData.departments(UNDERGRADUATE_CATEGORY, YEAR, SEMESTER);
}
@GetMapping("/lectures")
List<Lecture> lectures(@RequestParam(defaultValue = "") String department,
@RequestParam(defaultValue = "") String name) {
if (department.isBlank() && name.isBlank()) { // no condition returns the whole term (several MB), so this server requires one
return List.of();
}
return publicData.lectures(UNDERGRADUATE_CATEGORY, YEAR, SEMESTER, department, name, "");
}
}