Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- A free api.data.gov key saved in the DATA_GOV_API_KEY environment variable
U.S. college cost, completion, debt, and earnings statistics for building school-comparison and program-research tools.
From source to product signal
College Scorecard exposes institution and field-of-study metrics through an api.data.gov key. Start with one state and a few fields such as tuition, completion, and earnings. Many debt and earnings values cover Title IV cohorts only, and the latest object can mix metrics from different years.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import os
import pandas as pd
import requests
response = requests.get(
"https://api.data.gov/ed/collegescorecard/v1/schools",
params={
"api_key": os.environ["DATA_GOV_API_KEY"],
"school.state": "CA",
"per_page": 20,
"fields": ",".join([
"id",
"school.name",
"latest.cost.tuition.in_state",
"latest.completion.rate_suppressed.overall",
"latest.earnings.10_yrs_after_entry.median",
]),
},
timeout=30,
)
response.raise_for_status()
schools = pd.DataFrame(response.json()["results"])
print(schools.head(20))Test a useful signal
Rank a bounded set of California institutions by in-state tuition and ten-year median earnings.
U.S. Department of Education is a government source. Last verified 2026-08-14. Temporal coverage: institution metrics with year-specific and latest objects.