Skip to content

Schedule of Classes

📆 Find information on UCI Schedule of Classes here.

Try out one of these quick ways to play with our grades endpoints:

$ curl https://api.peterportal.org/rest/v0/schedule/soc?term=2018%20Fall&department=COMPSCI&courseNumber=161

{
    "schools": [
        {
            "departments": [
                {
                    "courseNumberRangeComments": [],
                    "courses": [
                        {
                            "courseComment": "",
                            "courseNumber": "161",
                            "courseTitle": "DES&ANALYS OF ALGOR",
                            "deptCode": "COMPSCI",
                            "prerequisiteLink": "https://www.reg.uci.edu/cob/prrqcgi?term=201892&dept=COMPSCI&action=view_by_term#161",
                            "sections": [
                                ...
                                {
                                    "finalExam": "",
                                    "instructors": [
                                        "KUMAR, A.",
                                        "DILLENCOURT, M."
                                    ],
                                    "maxCapacity": "108",
                                    "meetings": [
                                        {
                                            "bldg": "SSL 248",
                                            "days": "TuTh",
                                            "time": " 5:00- 5:50p"
                                        }
                                    ],
                                    "numCurrentlyEnrolled": {
                                        "sectionEnrolled": "",
                                        "totalEnrolled": "105"
                                    },
                                    "numNewOnlyReserved": "",
                                    "numOnWaitlist": "",
                                    "numRequested": "143",
                                    "restrictions": "A",
                                    "sectionCode": "34191",
                                    "sectionComment": "",
                                    "sectionNum": "1",
                                    "sectionType": "Dis",
                                    "status": "OPEN",
                                    "units": "0"
                                },
                                ...
                    ],
                    "deptCode": "COMPSCI",
                    "deptComment": "...",
                    "deptName": "Computer Science",
                    "sectionCodeRangeComments": []
                }
            ],
            "schoolComment": "...",
            "schoolName": "Donald Bren School of Information and Computer Sciences"
        }
    ]
}
$ python -m pip install requests
---> 100%
$ python
Python 3.8.5
# >>>$ import requests
# >>>$ response = requests.get("https://api.peterportal.org/rest/v0/schedule/soc?term=2018%20Fall&department=COMPSCI&courseNumber=161")
# >>>$ response.json()

{
    "schools": [
        {
            "departments": [
                {
                    "courseNumberRangeComments": [],
                    "courses": [
                        {
                            "courseComment": "",
                            "courseNumber": "161",
                            "courseTitle": "DES&ANALYS OF ALGOR",
                            "deptCode": "COMPSCI",
                            "prerequisiteLink": "https://www.reg.uci.edu/cob/prrqcgi?term=201892&dept=COMPSCI&action=view_by_term#161",
                            "sections": [
                                ...
                                {
                                    "finalExam": "",
                                    "instructors": [
                                        "KUMAR, A.",
                                        "DILLENCOURT, M."
                                    ],
                                    "maxCapacity": "108",
                                    "meetings": [
                                        {
                                            "bldg": "SSL 248",
                                            "days": "TuTh",
                                            "time": " 5:00- 5:50p"
                                        }
                                    ],
                                    "numCurrentlyEnrolled": {
                                        "sectionEnrolled": "",
                                        "totalEnrolled": "105"
                                    },
                                    "numNewOnlyReserved": "",
                                    "numOnWaitlist": "",
                                    "numRequested": "143",
                                    "restrictions": "A",
                                    "sectionCode": "34191",
                                    "sectionComment": "",
                                    "sectionNum": "1",
                                    "sectionType": "Dis",
                                    "status": "OPEN",
                                    "units": "0"
                                },
                                ...
                    ],
                    "deptCode": "COMPSCI",
                    "deptComment": "...",
                    "deptName": "Computer Science",
                    "sectionCodeRangeComments": []
                }
            ],
            "schoolComment": "...",
            "schoolName": "Donald Bren School of Information and Computer Sciences"
        }
    ]
}

/schedule/soc

GET schedule of classes data

This API allows access to school, department, course, and section data in a hierarchical JSON format. It pulls information from the schedule of classes (WebSoc).

Parameters

Info

Endpoint that utilize query params must follow by this format: ?key1=value1&key2=value2

`?` is use to start the query params string with &  to separate each param

Warning

One problem with department such as I&C SCI and CRM/LAW, since the & and / are reserved for URLs, you must use their URL encode representation. I&C SCI -> I%26C SCI CRM/LAW -> CRM%2FLAW

Descriptions found here

Name Formatting Notes
term [Year] ['Fall'|'Winter'|'Spring'|'Summer1'|'Summer2'|'Summer10wk']
Example: '2017 Fall'
Default: ' '
Required. Schedule for your selected term must be available on WebSoc.
ge ['ANY'|'GE-1A'|'GE-1B'|'GE-2'|'GE-3'|'GE-4'|'GE-5A'|'GE-5B'|'GE-6'|'GE-7'|'GE-8']
Example: 'GE-1B'
Default: ' '
Must specify at least one of department, GE, courseCodes, or instructorName
department List of available departments to search available in file depts.txt
Example: 'I&C SCI'
Default: ' '
Must specify at least one of department, GE, courseCodes, or instructorName
courseNumber Any valid course number or range
Example: '32A' OR '31-33'
Default: ' '
division ['ALL'|'LowerDiv'|'UpperDiv'|'Graduate']
Example: 'LowerDiv'
Default: 'ALL'
sectionCodes Any valid 5-digit course code or range
Example: "36531" OR "36520-36536"
Default: ' '
Must specify at least one of department, GE, courseCodes, or instructorName
instructorName Any valid instructor last name or part of last name
Example: 'Thornton'
Default: ' '
Enter last name only
courseTitle Any text
Example: 'Intro'
Default: ' '
sectionType ['ALL'|'ACT'|'COL'|'DIS'|'FLD'|'LAB'|'LEC'|'QIZ'|'RES'|'SEM'|'STU'|'TAP'|'TUT']
Example: 'LAB'
Default: 'ALL'
units Any integer or decimal with only tenths place precision, or 'VAR' to look for variable unit classes only.
Example: '5' OR '1.3'
Default: ' '
days ['M'|'T'|'W'|'Th'|'F'] or a combination of these days
Example: 'T' OR 'MWF'
Default: ' '
startTime Any time in 12 hour format
Example: '10:00AM' OR '5:00PM'
Default: ' '
Only enter sharp hours
endTime Any time in 12 hour format
Example: '12:00AM' OR '6:00PM'
Default: ' '
Only enter sharp hours
maxCapacity Exact number like '300' or modified with '<' or '>' to indicate less than specified or greater than specified.
Example: '>256' OR '19' OR '<19'
Default: ' '
fullCourses ['ANY'|'SkipFullWaitlist'|'FullOnly'|'OverEnrolled']
'SkipFullWaitlist' means that full courses will be included if there's space on the wait-list
'FullOnly' means only full courses will be retrieved
'OverEnrolled' means only over-enrolled courses will be retrieved
Example:'SkipFullWaitlist'
Default: 'ANY'
cancelledCourses ['Exclude'|'Include'|'Only']
Example: 'Include'
Default: 'EXCLUDE'
building Any valid building code
Example: 'DBH'
Default: ' '
The value is a building code. Building codes found here: https://www.reg.uci.edu/addl/campus/
room Any valid room number
Example: '223'
Default: ' '
You must specify a building code if you specify a room number

Response

Code Description
200 A list of JSON object results containing the course info, count of each grades, and average GPA
400 Invalid parameter syntax.
200 Successful Response

To find the schedule of COMPSCI 161 in 2018 Fall:

`/schedule/soc?term=2018%20Fall&department=COMPSCI&courseNumber=161` returns

``` JSON
{
    "schools": [
        {
            "departments": [
                {
                    "courseNumberRangeComments": [],
                    "courses": [
                        {
                            "courseComment": "",
                            "courseNumber": "161",
                            "courseTitle": "DES&ANALYS OF ALGOR",
                            "deptCode": "COMPSCI",
                            "prerequisiteLink": "https://www.reg.uci.edu/cob/prrqcgi?term=201892&dept=COMPSCI&action=view_by_term#161",
                            "sections": [
                                ...
                                {
                                    "finalExam": "",
                                    "instructors": [
                                        "KUMAR, A.",
                                        "DILLENCOURT, M."
                                    ],
                                    "maxCapacity": "108",
                                    "meetings": [
                                        {
                                            "bldg": "SSL 248",
                                            "days": "TuTh",
                                            "time": " 5:00- 5:50p"
                                        }
                                    ],
                                    "numCurrentlyEnrolled": {
                                        "sectionEnrolled": "",
                                        "totalEnrolled": "105"
                                    },
                                    "numNewOnlyReserved": "",
                                    "numOnWaitlist": "",
                                    "numRequested": "143",
                                    "restrictions": "A",
                                    "sectionCode": "34191",
                                    "sectionComment": "",
                                    "sectionNum": "1",
                                    "sectionType": "Dis",
                                    "status": "OPEN",
                                    "units": "0"
                                },
                                ...
                    ],
                    "deptCode": "COMPSCI",
                    "deptComment": "...",
                    "deptName": "Computer Science",
                    "sectionCodeRangeComments": []
                }
            ],
            "schoolComment": "...",
            "schoolName": "Donald Bren School of Information and Computer Sciences"
        }
    ]
}
```
400 Bad Request

/schedule/soc?term=2018%20Fall&department=COMPSCI&incorrect=161 returns

{
    "timestamp": "Thu, 31 Dec 2020 00:00:00 GMT",
    "status": 400,
    "error":"Bad Request: Invalid parameter",
    "message":"Unable to complete websoc-api query"
}

This endpoint is based off of this npm package with help from AntAlmanac developers.

/schedule/week

GET week and quarter data

This API gets the week and quarter of the school year given a certain date. Default date is today's date.

Parameters

Name Formatting Notes
year YYYY
Example: '2021'
Default: ' '
If out of range will interpret as a school break
month MM
Example: '10'
Default: ' '
day DD
Example: '08'
Default: ' '

Response

Code Description
200 A JSON object containing the week number, and quarter term.
400 Invalid parameter syntax.
200 Successful Response

To get the week and quarter of October 6, 2021:

`/schedule/week/?year=2021&month=10&day=06` returns

``` JSON
{
    "week":2,
    "quarter":"Fall 2021",
    "display":"Week 2 • Fall 2021"
}
```
400 Bad Request

/schedule/week/?year=2021&month=20&day=6 returns

{
    "timestamp":"Mon, 25 Apr 2022 01:19:21 GMT",
    "status":400,
    "error":"Bad Request: Invalid parameter",
    "message":"Invalid year, month or day. Must include all year, month and day or none."}