Complete endpoint documentation for the CPL Analytics API
The CPL Analytics API provides read-only access to Canadian Premier League match data, standings, and team information. All endpoints return JSON responses.
https://canadasoccerapi.com
For local development: http://localhost:3000
No authentication required
The API is publicly accessible for educational and research purposes.
| Tier | Limit | Window |
|---|---|---|
| Public (testing) | 20 requests | per hour per IP |
When rate limited, the API returns HTTP 429 with a Retry-After header.
Retrieve historical match data with optional filtering and pagination.
| Parameter | Type | Required | Description |
|---|---|---|---|
| season | Integer | No | Filter by season year (2019-2025) |
| team | String | No | Filter by team name (case-insensitive, partial match) |
| limit | Integer | No | Maximum results per page (default: 100, max: 500) |
| offset | Integer | No | Number of results to skip (default: 0) |
# Get all matches
curl "https://canadasoccerapi.com/api/matches"
# Get 2024 season matches
curl "https://canadasoccerapi.com/api/matches?season=2024"
# Get Forge FC matches with pagination
curl "https://canadasoccerapi.com/api/matches?team=Forge&limit=10&offset=0"
{
"total": 156,
"count": 2,
"offset": 0,
"limit": 2,
"matches": [
{
"date": "2024-04-13",
"home_team": "Forge FC",
"away_team": "Atletico Ottawa",
"home_goals": 3,
"away_goals": 1,
"season": 2024,
"venue": "Tim Hortons Field"
},
{
"date": "2024-04-14",
"home_team": "Cavalry FC",
"away_team": "Pacific FC",
"home_goals": 2,
"away_goals": 2,
"season": 2024,
"venue": "ATCO Field"
}
]
}
Get league standings for one or all seasons.
| Parameter | Type | Required | Description |
|---|---|---|---|
| season | Integer | No | Specific season year (omit for all seasons) |
curl "https://canadasoccerapi.com/api/standings?season=2024"
{
"season": 2024,
"standings": [
{
"position": 1,
"team": "Forge FC",
"played": 28,
"wins": 18,
"draws": 5,
"losses": 5,
"goals_for": 52,
"goals_against": 28,
"goal_difference": 24,
"points": 59
}
],
"source": "official"
}
| "official" | From official CanPL SDP API (excludes playoffs) |
| "calculated" | Calculated from match results |
Get information about CPL teams including metadata.
| Parameter | Type | Required | Description |
|---|---|---|---|
| active_only | String | No | Set to "true" to exclude inactive teams |
curl "https://canadasoccerapi.com/api/teams?active_only=true"
{
"count": 8,
"teams": [
{
"name": "Forge FC",
"city": "Hamilton",
"stadium": "Tim Hortons Field",
"founded": 2018,
"latitude": 43.2557,
"longitude": -79.8711,
"surface": "grass",
"status": "active"
}
]
}
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid parameters |
| 404 | Not Found | Endpoint does not exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Internal server error |
{
"error": "Failed to load matches data"
}
The API supports Cross-Origin Resource Sharing (CORS) for browser-based applications.
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Headers: Content-Type
// Works directly in browser without proxy
fetch('https://canadasoccerapi.com/api/matches')
.then(response => response.json())
.then(data => console.log(data.matches));
| Endpoint | Cache Duration |
|---|---|
| /api/matches | 1 hour |
| /api/standings | 1 hour |
| /api/teams | 24 hours |