# BestColleges Scraper (`crawlerbros/best-colleges-scraper`) Actor

Scrape ranked US college programs and school profiles from BestColleges (bestcolleges.com). Fetch ranked schools with tuition, admission rates, retention, and earnings data; school profiles; or program pages from subject hubs.

- **URL**: https://apify.com/crawlerbros/best-colleges-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Lead generation, Other, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## BestColleges Scraper

Scrape **BestColleges** — the US college rankings and school-data site at [bestcolleges.com](https://www.bestcolleges.com). Fetch ranked schools from any program ranking page (computer science, nursing, business, psychology, and 60+ more), pull detailed school profiles, and enumerate program pages from subject hubs. HTTP-only via the site's embedded page data. No auth, no proxy.

### What this actor does

- **Three modes:** `byProgram` (ranked schools), `bySchool` (profile), `bySubject` (program enumeration)
- **Ranking data:** rank, superlative ("Best for…"), program links, ranking year
- **School stats:** in/out-of-state tuition (undergrad + grad), admission rate, retention rate, earnings after 6 years, online-enrollment share, accreditation
- **Filters:** rank range, US state codes, ranking school year
- **Empty fields are omitted**

### Output per ranked school (mode=byProgram)

- `rank` — position in the ranking
- `schoolId`, `rankingId`
- `schoolName`, `city`, `stateName`, `stateCode`
- `schoolUrl`, `programUrl`, `programName`
- `superlativeTitle` — e.g. "Best for Personalized Portfolio-Building"
- `undergradTuitionInState`, `undergradTuitionOutOfState`, `gradTuitionInState`, `gradTuitionOutOfState`
- `admissionRate`, `retentionRate`, `earningsAfterSixYears`, `totalStudentsEnrolled`
- `percentOnlineEnrollment`, `percentOnlinePrograms`
- `schoolLevel`, `accreditation`, `isPrivate`
- `blurb` — editor's summary
- `rankingName`, `schoolYear`, `rankingType`, `rankingStatus`
- `sourceUrl`
- `recordType`, `scrapedAt`

#### Output per school profile (mode=bySchool)

- `schoolId`, `title`, `blurb`, `image`
- `city`, `state`, `stateCode`, `url`
- `inStateTuitionUndergrad`, `outOfStateTuitionUndergrad`, `inStateTuitionGrad`, `outOfStateTuitionGrad`
- `totalEnrollmentUndergrad`, `totalEnrollmentGrad`, `percentAdmittedUndergrad`
- `totalBachelorsPrograms`, `graduationRateTotalCohort`, `studentFacultyRatio`, `fulltimeRetentionRate`
- `percentOnlineEnrollment`
- `isPremium`, `isPrivate`, `notForProfit`, `isHbcu`, `militaryFriendly`
- `religiousAffiliation`, `accreditorStatus`, `admissionTestScores`, `openAdmissionPolicy`

#### Output per program page (mode=bySubject)

- `uri`, `title`, `sourceUrl`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `byProgram` | `byProgram` / `bySchool` / `bySubject` |
| `programUri` | string | `computer-science/bachelors` | Ranking page path (mode=byProgram) |
| `schoolUri` | string | – | School profile path (mode=bySchool) |
| `subjectUri` | string | – | Subject hub path (mode=bySubject) |
| `rankMin` | int | – | Keep ranks ≥ this |
| `rankMax` | int | – | Keep ranks ≤ this (top-N) |
| `stateCodes` | array | – | US state codes, e.g. `["NY","CA"]` |
| `schoolYear` | int | – | Ranking year, e.g. `2026` |
| `maxItems` | int | `50` | Hard cap (1–1000) |

#### Example: top-20 online CS bachelor's programs

```json
{
  "mode": "byProgram",
  "programUri": "computer-science/bachelors",
  "rankMax": 20
}
```

#### Example: all ranked nursing schools in NY and CA

```json
{
  "mode": "byProgram",
  "programUri": "nursing/bachelors",
  "stateCodes": ["NY", "CA"]
}
```

#### Example: school profile

```json
{
  "mode": "bySchool",
  "schoolUri": "university-of-colorado-boulder"
}
```

#### Example: enumerate finance programs from a subject hub

```json
{
  "mode": "bySubject",
  "subjectUri": "business/bachelors"
}
```

### Use cases

- **Higher-ed research** — compare program rankings and school stats side by side
- **Counseling / advising** — shortlist schools by cost, admission rate, and outcomes
- **Market analysis** — track tuition and enrollment trends across ranking years
- **Content pipelines** — feed ranking pages into guides and comparison tools
- **Prospective students** — filter ranked schools by state and affordability

### FAQ

**What is BestColleges?** An independent publisher of US college rankings, program guides, and school profiles (bestcolleges.com).

**Do I need an account or API key?** No. All modes read public page data.

**Where does the data come from?** Each ranking page embeds its full ranking JSON (schools, ranks, stats) directly in the page; school profiles embed their stats the same way. The actor reads those embedded payloads.

**How do I find ranking page paths?** Browse bestcolleges.com — e.g. `/computer-science/bachelors/`, `/nursing/masters/`, `/business/bachelors/finance/`. Use `bySubject` on a hub like `/business/bachelors/` to enumerate the program pages in that section.

**Why are some tuition fields missing?** Schools that don't report a figure simply omit it; empty fields are always dropped.

**What does `superlativeTitle` mean?** BestColleges' editors tag each ranked school with a reason it was chosen, e.g. "Best for Working Adults".

**How fresh is the data?** BestColleges publishes annual rankings; each page carries its ranking year (`schoolYear`) so you can filter by edition.

**Is this affiliated with BestColleges?** No, this is a third-party actor using the public website.

### Limitations

- Only pages that carry embedded rankings work with `byProgram` (program ranking pages). State resource pages and blog articles contain no ranking data.
- `bySubject` enumerates links from the hub page's HTML; deep program pages under other sections may need their own hub paths.
- The internal school-search API (`api.mobius.highereducation.com`) requires a session token from the site and is not used; school discovery happens through ranking pages and subject hubs instead.
- `bySchool` currently returns 0 records for most school slugs: bestcolleges.com's `/schools/{slug}/` pages are served as a client-side-rendered shell (a site-side server error — the HTTP 200 page carries no profile data). The actor reports a status message in that case. School data remains fully available through `byProgram` (which carries tuition, admission rate, earnings, and accreditation per school).
- Some program hubs (e.g. `business/bachelors`) intermittently serve the same empty shell from datacenter IPs; the actor retries those fetches automatically, and pages that stay broken produce a clean 0 with a status message.

# Actor input Schema

## `mode` (type: `string`):

What to fetch.

## `programUri` (type: `string`):

Ranking page path, e.g. `computer-science/bachelors`, `nursing/masters`, `business/bachelors/finance`, or a full URL.

## `schoolUri` (type: `string`):

School profile path, e.g. `university-of-colorado-boulder`, or a full URL.

## `subjectUri` (type: `string`):

Subject hub path, e.g. `business/bachelors`, `healthcare`, `nursing`, or a full URL.

## `rankMin` (type: `integer`):

Drop schools ranked worse than this (lower is better).

## `rankMax` (type: `integer`):

Drop schools ranked better than this (e.g. `10` keeps only the top 10).

## `stateCodes` (type: `array`):

Only emit schools in these US states (e.g. `NY`, `CA`).

## `schoolYear` (type: `integer`):

Only emit schools from this ranking year (e.g. `2026`).

## `maxItems` (type: `integer`):

Hard cap on emitted records.

## Actor input object example

```json
{
  "mode": "byProgram",
  "programUri": "computer-science/bachelors",
  "stateCodes": [],
  "maxItems": 50
}
```

# Actor output Schema

## `schools` (type: `string`):

Dataset containing all scraped BestColleges school records.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "byProgram",
    "programUri": "computer-science/bachelors",
    "stateCodes": [],
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/best-colleges-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "byProgram",
    "programUri": "computer-science/bachelors",
    "stateCodes": [],
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/best-colleges-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "byProgram",
  "programUri": "computer-science/bachelors",
  "stateCodes": [],
  "maxItems": 50
}' |
apify call crawlerbros/best-colleges-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlerbros/best-colleges-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ziKzVjVaT3LQ3Z7xG/builds/QME7faPLyDoSqo2qh/openapi.json
