# Rate My Professors Search ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/ratemyprofessors/search` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 2 credits per call | | **Documentation** | https://www.piloterr.com/library/ratemyprofessors-search | ## Description Search Rate My Professors by name. Cards include school, department, difficulty, and would-take-again when the card shows them. ## Authentication - **Key Name:** `x-api-key` - **Location:** HTTP Header - **Get an API key:** https://app.piloterr.com/register ## Example Request ```bash curl --location --request GET 'https://api.piloterr.com/v2/ratemyprofessors/search' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### Kevin Smith ```json { "results": [ { "id": "1064107", "url": "https://www.ratemyprofessors.com/professor/1064107", "name": "Kevin Smith", "rating": 4.6, "school": "Rio Hondo College", "department": "Psychology", "difficulty": 3.1, "ratings_count": 174, "would_take_again_percent": 94 } ], "pagination": { "next": null, "page": 1, "per_page": 5, "total_pages": null, "total_results": 10000 } } ``` ## Documentation ## Overview Search professors on Rate My Professors. Send a name such as `smith` or `chen`. The response is `{ results, pagination }` for the cards rendered on the first view. Pass `results[].id` to `/v2/ratemyprofessors/professor`. When a card prints them, `difficulty` and `would_take_again_percent` are numbers. `N/A` on the card becomes `null`. ## Quickstart ``` GET https://api.piloterr.com/v2/ratemyprofessors/search?query=smith GET https://api.piloterr.com/v2/ratemyprofessors/search?query=chen ``` GET and POST take the same `query`. `smith` includes professor `1064107`, Kevin Smith, Psychology at Rio Hondo College, with a numeric difficulty and would-take-again percent. The professor call for `1064107` returns the same id, name, school, difficulty, and percent. ## Parameters | Parameter | Required | Example | |---|---|---| | `query` | yes | `smith` | `query` is required. A URL must be on `ratemyprofessors.com` and look like a professor search (`/search/professors` or `q=`). Another host returns 400. There is no `page` parameter. ## Pagination The site shows the first cards and a header count. `pagination.page` is `1`. `pagination.next` is `null` because further professors load inside the page and the HTML has no next URL. Do not invent one. `pagination.per_page` is the number of cards parsed, `5` for `smith` and for `chen`. `pagination.total_results` is the count in the header. For `smith` that header is capped at `10000`. `pagination.total_pages` is `null`. Ids are unique on the page. ## Response fields | Field | Type | Meaning | |---|---|---| | `results[].id` | string | Professor id | | `results[].name` | string | Name as printed | | `results[].url` | string | `https://www.ratemyprofessors.com/professor/{id}` | | `results[].school` | string or null | School | | `results[].department` | string or null | Department | | `results[].rating` | number or null | Quality rating | | `results[].ratings_count` | number or null | Number of ratings | | `results[].would_take_again_percent` | number or null | Percent who would take the professor again. `null` when the card shows N/A | | `results[].difficulty` | number or null | Difficulty. `null` when the card shows N/A | | `pagination.page` | integer | `1` | | `pagination.per_page` | integer or null | Cards returned | | `pagination.total_results` | number or null | Header count, capped by the site | | `pagination.total_pages` | null | No page count | | `pagination.next` | null | No next URL | ## Use cases - Find id `1064107` for Kevin Smith in Psychology at Rio Hondo College from the keyword `smith`. - Compare `difficulty` and `would_take_again_percent` across the first `chen` cards before opening a profile. - Keep the header `total_results` as the site's capped count, and treat `next` `null` as the end of this response. ## Error codes | Code | Meaning | |---|---| | `400` | Empty query or a domain outside ratemyprofessors.com | | `401` | Missing API key | | `404` | The page was not a professor search | | `500` | The fetch failed | ## Related endpoints [Rate My Professors Professor](https://www.piloterr.com/library/ratemyprofessors-professor)