# Rate My Professors Professor ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/ratemyprofessors/professor` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 2 credits per call | | **Documentation** | https://www.piloterr.com/library/ratemyprofessors-professor | ## Description Read one Rate My Professors profile, including difficulty and would-take-again when the page 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/professor' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### Kevin Smith ```json { "id": "1064107", "url": "https://www.ratemyprofessors.com/professor/1064107", "name": "Kevin Smith", "rating": 4.6, "school": "Rio Hondo College", "last_name": "Smith", "department": "Psychology", "difficulty": 3.1, "first_name": "Kevin", "school_url": "https://www.ratemyprofessors.com/school/2746", "ratings_count": 174, "would_take_again_percent": 94 } ``` ## Documentation ## Overview Read one professor profile on Rate My Professors. Pass the numeric id from search, or a `/professor/{id}` URL. The response is a flat record. `difficulty` and `would_take_again_percent` are numbers when the page shows them, and `null` when the page shows N/A. `1064107` is Kevin Smith, Psychology at Rio Hondo College. The profile repeats the id, name, school, department, rating, difficulty, and would-take-again percent from the `smith` search card. ## Quickstart ``` GET https://api.piloterr.com/v2/ratemyprofessors/professor?query=1064107 GET https://api.piloterr.com/v2/ratemyprofessors/professor?query=275587 ``` GET and POST take the same `query`. `275587` is the first card of a `chen` search (Qiyang Chen) and returns that same id with numeric difficulty and would-take-again. ## Parameters | Parameter | Required | Example | |---|---|---| | `query` | yes | `1064107` | `query` is required. A positive integer is the professor id. A URL must be on `ratemyprofessors.com` and match `/professor/` plus digits. A name or another host returns 400. ## Response fields | Field | Type | Meaning | |---|---|---| | `id` | string | Professor id | | `name` | string | Full name | | `first_name` | string | First token of the name | | `last_name` | string or null | The rest of the name | | `url` | string | Profile URL | | `department` | string or null | Department line that is not the trailing "department" label | | `school` | string or null | School | | `school_url` | string or null | School page, such as `https://www.ratemyprofessors.com/school/2746` for Rio Hondo College | | `rating` | number or null | Overall quality | | `ratings_count` | number or null | Ratings the page reports | | `would_take_again_percent` | number or null | Percent. Present as a number when the page shows a percent. `null` for N/A | | `difficulty` | number or null | Level of difficulty. Present as a number when the page shows one. `null` for N/A | There is no `results` wrapper. ## Use cases - Store Kevin Smith's quality, difficulty, and would-take-again percent from id `1064107` next to the search card for the same id. - Link the professor to Rio Hondo College with `school_url`. - Open `275587` from a `chen` search and keep the profile difficulty beside the card difficulty. ## Error codes | Code | Meaning | |---|---| | `400` | Empty query, a non-numeric token, or a domain outside ratemyprofessors.com | | `401` | Missing API key | | `404` | No professor page for that id | | `500` | The fetch failed | ## Related endpoints [Rate My Professors Search](https://www.piloterr.com/library/ratemyprofessors-search)