API
Developer
REST API
Reference
WebSoc

WebSoc

The WebSoc (Web Schedule of Classes) endpoint allows programmatic access to the UCI Schedule of Classes.

PeterPortal API maintains a cache of all WebSoc data, which is updated every hour. By default, the endpoint will return data from the cache if it can, falling back to WebSoc on a cache miss. This improves the overall response time, but may result in stale data.

Query the Schedule of Classes

Query parameters

year string Required

The year to query.

quarter Fall | Winter | Spring | Summer1 | Summer10wk | Summer2 Required

The quarter to query. Case-sensitive.

cache boolean

Whether to query the cache at all; defaults to true. If this is set to false, then the endpoint will query WebSoc directly instead. Note that disabling the cache for large queries may result in a timeout.

cacheOnly boolean

Whether to use the cache exclusively; defaults to false. If this is set to true, then none of the following parameters marked with * are required, but cache misses will not result in a fallback query.

includeCoCourses boolean

When querying by GE categories, the default behavior of WebSoc is to return only the main section of the course that satisfies the desired GE category. Setting this flag to true also returns any co-courses (discussions, labs, etc.) associated with the main section, but requires cacheOnly to also be set to true.

To preserve backwards compatibility with WebSoc, this defaults to false.

ge* ANY | GE-1A | GE-1B | GE-2 | GE-3 | GE-4 | GE-5A | GE-5B | GE-6 | GE-7 | GE-8

The GE category code. Case-sensitive. Defaults to ANY.

department* string

The department code.

sectionCodes* string | string[]

The five-digit section code(s).

instructorName* string

Any substring of the desired instructor's last name. To search an exact last name, append a comma to the parameter.

If cacheOnly is false, at least one of the parameters marked with * must be provided and must not be ANY.

building string

The building code.

room string

The room number.

If the room number is provided, the building code must be provided.

division ANY | LowerDiv | UpperDiv | Graduate

The course level/division code. Case-sensitive. Defaults to ANY.

courseNumber string | string[]

The course number(s) and/or range(s). (Ex.: 122A, 160-169)

courseTitle string

Any substring of the course title.

sectionType ANY | Act | Col | Dis | Fld | Lab | Lec | Qiz | Res | Sem | Stu | Tap | Tut

The section type code. Case-sensitive. Defaults to ANY.

units string | string[]

The number(s) of units approved for the section and/or the string VAR for any section with variable units.

days string | string[]

The day(s) that a section meets on. (Ex.: MWF)

startTime string

The time on or after which a section starts.

endTime string

The time by which a section ends.

maxCapacity string

The maximum capacity of a section. (Ex.: >200, <21, =69)

fullCourses ANY | SkipFull | SkipFullWaitlist | FullOnly | OverEnrolled

Which sections to exclude based on their enrollment status. Case-sensitive. Defaults to ANY.

cancelledCourses Exclude | Include | Only

Which sections to exclude based on their cancellation status. Case-sensitive. Defaults to Exclude.

Code sample

curl "https://api-next.peterportal.org/v1/rest/websoc"

Response

