# US Higher-Ed Intelligence — Rankings + Scorecard + IPEDS (`commanding_hotdog/us-higher-ed-intelligence`) Actor

One school, one row, three verified sources: US News grad rankings + College Scorecard + IPEDS, joined by IPEDS UNITID. Clean records + raw + run summary.

- **URL**: https://apify.com/commanding_hotdog/us-higher-ed-intelligence.md
- **Developed by:** [qingwa](https://apify.com/commanding_hotdog) (community)
- **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. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## US Higher-Ed Intelligence — Rankings + Scorecard + IPEDS

One school, one row, three verified sources. Pulls **US News Best Graduate School rankings** (9 categories),
**College Scorecard** (earnings / completion / aid), and **official IPEDS data files** (directory, tuition,
graduation rates, faculty salaries, enrollment), joins them by **IPEDS UNITID**, and emits clean, typed
records with full raw-record preservation and a per-component `run_summary`.

### Why

Existing store actors scrape single tables. This is the only actor that produces a **cross-source school
profile**: US News rank + Scorecard earnings + IPEDS tuition/graduation/salary/enrollment in one row.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `datasets` | select (multiple) | all three | `usnews_grad_rankings`, `scorecard`, `ipeds` |
| `gradCategories` | select (multiple) | all 9 | law / medical / business / engineering / nursing / education / computer-science / public-affairs / health |
| `ipedsTables` | select (multiple) | all 5 | `directory`, `tuition`, `graduation`, `salaries`, `enrollment` |
| `stateFilter` | string | (off) | 2-letter code, e.g. `CA` |
| `typeFilter` | select | (off) | `public` / `private` (IPEDS CONTROL) |
| `maxResults` | select | `20` | Output cap (records; or schools in joined mode) |
| `outputMode` | select | `joined` | `joined` / `normalized` / `raw` / `summary` |
| `scorecardApiKey` | secret | `DEMO_KEY` | free key at api.data.gov; needed for large pulls (DEMO_KEY is heavily rate limited) |

### Join model

- Join key: **IPEDS UNITID** (native in Scorecard `id` and IPEDS rows).
- US News items carry no UNITID; it is resolved via school slug and name matching against the IPEDS
  directory (tiers: slug+state → name+state → name → loose name variants → unique name prefix).
  Unmatched records keep `ipeds_unitid: null` with `match_method: "unmatched"` — never invented.
- In `joined` mode the first selected source acts as **anchor** (priority: usnews → scorecard → ipeds);
  the other sources are then fetched **targeted by UNITID** (Scorecard `id=` batches, IPEDS row filtering),
  so every output row carries all selected sources.

### Output

`outputMode: joined` — one record per school:

```json
{
  "ipeds_unitid": "243744",
  "school_name": "Stanford University", "city": "Stanford", "state": "CA",
  "sources_present": ["usnews_grad", "scorecard", "ipeds"],
  "match_methods": {"usnews_grad": "slug_state", "scorecard": "native", "ipeds": "native"},
  "usnews_grad": {"top-law-schools": {"rank_display": "1", "rank_numeric": 1, "tuition_ft": 79707,
       "enrolled": 565, "test_score": 173, "program_url": "..."}},
  "scorecard": {"student_size": 7554, "admission_rate": 0.0361, "avg_net_price": 13807,
       "completion_rate": 0.9192, "earnings_10y_median": 124080, "pell_grant_rate": 0.1916},
  "ipeds": {
    "directory": {"control": "private", "locale": 11, "...": "..."},
    "tuition": {"tuition_in_state": 61731, "total_in_state": 62484, "...": "..."},
    "graduation": {"derived": {"graduation_rate_150pct": 0.9282},
                   "by_key": {"1": {"label": "cohort_total", "total": 1698}, "3": {"label": "completers_within_150pct_normal_time", "total": 1578}}},
    "salaries": {"primary": {"label": "all_ranks", "headcount_total": 1554, "avg_salary_9m_total": 217546},
                 "by_key": {"1": {"label": "professor", "...": "..."}}},
    "enrollment": {"enrollment_total": 18446, "enrollment_white": 4583, "...": "..."}
  }
}
```

`outputMode: normalized` — one record per source record (same envelope as above per source, with
`raw_record`, `source_url`/`source_file`, `record_hash`, `fetched_at`). `raw` keeps only the identity
envelope + `raw_record`. `summary` pushes no records and only writes `run_summary`.

#### Envelope fields (all sources)

`source`, `source_component`, `ipeds_unitid`, `school_name`, `city`, `state`, `control`,
`raw_record` (complete source payload), `record_hash` (sha256 of raw), `fetched_at`.
US News adds `match_method`; IPEDS adds `table`, `school_year`.

#### run_summary (key-value store, key `run_summary`)

`status` (`success` / `partial` / `failed`), `record_count`, `failed_components`, `truncated`,
`truncation_by_component`, `components` (per entity-prefixed component: status, record_count,
truncated, warnings, error), `config_echo` (input echoed, api key masked).

### Notes & limits

- US News: ranking year is the live API edition; `rank_display` may be `Tier 1` etc. (`rank_numeric` null).
- IPEDS: 2023-24 release files. `graduation` is the IPEDS 150%-normal-time survey; `graduation_rate_150pct`
  is derived (`completers / adjusted cohort`) and labeled as derived.
- Scorecard ownership filter maps `public`=1, `private`=2..3.
- A component failing (429/4xx) does not fail the run; see `run_summary.failed_components`.
- Invalid input fails the run with the offending field name in the error.

### Pricing

Pay per event: $0.003 per dataset item ($3 per 1,000). First 20 records free per run where the
platform pricing tiers allow; start event free.

# Actor input Schema

## `datasets` (type: `array`):

Which sources to collect: usnews_grad_rankings (US News graduate school rankings), scorecard (College Scorecard earnings/completion), ipeds (official IPEDS tables). Select any combination.

## `gradCategories` (type: `array`):

Graduate ranking categories to scrape (only used when usnews_grad_rankings is selected).

## `ipedsTables` (type: `array`):

IPEDS survey tables to load (only used when ipeds is selected). directory=HD institutions, tuition=IC annual charges, graduation=GR cohorts, salaries=instructional staff, enrollment=EF fall enrollment.

## `outputMode` (type: `string`):

joined = one row per school merging all selected sources (recommended); normalized = one record per source per school; raw = raw records with light envelope; summary = run summary only.

## `maxResults` (type: `string`):

Maximum number of records to output in total (applied while loading, not at the end).

## `stateFilter` (type: `string`):

Two-letter US state code to filter schools (e.g. CA, NY). Leave empty for all states.

## `typeFilter` (type: `string`):

Filter by institutional control: public or private. Leave empty for both.

## `scorecardApiKey` (type: `string`):

Optional api.data.gov key for the Scorecard source. DEMO_KEY works for small runs (rate-limited); get a free key at api.data.gov for large pulls.

## Actor input object example

```json
{
  "datasets": [
    "usnews_grad_rankings",
    "scorecard",
    "ipeds"
  ],
  "gradCategories": [
    "top-law-schools",
    "top-medical-schools",
    "top-business-schools",
    "top-engineering-schools",
    "top-nursing-schools",
    "top-education-schools",
    "top-computer-science-schools",
    "top-public-affairs-schools",
    "top-health-schools"
  ],
  "ipedsTables": [
    "directory",
    "tuition",
    "graduation",
    "salaries",
    "enrollment"
  ],
  "outputMode": "joined",
  "maxResults": "20",
  "stateFilter": "",
  "typeFilter": "",
  "scorecardApiKey": ""
}
```

# Actor output Schema

## `defaultDataset` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

## `runSummaryStatus` (type: `string`):

No description

# 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 = {
    "datasets": [
        "usnews_grad_rankings",
        "scorecard",
        "ipeds"
    ],
    "gradCategories": [
        "top-law-schools",
        "top-medical-schools",
        "top-business-schools",
        "top-engineering-schools",
        "top-nursing-schools",
        "top-education-schools",
        "top-computer-science-schools",
        "top-public-affairs-schools",
        "top-health-schools"
    ],
    "ipedsTables": [
        "directory",
        "tuition",
        "graduation",
        "salaries",
        "enrollment"
    ],
    "outputMode": "joined",
    "maxResults": "20",
    "stateFilter": "",
    "typeFilter": "",
    "scorecardApiKey": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("commanding_hotdog/us-higher-ed-intelligence").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 = {
    "datasets": [
        "usnews_grad_rankings",
        "scorecard",
        "ipeds",
    ],
    "gradCategories": [
        "top-law-schools",
        "top-medical-schools",
        "top-business-schools",
        "top-engineering-schools",
        "top-nursing-schools",
        "top-education-schools",
        "top-computer-science-schools",
        "top-public-affairs-schools",
        "top-health-schools",
    ],
    "ipedsTables": [
        "directory",
        "tuition",
        "graduation",
        "salaries",
        "enrollment",
    ],
    "outputMode": "joined",
    "maxResults": "20",
    "stateFilter": "",
    "typeFilter": "",
    "scorecardApiKey": "",
}

# Run the Actor and wait for it to finish
run = client.actor("commanding_hotdog/us-higher-ed-intelligence").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 '{
  "datasets": [
    "usnews_grad_rankings",
    "scorecard",
    "ipeds"
  ],
  "gradCategories": [
    "top-law-schools",
    "top-medical-schools",
    "top-business-schools",
    "top-engineering-schools",
    "top-nursing-schools",
    "top-education-schools",
    "top-computer-science-schools",
    "top-public-affairs-schools",
    "top-health-schools"
  ],
  "ipedsTables": [
    "directory",
    "tuition",
    "graduation",
    "salaries",
    "enrollment"
  ],
  "outputMode": "joined",
  "maxResults": "20",
  "stateFilter": "",
  "typeFilter": "",
  "scorecardApiKey": ""
}' |
apify call commanding_hotdog/us-higher-ed-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,commanding_hotdog/us-higher-ed-intelligence"
        }
    }
}
```

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/jlfV12wxSqY6GVa53/builds/RAUYltDFruDglaiFm/openapi.json
