Overview
The College Sports Directory REST API provides read-only access to school and staff data. All requests require API key authentication.
Base URL
https://www.collegesportsdirectory.com/wp-json/csd/v1/
Authentication
Pass your API key in the X-CSD-API-Key HTTP header with every request:
curl -H "X-CSD-API-Key: YOUR_API_KEY" https://www.collegesportsdirectory.com/wp-json/csd/v1/stats
Rate Limits
| Limit Type | Default | Description |
|---|---|---|
| Per-Key | 60 req/min | Per API key, configurable |
| Burst | 10 req/5sec | Prevents rapid-fire requests |
| Per-IP | 120 req/min | Per source IP address |
| Global | 300 req/min | Across all keys combined |
Rate limit info is included in response headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Response Format
All successful responses follow this envelope:
{
"success": true,
"data": { ... },
"meta": {
"total": 1500,
"page": 1,
"per_page": 20,
"total_pages": 75,
"timestamp": "2026-02-18T14:30:00Z"
}
}
Error Codes
| Status | Code | Description |
|---|---|---|
| 400 | invalid_parameter | Invalid query parameter |
| 401 | missing_api_key | No API key provided |
| 401 | invalid_api_key | Key not found or inactive |
| 403 | api_disabled | API is disabled |
| 404 | resource_not_found | Record not found |
| 429 | rate_limit_exceeded | Too many requests |
Schools Endpoints
GET /schools
List schools with filtering, sorting, and pagination.
| Parameter | Type | Default | Description |
|---|---|---|---|
| page | int | 1 | Page number |
| per_page | int | 20 | Results per page (max 100) |
| search | string | Search school name, city, state, zip | |
| state | string | Filter by state (e.g., "AL") | |
| division | string | Filter by division (e.g., "NCAA D1") | |
| school_type | string | Filter by type (e.g., "Public") | |
| conference | string | Filter by conference | |
| sort_by | string | school_name | school_name, city, state, school_divisions, date_created, school_enrollment |
| sort_order | string | ASC | ASC or DESC |
| fields | string | Comma-separated field list for sparse response |
Example
curl -H "X-CSD-API-Key: YOUR_KEY" \
"https://www.collegesportsdirectory.com/wp-json/csd/v1/schools?state=AL&per_page=5"
GET /schools/{id}
Get a single school by ID, including staff count.
Example
curl -H "X-CSD-API-Key: YOUR_KEY" \
"https://www.collegesportsdirectory.com/wp-json/csd/v1/schools/45"
GET /schools/{id}/staff
Get staff members for a specific school.
| Parameter | Type | Default | Description |
|---|---|---|---|
| page | int | 1 | Page number |
| per_page | int | 20 | Results per page (max 100) |
| sort_by | string | full_name | full_name, title, sport_department, email, phone, date_created |
| sort_order | string | ASC | ASC or DESC |
| department | string | Filter by sport/department | |
| search | string | Search within school's staff |
Example
curl -H "X-CSD-API-Key: YOUR_KEY" \
"https://www.collegesportsdirectory.com/wp-json/csd/v1/schools/45/staff?department=Football"
Staff Endpoints
GET /staff
List all staff members with filtering, sorting, and pagination.
| Parameter | Type | Default | Description |
|---|---|---|---|
| page | int | 1 | Page number |
| per_page | int | 20 | Results per page (max 100) |
| search | string | Search name, title, email, department, school | |
| school_id | int | Filter by school ID | |
| department | string | Filter by sport/department | |
| sort_by | string | full_name | full_name, title, sport_department, email, phone, date_created, school_name |
| sort_order | string | ASC | ASC or DESC |
| fields | string | Comma-separated field list |
Example
curl -H "X-CSD-API-Key: YOUR_KEY" \
"https://www.collegesportsdirectory.com/wp-json/csd/v1/staff?department=Football&per_page=10"
GET /staff/{id}
Get a single staff member with their associated school.
Example Response
{
"success": true,
"data": {
"id": 101,
"full_name": "John Smith",
"title": "Head Football Coach",
"sport_department": "Football",
"email": "[email protected]",
"phone": "(205) 348-1234",
"school": {
"id": 45,
"school_name": "University of Alabama",
"city": "Tuscaloosa",
"state": "AL",
"school_divisions": "NCAA D1"
}
}
}
Search & Stats
GET /search
Search across both schools and staff in a single request.
| Parameter | Type | Default | Description |
|---|---|---|---|
| q | string | required | Search term (min 2 chars) |
| per_page | int | 10 | Max results per type (max 50) |
Example
curl -H "X-CSD-API-Key: YOUR_KEY" \
"https://www.collegesportsdirectory.com/wp-json/csd/v1/search?q=Alabama"
Response
{
"success": true,
"data": {
"schools": [ { "id": 1, "school_name": "University of Alabama", ... } ],
"staff": [ { "id": 101, "full_name": "...", "school_name": "University of Alabama" } ],
"totals": { "schools": 3, "staff": 42 }
}
}
GET /stats
Get summary statistics for the directory.
Returns record counts and last-updated timestamps. No parameters required.
Example
curl -H "X-CSD-API-Key: YOUR_KEY" \
"https://www.collegesportsdirectory.com/wp-json/csd/v1/stats"
Response
{
"success": true,
"data": {
"counts": {
"schools": 2104,
"staff": 137965,
"states_represented": 54,
"divisions": 9,
"school_types": 5,
"departments": 11046
},
"last_updated": {
"schools": "2025-11-12T14:26:59Z",
"staff": "2026-02-18T11:57:32Z"
}
},
"meta": {
"timestamp": "2026-02-18T14:30:00Z"
}
}
Webhooks & Events
Event Types
| Event | Description |
|---|---|
| school.created | New school added |
| school.updated | Existing school modified |
| school.deleted | School removed |
| staff.created | New staff added |
| staff.updated | Existing staff modified |
| staff.deleted | Staff removed |
GET /events
Query the event log to see recent changes. Use the since parameter to catch up on missed webhooks.
| Parameter | Type | Default | Description |
|---|---|---|---|
| since | datetime | ISO 8601 (e.g., 2026-02-01T00:00:00Z) | |
| event_type | string | Filter by event type | |
| record_type | string | "school" or "staff" | |
| page | int | 1 | Page number |
| per_page | int | 50 | Max 100 |
Webhook Management
Register webhooks to receive real-time HTTP POST notifications when records change.
POST /webhooks
Register a new webhook.
curl -X POST -H "X-CSD-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://your-app.com/webhook","events":["school.created","staff.updated"],"name":"My App"}' \
"https://www.collegesportsdirectory.com/wp-json/csd/v1/webhooks"
Returns the webhook ID and a secret for signature verification (shown once).
GET /webhooks
List your registered webhooks.
PUT /webhooks/{id}
Update a webhook's URL, events, or active status.
DELETE /webhooks/{id}
Delete a webhook.
Webhook Payload
When an event occurs, CSD sends an HTTP POST to your registered URL:
{
"event": "school.updated",
"timestamp": "2026-02-18T14:30:00Z",
"data": {
"id": 45,
"school_name": "University of Alabama",
...
}
}
Signature Verification
Each request includes an X-CSD-Signature header containing an HMAC-SHA256 hash of the request body using your webhook secret:
# PHP verification example
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_CSD_SIGNATURE'];
$expected = hash_hmac('sha256', $payload, $your_secret);
if (hash_equals($expected, $signature)) {
// Valid webhook
}
Failure Handling
If your endpoint returns a non-2xx status or times out, the failure count increments. After 10 consecutive failures, the webhook is auto-disabled. Re-enable it via PUT /webhooks/{id} with {"is_active": true}.
Try It
Test API endpoints directly from this page.
