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.

FieldTypeDescription
idstringLegacy numeric ID (from RMP URLs)
namestringSchool name
locationstring | nullCity, state, country
overall_qualitynumber | nullAverage overall rating
num_ratingsnumber | nullTotal number of ratings
reputationnumber | nullReputation rating
safetynumber | nullSafety rating
happinessnumber | nullSatisfaction / happiness rating
facilitiesnumber | nullCampus condition rating
socialnumber | nullSocial activities rating
location_ratingnumber | nullCampus location rating
clubsnumber | nullClubs and events rating
opportunitiesnumber | nullCareer opportunities rating
internetnumber | nullInternet speed rating
foodnumber | nullFood quality rating

Professor #

A professor (teacher) as returned by search, getProfessor(), or ratings pages.

FieldTypeDescription
idstringLegacy numeric ID
namestringFull name
departmentstring | nullDepartment name
schoolSchool | nullAssociated school
urlstring | nullRMP profile URL
overall_ratingnumber | nullAverage rating
num_ratingsnumber | nullTotal number of ratings
percent_take_againnumber | null"Would take again" percentage
level_of_difficultynumber | nullAverage difficulty
tagsstring[]Tag list
rating_distributionRecord<number, RatingDistributionBucket> | nullStar distribution

Rating #

A single professor rating (review).

FieldTypeDescription
dateDateDate the rating was submitted
commentstringReview text
qualitynumber | nullQuality / clarity rating
difficultynumber | nullDifficulty rating
tagsstring[]Tags (e.g. "Tough grader")
course_rawstring | nullRaw course name as entered by the reviewer
detailsRecord<string, unknown> | nullExtra info: for_credit, attendance, grade, textbook
thumbs_upnumber | nullHelpful upvote count
thumbs_downnumber | nullNot-helpful downvote count

SchoolRating #

A single school rating (review). overall is the average of all category scores.

FieldTypeDescription
dateDateDate the rating was submitted
commentstringReview text
overallnumber | nullAverage of all category scores
category_ratingsRecord<string, number> | nullPer-category scores
thumbs_upnumber | nullHelpful upvote count
thumbs_downnumber | nullNot-helpful downvote count

RatingDistributionBucket #

One bucket in a professor's star-rating distribution.

FieldTypeDescription
countnumberNumber of ratings in this bucket
percentagenumberPercentage of total ratings
Currently always null in GraphQL API responses. Kept for forward compatibility.

ProfessorSearchResult #

Paginated result from searchProfessors() or listProfessorsForSchool().

FieldTypeDescription
professorsProfessor[]Professors on this page
totalnumber | nullTotal result count
page_sizenumberNumber of results returned
has_next_pagebooleanWhether more results are available
next_cursorstring | nullPass to the next call for the next page

SchoolSearchResult #

Paginated result from searchSchools().

FieldTypeDescription
schoolsSchool[]Schools on this page
totalnumber | nullTotal result count
page_sizenumberNumber of results returned
has_next_pagebooleanWhether more results are available
next_cursorstring | nullPass to the next call for the next page

ProfessorRatingsPage #

One page of professor ratings. Subsequent pages are served from an in-memory cache.

FieldTypeDescription
professorProfessorThe professor these ratings belong to
ratingsRating[]Ratings on this page
has_next_pagebooleanWhether more ratings are available
next_cursorstring | nullPass to the next call for more ratings

SchoolRatingsPage #

One page of school ratings.

FieldTypeDescription
schoolSchoolThe school these ratings belong to
ratingsSchoolRating[]Ratings on this page
has_next_pagebooleanWhether more ratings are available
next_cursorstring | nullPass to the next call for more ratings

CompareSchoolsResult #

Result of comparing two schools.

FieldTypeDescription
school_1SchoolFirst school
school_2SchoolSecond school