Types
All methods return typed data. Import any interface you need:
import type {
School, Professor, Rating, SchoolRating,
RatingDistributionBucket, ProfessorSearchResult,
SchoolSearchResult, ProfessorRatingsPage,
SchoolRatingsPage, CompareSchoolsResult,
} from "ratemyprofessors-client";
School #
A school (university or college). Category fields are populated by getSchool() but may be absent in search results.
| Field | Type | Description |
|---|---|---|
id | string | Legacy numeric ID (from RMP URLs) |
name | string | School name |
location | string | null | City, state, country |
overall_quality | number | null | Average overall rating |
num_ratings | number | null | Total number of ratings |
reputation | number | null | Reputation rating |
safety | number | null | Safety rating |
happiness | number | null | Satisfaction / happiness rating |
facilities | number | null | Campus condition rating |
social | number | null | Social activities rating |
location_rating | number | null | Campus location rating |
clubs | number | null | Clubs and events rating |
opportunities | number | null | Career opportunities rating |
internet | number | null | Internet speed rating |
food | number | null | Food quality rating |
Professor #
A professor (teacher) as returned by search, getProfessor(), or ratings pages.
| Field | Type | Description |
|---|---|---|
id | string | Legacy numeric ID |
name | string | Full name |
department | string | null | Department name |
school | School | null | Associated school |
url | string | null | RMP profile URL |
overall_rating | number | null | Average rating |
num_ratings | number | null | Total number of ratings |
percent_take_again | number | null | "Would take again" percentage |
level_of_difficulty | number | null | Average difficulty |
tags | string[] | Tag list |
rating_distribution | Record<number, RatingDistributionBucket> | null | Star distribution |
Rating #
A single professor rating (review).
| Field | Type | Description |
|---|---|---|
date | Date | Date the rating was submitted |
comment | string | Review text |
quality | number | null | Quality / clarity rating |
difficulty | number | null | Difficulty rating |
tags | string[] | Tags (e.g. "Tough grader") |
course_raw | string | null | Raw course name as entered by the reviewer |
details | Record<string, unknown> | null | Extra info: for_credit, attendance, grade, textbook |
thumbs_up | number | null | Helpful upvote count |
thumbs_down | number | null | Not-helpful downvote count |
SchoolRating #
A single school rating (review). overall is the average of all category scores.
| Field | Type | Description |
|---|---|---|
date | Date | Date the rating was submitted |
comment | string | Review text |
overall | number | null | Average of all category scores |
category_ratings | Record<string, number> | null | Per-category scores |
thumbs_up | number | null | Helpful upvote count |
thumbs_down | number | null | Not-helpful downvote count |
RatingDistributionBucket #
One bucket in a professor's star-rating distribution.
| Field | Type | Description |
|---|---|---|
count | number | Number of ratings in this bucket |
percentage | number | Percentage of total ratings |
Currently always
null in GraphQL API responses. Kept for forward compatibility.ProfessorSearchResult #
Paginated result from searchProfessors() or listProfessorsForSchool().
| Field | Type | Description |
|---|---|---|
professors | Professor[] | Professors on this page |
total | number | null | Total result count |
page_size | number | Number of results returned |
has_next_page | boolean | Whether more results are available |
next_cursor | string | null | Pass to the next call for the next page |
SchoolSearchResult #
Paginated result from searchSchools().
| Field | Type | Description |
|---|---|---|
schools | School[] | Schools on this page |
total | number | null | Total result count |
page_size | number | Number of results returned |
has_next_page | boolean | Whether more results are available |
next_cursor | string | null | Pass to the next call for the next page |
ProfessorRatingsPage #
One page of professor ratings. Subsequent pages are served from an in-memory cache.
| Field | Type | Description |
|---|---|---|
professor | Professor | The professor these ratings belong to |
ratings | Rating[] | Ratings on this page |
has_next_page | boolean | Whether more ratings are available |
next_cursor | string | null | Pass to the next call for more ratings |
SchoolRatingsPage #
One page of school ratings.
| Field | Type | Description |
|---|---|---|
school | School | The school these ratings belong to |
ratings | SchoolRating[] | Ratings on this page |
has_next_page | boolean | Whether more ratings are available |
next_cursor | string | null | Pass to the next call for more ratings |
CompareSchoolsResult #
Result of comparing two schools.
| Field | Type | Description |
|---|---|---|
school_1 | School | First school |
school_2 | School | Second school |