{
  "openapi": "3.0.1",
  "info": {
    "title": "US Schools, Districts & Colleges Scraper - Education Leads",
    "description": "Scrape every US public school, district & college from official NCES & IPEDS data: name, phone, address, enrollment, grade range, Title I, charter, free-lunch %, locale, staff counts, college president & website. Filter by state, level & size. Monitor mode returns only new institutions.",
    "version": "1.0",
    "x-build-id": "duDCR1lNetKsUisbW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~us-schools-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-us-schools-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/scrapesage~us-schools-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-us-schools-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/scrapesage~us-schools-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-us-schools-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "institutionTypes": {
            "title": "Institution types",
            "type": "array",
            "description": "Which institutions to scrape: <code>schools</code> (K-12 public schools, NCES CCD), <code>districts</code> (public school districts / LEAs), <code>colleges</code> (colleges & universities, IPEDS).",
            "items": {
              "type": "string",
              "enum": [
                "schools",
                "districts",
                "colleges"
              ],
              "enumTitles": [
                "Schools (K-12 public)",
                "School districts (LEAs)",
                "Colleges & universities"
              ]
            },
            "default": [
              "schools"
            ]
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "US states to scrape — full name or 2-letter code: <code>Texas</code>, <code>TX</code>, <code>California</code>, <code>NY</code>. Leave empty to scan <b>all</b> states (use <code>maxResults</code> to control cost).",
            "items": {
              "type": "string"
            }
          },
          "nameQuery": {
            "title": "Name contains",
            "type": "string",
            "description": "Optional — only keep institutions whose name contains this text (e.g. <code>elementary</code>, <code>community college</code>, <code>academy</code>)."
          },
          "year": {
            "title": "Data year",
            "minimum": 1990,
            "maximum": 2030,
            "type": "integer",
            "description": "Survey year to pull (e.g. 2022). Leave empty for the latest available (CCD ~2022, IPEDS ~2023). Older years are tried automatically if a year has no data."
          },
          "schoolLevels": {
            "title": "School levels (schools only)",
            "type": "array",
            "description": "Filter K-12 schools by level.",
            "items": {
              "type": "string",
              "enum": [
                "Primary",
                "Middle",
                "High",
                "Other"
              ],
              "enumTitles": [
                "Primary / Elementary",
                "Middle",
                "High",
                "Other"
              ]
            }
          },
          "localeTypes": {
            "title": "Locale",
            "type": "array",
            "description": "Filter by urban-centric locale.",
            "items": {
              "type": "string",
              "enum": [
                "City",
                "Suburb",
                "Town",
                "Rural"
              ],
              "enumTitles": [
                "City",
                "Suburb",
                "Town",
                "Rural"
              ]
            }
          },
          "minEnrollment": {
            "title": "Min enrollment",
            "minimum": 0,
            "type": "integer",
            "description": "Only include institutions with at least this many students."
          },
          "maxEnrollment": {
            "title": "Max enrollment",
            "minimum": 0,
            "type": "integer",
            "description": "Only include institutions with at most this many students."
          },
          "charterOnly": {
            "title": "Charter schools only",
            "type": "boolean",
            "description": "Schools only — keep only charter schools.",
            "default": false
          },
          "magnetOnly": {
            "title": "Magnet schools only",
            "type": "boolean",
            "description": "Schools only — keep only magnet schools.",
            "default": false
          },
          "virtualOnly": {
            "title": "Virtual schools only",
            "type": "boolean",
            "description": "Schools only — keep only virtual / online schools.",
            "default": false
          },
          "titleIEligibleOnly": {
            "title": "Title I eligible only",
            "type": "boolean",
            "description": "Schools only — keep only Title I eligible schools (a federal funding signal).",
            "default": false
          },
          "collegeControls": {
            "title": "College control (colleges only)",
            "type": "array",
            "description": "Filter colleges by control.",
            "items": {
              "type": "string",
              "enum": [
                "Public",
                "Private not-for-profit",
                "Private for-profit"
              ],
              "enumTitles": [
                "Public",
                "Private not-for-profit",
                "Private for-profit"
              ]
            }
          },
          "collegeLevels": {
            "title": "College level (colleges only)",
            "type": "array",
            "description": "Filter colleges by length of programs.",
            "items": {
              "type": "string",
              "enum": [
                "4-year",
                "2-year",
                "Less than 2-year"
              ],
              "enumTitles": [
                "4-year or above",
                "2-year",
                "Less than 2-year"
              ]
            }
          },
          "hbcuOnly": {
            "title": "HBCUs only (colleges only)",
            "type": "boolean",
            "description": "Colleges only — keep only Historically Black Colleges & Universities.",
            "default": false
          },
          "excludeClosed": {
            "title": "Exclude closed / inactive",
            "type": "boolean",
            "description": "Drop schools/colleges marked closed or inactive.",
            "default": true
          },
          "ncesSchoolIds": {
            "title": "Look up school NCES IDs",
            "type": "array",
            "description": "Optional — look up specific schools by 12-digit NCES school ID (<code>ncessch</code>).",
            "items": {
              "type": "string"
            }
          },
          "leaIds": {
            "title": "Look up district LEA IDs",
            "type": "array",
            "description": "Optional — look up specific districts by 7-digit NCES district ID (<code>leaid</code>).",
            "items": {
              "type": "string"
            }
          },
          "collegeUnitIds": {
            "title": "Look up college UNITIDs",
            "type": "array",
            "description": "Optional — look up specific colleges by IPEDS <code>unitid</code>.",
            "items": {
              "type": "string"
            }
          },
          "enrichContactEmails": {
            "title": "Enrich emails from the institution website",
            "type": "boolean",
            "description": "Crawl the institution's own website (home + contact/about, max 3 pages) for contact emails, phones and social links. Applies to institutions that publish a website (colleges & universities). NCES does not publish K-12 emails.",
            "default": false
          },
          "deduplicate": {
            "title": "Deduplicate",
            "type": "boolean",
            "description": "Drop duplicate institutions within a run (by NCES ID).",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (only new institutions)",
            "type": "boolean",
            "description": "Remember institutions seen in previous runs and emit only NEW ones. Perfect for scheduled runs that track new schools, new charters or closures. Works alongside Apify Schedules.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Name the monitor state so different saved searches track their own history.",
            "default": "default"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum institutions to return across all states & types."
          },
          "maxResultsPerState": {
            "title": "Max results per state",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap per state, so one big state doesn't use the whole budget."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "How many states to fetch in parallel.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxies to use. Residential US proxies are required — the official Education Data API is behind a Cloudflare challenge that blocks datacenter IPs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}