apyhub
Back
▣ RETRIEVAL KIT · VERIFICATION KIT

US Schools Directory API

What it does

The US Schools Directory API returns school and district records for U.S. education data. Send a search term, ZIP, city, state, district, NCES school IDs, or lat and lon. You can also choose mode like search, near, school, district, or bulk.

Use search to filter by school name, city, state, ZIP, or district. Use near with radiusMiles to find schools near a ZIP or a coordinate pair. Use school for one or more NCES ids, and district for all schools in one district plus a summary row. Bulk mode accepts up to 50 queries.

You get rows with school name, address, city, state, ZIP, county, district, level, type, enrollment, and staff data. Near results also include distanceMiles. Bulk results can include an error row for one failed query while the other rows still return.

Teams use the US Schools Directory API for school search in forms, district selection, and address-based school checks. They also use it to show nearby schools on maps and to add school data to education apps.

POST
Schools API - US School Directory & District Lookup
https://api.eu.apyhub.com/martin10291/us-schools-directory

QUICKSTART

GUIDE

Quickstart

Look up schools or districts with a simple search request using a city, ZIP, or name.

curl -X POST "https://api.eu.apyhub.com/martin10291/us-schools-directory" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "search",
    "city": "Austin",
    "limit": 20
  }'

What you'll get back

Returns a JSON object with billed and count integers, plus an items array of result objects. Each item can include fields like name, state, city, zip, ncesId, rowType, and other school or district details depending on the match.

{
  "billed": 1,
  "count": 1,
  "items": [
    {
      "name": "Lincoln High School",
      "city": "Austin",
      "state": "TX",
      "ncesId": "480123000001",
      "rowType": "school"
    }
  ]
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
near mode: centre latitude (use with lon instead of zip).
near mode: centre longitude.
5-digit ZIP. search: schools in this ZIP; near: centre of the radius.

About this endpoint

What it does

Returns school and district lookup results for U.S. education data, using the request body to select a mode such as search, near, school, district, or bulk. The response returns a JSON object with billing/count metadata and an items array of result rows.

Request Body

ParameterTypeMandatoryDescription
latNumberNonear mode: centre latitude (use with lon instead of zip).
lonNumberNonear mode: centre longitude.
zipStringNo5-digit ZIP. Search: schools in this ZIP; near: centre of the radius.
cityStringNoCity name (search mode), e.g. Austin.
modeENUMNoAllowed values: search, near, school, district, bulk. search filters by name/city/state/ZIP/district; near finds schools within radiusMiles of lat/lon or a ZIP; school returns one or more schools by NCES id; district returns all schools of a district (LEAID or name) plus a summary row; bulk accepts up to 50 queries in one call.
nameStringNoPart of the school name, case-insensitive (search mode), e.g. Lincoln.
levelString ArrayNoPublic schools only: elementary, middle, high, secondary, prekindergarten, other.
limitIntegerNo1-5000, default 100.
stateStringNo2-letter code or full name, e.g. CA or California.
ncesIdsString ArrayNoschool mode: up to 50 NCES school ids (12-digit public NCESSCH or 8-character private PPIN).
queriesString ArrayNobulk mode: up to 50 objects, each one an input of another mode, e.g. {"mode":"near","zip":"10001","radiusMiles":1}. A failing query returns an error row; the others still answer.
districtStringNoDistrict NCES LEAID (7 digits) or district name (search and district modes), e.g. 0622710 (Los Angeles Unified).
schoolTypeENUMNoAllowed values: public, private, all. public is the default.
radiusMilesNumberNonear mode: 0.1-50 miles, default 5. Rows are sorted by distanceMiles.

Response

Returns a JSON object with billed and count integer fields plus an items array of result objects. Each item may contain school, district, location, status, and metadata fields depending on the mode and data available.

ParameterTypeMandatoryDescription
billedIntegerYesUnits charged for this call: result rows only; not-found / unavailable / invalid rows are free.
countIntegerYesNumber of rows in items.
itemsObject ArrayYesArray of result rows. Each row may include the following fields: lat, lon, zip, city, name, error, level, metro, query, stale, state, county, locale, ncesId, source, status, street, charter, rowType, virtual, gradeLow, fetchedAt, gradeHigh, sourceUrl, districtId, enrollment, schoolType, schoolYear, localeLabel, teachersFte, districtName, distanceMiles, schoolCategory, studentTeacherRatio, congressionalDistrict, freeReducedLunchEligible.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.