Skip to Content
API EndpointsEnrollment

Enrollment API

The Enrollment API provides access to student enrollment data across different academic years and categories at Albion College.

Endpoint

GET /api/data/enrollment

Authentication

All requests to this endpoint require authentication using an API key. You can provide your API key in one of the following ways:

  • HTTP Header: X-API-Key: your_api_key
  • Bearer Token: Authorization: Bearer your_api_key
  • Query Parameter: ?apiKey=your_api_key

If you don’t have an API key, you can obtain one from your dashboard settings.

Query Parameters

ParameterTypeRequiredDescription
academicYearStringNoFilter results by academic year (e.g., “2022-2023”)
categoryStringNoFilter results by enrollment category (e.g., “Undergraduate”, “Graduate”)
pageIntegerNoPage number for pagination (default: 1)
limitIntegerNoNumber of results per page (default: 100, max: 1000)
sortByStringNoField to sort by (academic_year, category, subcategory, full_time, part_time)
sortOrderStringNoSort order (asc or desc)

Note: If neither academicYear nor category is provided, the API returns data for all years and categories.

Response Format

The API returns a JSON response with the following structure:

{ "success": true, "data": [ { "id": 1, "academic_year": "2022-2023", "category": "Undergraduate", "subcategory": "First-Year", "full_time": 320, "part_time": 15 }, { "id": 2, "academic_year": "2022-2023", "category": "Undergraduate", "subcategory": "Sophomore", "full_time": 285, "part_time": 12 }, ], "pagination": { "total": 150, "page": 1, "limit": 100, "totalPages": 2 } }

Response Fields

FieldDescription
successBoolean indicating if the request was successful
dataArray of enrollment records
data[].idUnique identifier for the record
data[].academic_yearAcademic year of the enrollment data (e.g., “2022-2023”)
data[].categoryMain enrollment category (e.g., “Undergraduate”, “Graduate”)
data[].subcategorySpecific subcategory within the main category (e.g., “First-Year”, “Sophomore”)
data[].full_timeNumber of full-time students
data[].part_timeNumber of part-time students
pagination.totalTotal number of records available
pagination.pageCurrent page number
pagination.limitNumber of records per page
pagination.totalPagesTotal number of pages available

Examples

Get All Enrollment Data

curl -X GET "https://openalbion.org/api/data/enrollment" \ -H "X-API-Key: your_api_key"

Filter by Academic Year

curl -X GET "https://openalbion.org/api/data/enrollment?academicYear=2022-2023" \ -H "X-API-Key: your_api_key"

Filter by Category

curl -X GET "https://openalbion.org/api/data/enrollment?category=Undergraduate" \ -H "X-API-Key: your_api_key"

Pagination and Sorting

curl -X GET "https://openalbion.org/api/data/enrollment?page=2&limit=50&sortBy=full_time&sortOrder=desc" \ -H "X-API-Key: your_api_key"

Error Responses

Status CodeDescription
401Authentication error (missing or invalid API key)
500Server error

Example error response:

{ "success": false, "error": "API key missing", "message": "Please provide an API key via X-API-Key header, Authorization: Bearer header, or apiKey query parameter.", "docs": "https://docs.openalbion.org" }