RateMyProfessors API Client

npm downloads

A typed, retrying, rate-limited unofficial TypeScript client for RateMyProfessors. Search schools and professors, fetch ratings, and build scripts or tools on top of RMP with a simple API and full TypeScript types.

Disclaimer: This library is unofficial and may break if RMP changes their internal API. Use responsibly and respect rate limits.

Requirements #

Installation #

npm install ratemyprofessors-client

Quick Start #

Create a client and start querying:

import { RMPClient } from "ratemyprofessors-client";

const client = new RMPClient();

try {
  const schools = await client.searchSchools("Queen's University");
  console.log(schools.schools[0]?.name);

  const prof = await client.getProfessor("2823076");
  console.log(prof.name, prof.overall_rating);

  for await (const rating of client.iterProfessorRatings(prof.id)) {
    console.log(rating.date, rating.quality, rating.comment);
  }
} finally {
  await client.close();
}

Available Functions #

All methods are async. See the full reference for parameters, return types, and examples.

Schools

Professors

Low-level

Errors #

All errors extend RMPError. Catch and narrow with instanceof. See the full error reference.

Types #

All methods return typed data. See the full type reference.

import type {
  School, Professor, Rating, SchoolRating,
  ProfessorSearchResult, SchoolSearchResult,
  ProfessorRatingsPage, SchoolRatingsPage,
  CompareSchoolsResult,
} from "ratemyprofessors-client";

Extras #

Optional helpers for data pipelines. See the extras reference.

import {
  normalizeComment, isValidComment,
  cleanCourseLabel, buildCourseMapping,
  analyzeSentiment,
} from "ratemyprofessors-client/extras";