Section with no final exam
curl "https://api-next.peterportal.org/v1/rest/websoc?year=2023&quarter=Spring&sectionCodes=34271"
{
  "schools": [
    {
      "schoolName": "Donald Bren School of Information and Computer Sciences",
      "schoolComment": "...",
      "departments": [
        {
          "deptComment": "...",
          "sectionCodeRangeComments": [],
          "courseNumberRangeComments": ["..."],
          "deptCode": "COMPSCI",
          "deptName": "Computer Science",
          "courses": [
            {
              "deptCode": "COMPSCI",
              "courseComment": "",
              "prerequisiteLink": "https://www.reg.uci.edu/cob/prrqcgi?term=202314&dept=COMPSCI&action=view_by_term#162",
              "courseNumber": "162",
              "courseTitle": "FORMAL LANG & AUTM",
              "sections": [
                {
                  "sectionCode": "34271",
                  "sectionType": "Dis",
                  "sectionNum": "A",
                  "units": "0",
                  "instructors": ["DEES, M.", "CHIU, A.", "SHINDLER, M."],
                  "meetings": [
                    {
                      "timeIsTBA": false,
                      "bldg": ["SSH 100"],
                      "days": "Tu",
                      "startTime": { "hour": 19, "minute": 0 },
                      "endTime": { "hour": 19, "minute": 50 }
                    }
                  ],
                  "finalExam": {
                    "examStatus": "NO_FINAL",
                    "dayOfWeek": null,
                    "month": null,
                    "day": null,
                    "startTime": null,
                    "endTime": null,
                    "bldg": null
                  },
                  "maxCapacity": "249",
                  "numCurrentlyEnrolled": {
                    "totalEnrolled": "170",
                    "sectionEnrolled": "169"
                  },
                  "numOnWaitlist": "",
                  "numWaitlistCap": "",
                  "numRequested": "219",
                  "numNewOnlyReserved": "",
                  "restrictions": "A",
                  "status": "OPEN",
                  "sectionComment": "\n\t\t\t    <p>Same as 65131 (LSCI 102, Dis A).</p>\n\t\t\t    "
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
Section with TBA meeting time and final exam
curl "https://api-next.peterportal.org/v1/rest/websoc?year=2023&quarter=Spring&sectionCodes=34160"
{
  "schools": [
    {
      "schoolName": "Donald Bren School of Information and Computer Sciences",
      "schoolComment": "...",
      "departments": [
        {
          "deptComment": "...",
          "sectionCodeRangeComments": [],
          "courseNumberRangeComments": ["..."],
          "deptCode": "COMPSCI",
          "deptName": "Computer Science",
          "courses": [
            {
              "deptCode": "COMPSCI",
              "courseComment": "",
              "prerequisiteLink": "https://www.reg.uci.edu/cob/prrqcgi?term=202314&dept=COMPSCI&action=view_by_term#143A",
              "courseNumber": "143A",
              "courseTitle": "PRNCPLS OPERTNG SYS",
              "sections": [
                {
                  "sectionCode": "34160",
                  "sectionType": "Lec",
                  "sectionNum": "A",
                  "units": "4",
                  "instructors": ["BIC, L.", "GIYAHCHI, T.", "YI, S."],
                  "meetings": [
                    {
                      "timeIsTBA": true,
                      "bldg": ["ON LINE"],
                      "days": null,
                      "startTime": null,
                      "endTime": null
                    }
                  ],
                  "finalExam": {
                    "examStatus": "TBA_FINAL",
                    "dayOfWeek": null,
                    "month": null,
                    "day": null,
                    "startTime": null,
                    "endTime": null,
                    "bldg": null
                  },
                  "maxCapacity": "125",
                  "numCurrentlyEnrolled": {
                    "totalEnrolled": "124",
                    "sectionEnrolled": ""
                  },
                  "numOnWaitlist": "",
                  "numWaitlistCap": "",
                  "numRequested": "186",
                  "numNewOnlyReserved": "",
                  "restrictions": "A",
                  "status": "OPEN",
                  "sectionComment": ""
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
Section with a final exam held in the same location as the lecture
curl "https://api-next.peterportal.org/v1/rest/websoc?year=2023&quarter=Spring&sectionCodes=34270"
{
  "schools": [
    {
      "schoolName": "Donald Bren School of Information and Computer Sciences",
      "schoolComment": "...",
      "departments": [
        {
          "deptComment": "...",
          "sectionCodeRangeComments": [],
          "courseNumberRangeComments": ["..."],
          "deptCode": "COMPSCI",
          "deptName": "Computer Science",
          "courses": [
            {
              "deptCode": "COMPSCI",
              "courseComment": "",
              "prerequisiteLink": "https://www.reg.uci.edu/cob/prrqcgi?term=202314&dept=COMPSCI&action=view_by_term#162",
              "courseNumber": "162",
              "courseTitle": "FORMAL LANG & AUTM",
              "sections": [
                {
                  "sectionCode": "34270",
                  "sectionType": "Lec",
                  "sectionNum": "A",
                  "units": "4",
                  "instructors": ["SHINDLER, M."],
                  "meetings": [
                    {
                      "timeIsTBA": false,
                      "bldg": ["ALP 2300"],
                      "days": "MWF",
                      "startTime": { "hour": 10, "minute": 0 },
                      "endTime": { "hour": 10, "minute": 50 }
                    }
                  ],
                  "finalExam": {
                    "examStatus": "SCHEDULED_FINAL",
                    "dayOfWeek": "Mon",
                    "month": 5,
                    "day": 12,
                    "startTime": { "hour": 10, "minute": 30 },
                    "endTime": { "hour": 12, "minute": 30 },
                    "bldg": ["ALP 2300"]
                  },
                  "maxCapacity": "249",
                  "numCurrentlyEnrolled": {
                    "totalEnrolled": "170",
                    "sectionEnrolled": "169"
                  },
                  "numOnWaitlist": "",
                  "numWaitlistCap": "",
                  "numRequested": "246",
                  "numNewOnlyReserved": "",
                  "restrictions": "A",
                  "status": "OPEN",
                  "sectionComment": "\n\t\t\t    <p>Same as 65130 (LSCI 102, Lec A).</p>\n\t\t\t    "
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
Section with multiple meetings and final exam held in a different location
curl "https://api-next.peterportal.org/v1/rest/websoc?year=2023&quarter=Spring&sectionCodes=44000"
{
  "schools": [
    {
      "schoolName": "School of Physical Sciences",
      "schoolComment": "...",
      "departments": [
        {
          "deptComment": "...",
          "sectionCodeRangeComments": [],
          "courseNumberRangeComments": [],
          "deptCode": "MATH",
          "deptName": "Mathematics",
          "courses": [
            {
              "deptCode": "MATH",
              "courseComment": "...",
              "prerequisiteLink": "https://www.reg.uci.edu/cob/prrqcgi?term=202314&dept=MATH&action=view_by_term#2A",
              "courseNumber": "2A",
              "courseTitle": "CALCULUS I",
              "sections": [
                {
                  "sectionCode": "44000",
                  "sectionType": "Lec",
                  "sectionNum": "A",
                  "units": "4",
                  "instructors": ["HUBER, K."],
                  "meetings": [
                    {
                      "timeIsTBA": false,
                      "bldg": ["ON LINE"],
                      "days": "WF",
                      "startTime": { "hour": 10, "minute": 0 },
                      "endTime": { "hour": 10, "minute": 50 }
                    },
                    {
                      "timeIsTBA": false,
                      "bldg": ["ALP 1300"],
                      "days": "M",
                      "startTime": { "hour": 10, "minute": 0 },
                      "endTime": { "hour": 10, "minute": 50 }
                    }
                  ],
                  "finalExam": {
                    "examStatus": "SCHEDULED_FINAL",
                    "dayOfWeek": "Sat",
                    "month": 5,
                    "day": 10,
                    "startTime": { "hour": 13, "minute": 30 },
                    "endTime": { "hour": 15, "minute": 30 },
                    "bldg": ["HIB 100"]
                  },
                  "maxCapacity": "295",
                  "numCurrentlyEnrolled": {
                    "totalEnrolled": "282",
                    "sectionEnrolled": ""
                  },
                  "numOnWaitlist": "",
                  "numWaitlistCap": "",
                  "numRequested": "593",
                  "numNewOnlyReserved": "",
                  "restrictions": "A",
                  "status": "OPEN",
                  "sectionComment": ""
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Get a list of available departments

Query parameters

None.

Response

[
  {
    "deptLabel": "ALL: Include All Departments",
    "deptValue": "ALL"
  },
  {
    "deptLabel": "AC ENG: Academic English",
    "deptValue": "AC ENG"
  },
  "..."
]

Get a list of available departments

Query parameters

None.

Response

[
  {
    "shortName": "2023 Summer2",
    "longName": "2023 Summer Session 2"
  },
  {
    "shortName": "2023 Summer10wk",
    "longName": "2023 10-wk Summer"
  },
  {
    "shortName": "2023 Summer1",
    "longName": "2023 Summer Session 1"
  },
  {
    "shortName": "2023 Spring",
    "longName": "2023 Spring Quarter"
  },
  "..."
]