# College Scorecard - schools, costs, earnings, completion (API) (`retrainmap/college-scorecard-schools`) Actor

One row per U.S. college from the Dept. of Education's College Scorecard API: name, location, ownership, predominant degree, admission rate, net price, tuition, median earnings 10 years after entry, completion rate, size, plus any Scorecard field id. Filter by name, state, degree level, ownership.

- **URL**: https://apify.com/retrainmap/college-scorecard-schools.md
- **Developed by:** [RetrainMap Team](https://apify.com/retrainmap) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 records

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?

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

## College Scorecard — schools, costs, earnings, completion (API)

One row per U.S. postsecondary institution from the U.S. Department of Education's College
Scorecard API (https://api.data.gov/ed/collegescorecard/v1/schools). Filter by school name
(substring), state, predominant degree level (certificate / associate / bachelor's) and
ownership (public / private nonprofit / for-profit); get IPEDS unit id, name, city, state,
zip, website, ownership, predominant degree, admission rate, average net price, in-state and
out-of-state tuition, median earnings 10 years after entry, completion rate, undergraduate
size and student-faculty ratio — plus any other Scorecard field id you name — one flat row
per school, ready for CSV or JSON.

**The default input (North Carolina, certificate + associate schools, 100 rows) succeeds
within 5 minutes and returns rows** — Apify auto-tests it daily.

**You need a free api.data.gov key.** The Scorecard API refuses every request without one
(`API_KEY_MISSING`). Request one at https://api.data.gov/signup/ (it arrives by e-mail within
minutes) and paste it into `api_key` (stored encrypted by Apify, never logged) — or set the
`DATA_GOV_API_KEY` environment variable on the Actor. The public copy of this Actor carries
the operator's key as a secret environment variable, so runs work without one.

### Data source and status

| | |
|---|---|
| Publisher | U.S. Department of Education, Office of Federal Student Aid — College Scorecard |
| API | https://api.data.gov/ed/collegescorecard/v1/schools — key required (documentation: https://collegescorecard.ed.gov/data/api-documentation/; data dictionary: https://collegescorecard.ed.gov/data/) |
| What this Actor reads | Plain GET requests with `school.name`, `school.state`, `school.degrees_awarded.predominant`, `school.ownership`, `fields`, `sort`, `per_page=100`, `page=N`; at most one request per 500 ms; 100 schools per request (a 5,000-row run is 50 requests against the key's 1,000-per-hour limit) |
| Refresh cadence | The Department updates the institution-level Scorecard file about **once a year** (with occasional mid-year refreshes); every `latest.*` field is the newest published year for that measure. The Actor reads live on every run; `fetched_at` on each row is the fetch time |
| Copyright | Works of the United States Government are not subject to copyright in the U.S. (17 U.S.C. §105). The data are public; please cite the College Scorecard as the source |
| Known caveats | `admission_rate` is null for open-admission schools (most community colleges); `avg_net_price_public` / `avg_net_price_private` are two sector columns — `avg_net_price` is the one that applies to the school's ownership; `median_earnings_10yr` counts federally aided students only and is suppressed (null) for small cohorts; `completion_rate` is Scorecard's `rate_suppressed.overall` (150 % of normal time, first-time full-time); the API **silently drops unknown field ids**, so the run stops with an error naming any `custom_fields` id that did not come back; an unknown state code simply matches nothing |

Honesty note: the rows are the API's own `latest` values renamed to plain column names, with
the ownership and predominant-degree codes labelled from the Scorecard data dictionary —
nothing is inferred, estimated or ranked by this Actor, and a run stops with an error rather
than guess when the API's shape changes.

Identification: api.data.gov's edge refuses custom product-token User-Agents (HTTP 403,
measured 2026-09-04), so the requests carry urllib's own truthful `Python-urllib/3.x`
User-Agent and the operator's contact address in the standard `From:` header (RFC 9110
§10.1.2). The key travels only in the request; it is removed from every log line, error
message and dataset row.

### Input

| Field | Type | Meaning |
|---|---|---|
| `name_contains` | string | Optional substring of the school name (`school.name` partial match) |
| `state` | `XX` | Optional two-letter USPS code |
| `predominant_degrees` | array | Optional: `certificate`, `associate`, `bachelor`. Empty = all |
| `ownership` | array | Optional: `public`, `private_nonprofit`, `for_profit`. Empty = all |
| `fields_preset` | `core` / `minimal` | `core` = the 17 columns above; `minimal` = identity + ownership + degree |
| `custom_fields` | array of field ids | Optional extra Scorecard field ids, each added as its own column |
| `sort` | string | Optional `field_id:asc|desc`, e.g. `latest.student.size:desc` |
| `max_records` | integer | Default 300, at most 5,000 |
| `api_key` | secret string | Or the `DATA_GOV_API_KEY` environment variable |
| `request_interval_ms` | integer | Default 500 (floor 250) |
| `contact_email` | string | Sent in the `From:` header |

Example — public community colleges nationwide, richest earnings first, with Pell rate and
median debt added:

```json
{ "name_contains": "Community College", "ownership": ["public"], "custom_fields": ["latest.aid.pell_grant_rate", "latest.aid.median_debt.completers.overall"], "sort": "latest.earnings.10_yrs_after_entry.median:desc", "max_records": 200 }
```

### Output (dataset row)

`unit_id` (IPEDS), `name`, `city`, `state`, `zip`, `url`, `ownership_code`, `ownership`
(public / private nonprofit / private for-profit), `predominant_degree_code`,
`predominant_degree` (certificate / associate / bachelor / graduate / not classified),
`admission_rate`, `avg_net_price_public`, `avg_net_price_private`, `avg_net_price`,
`tuition_in_state`, `tuition_out_of_state`, `median_earnings_10yr`, `completion_rate`,
`undergrad_size`, `student_faculty_ratio`, one column per `custom_fields` id,
`scorecard_url` (the school's page on collegescorecard.ed.gov), `fetched_at`, `source`
(the API URL without the key).

A run summary (filters, the API's own match count, pages, requests, whether the pay-per-event
budget stopped the run) is stored as `RUN_SUMMARY` in the run's key-value store.

### Pricing (pay per event)

| Event | Price |
|---|---|
| `run-start` — once per run | $0.10 |
| `record` — per row written | $0.005 |

The default pull (≤ 100 rows) costs at most $0.60; 1,000 schools cost $5.10. Rows stop when
your run's maximum charge is reached; the run summary says so.

### Operator

Steelyard Ventures LLC (RetrainMap) — info@steelyardclinical.com. Not affiliated with the
U.S. Department of Education. The Actor writes only to its own dataset and key-value store;
your key is used for the API requests only, never stored or logged.

# Actor input Schema

## `name_contains` (type: `string`):

Optional substring of the school name (the API's school.name filter matches partial names, e.g. 'Community College' or 'Wake'). Empty = any name.

## `state` (type: `string`):

Optional two-letter state or territory code, e.g. NC, TX, PR. Empty = all states.

## `predominant_degrees` (type: `array`):

Optional. Scorecard's school.degrees\_awarded.predominant: certificate (1), associate (2), bachelor (3). Any listed level matches. Empty = all levels (including graduate-only and unclassified schools).

## `ownership` (type: `array`):

Optional. Scorecard's school.ownership: public (1), private nonprofit (2), private for-profit (3). Empty = all.

## `fields_preset` (type: `string`):

core = id, name, city, state, zip, url, ownership, predominant degree, admission rate, average net price (public/private + the applicable one), in-state/out-of-state tuition, median earnings 10 years after entry, completion rate, undergraduate size, student-faculty ratio. minimal = the first eight only (use with custom\_fields).

## `custom_fields` (type: `array`):

Optional extra field ids from the data dictionary (https://collegescorecard.ed.gov/data/), e.g. latest.aid.pell\_grant\_rate, latest.aid.median\_debt.completers.overall, school.carnegie\_basic, latest.completion.completion\_rate\_4yr\_150nt. Each is added as a column under its own id. The API silently drops unknown ids, so the run stops with an error naming any id that did not come back.

## `sort` (type: `string`):

Optional API sort: a field id with :asc or :desc, e.g. latest.student.size:desc, latest.earnings.10\_yrs\_after\_entry.median:desc, school.name:asc. Empty = the API's default order. An invalid field makes the API answer HTTP 400 and the run fails with that message.

## `max_records` (type: `integer`):

Stop after this many schools have been written (100 per request; the key allows 1,000 requests per hour).

## `api_key` (type: `string`):

Free key from https://api.data.gov/signup/ (arrives by e-mail within minutes). Stored encrypted by Apify, never logged. Leave empty to use the DATA\_GOV\_API\_KEY environment variable set on the Actor.

## `request_interval_ms` (type: `integer`):

Politeness delay towards api.data.gov. Each request returns up to 100 schools; the floor is 250 ms.

## `contact_email` (type: `string`):

Sent in the standard From: request header so the data owner can reach the operator (RFC 9110 s10.1.2).

## Actor input object example

```json
{
  "state": "NC",
  "predominant_degrees": [
    "certificate",
    "associate"
  ],
  "fields_preset": "core",
  "max_records": 100,
  "request_interval_ms": 500,
  "contact_email": "info@steelyardclinical.com"
}
```

# Actor output Schema

## `results` (type: `string`):

Every matched school as one row: id, name, location, ownership, predominant degree, admission rate, net price, tuition, median earnings, completion rate, size, student-faculty ratio, custom fields.

## `results_csv` (type: `string`):

The same rows as a CSV file.

# 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 = {
    "state": "NC",
    "predominant_degrees": [
        "certificate",
        "associate"
    ],
    "max_records": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("retrainmap/college-scorecard-schools").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 = {
    "state": "NC",
    "predominant_degrees": [
        "certificate",
        "associate",
    ],
    "max_records": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("retrainmap/college-scorecard-schools").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 '{
  "state": "NC",
  "predominant_degrees": [
    "certificate",
    "associate"
  ],
  "max_records": 100
}' |
apify call retrainmap/college-scorecard-schools --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,retrainmap/college-scorecard-schools"
        }
    }
}

```

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/YUZhkAzX7N65wT5KS/builds/mtedBM3xUrqtl7suE/openapi.json
