API Endpoints
Express Entry Predictor API
Access Express Entry draw data and predictions programmatically through our REST API.
Base URL
https://expressentry.xeradb.com/api/
✨ Features
- Real-time Express Entry draw data
- AI-powered predictions with confidence intervals
- Historical trends and statistics
- Category-specific filtering
- JSON responses for easy integration
🚀 Quick Start
curl https://expressentry.xeradb.com/api/predict/
🔐 Authentication
Currently, all API endpoints are publicly accessible and do not require authentication. For production use, consider implementing API keys.
💪 Health Check
Check if the API is running and accessible. This endpoint provides system status and basic statistics.
API Health Status
GET/api/health/
Returns API health status, database connectivity, and basic system information.
{
"status": "healthy",
"timestamp": "2025-08-02T12:08:32+00:00",
"version": "1.0",
"database": {
"connected": true,
"draws_count": 358,
"categories_count": 14,
"predictions_count": 37
},
"endpoints": {
"predictions": "/api/predict/",
"categories": "/api/categories/",
"draws": "/api/draws/",
"statistics": "/api/stats/",
"documentation": "/api-docs/"
}
}
🔮 Predictions API
Get AI-powered predictions for upcoming Express Entry draws with 95% confidence intervals.
Understanding Confidence Intervals
95% Confidence Intervals: Each prediction includes a range showing where we're 95% confident the actual CRS score will fall.
Display Format: 517 (420–613) means the predicted score is 517, with 95% confidence it will be between 420-613.
Interpretation: Wider intervals indicate higher uncertainty, typically for categories with limited historical data.
Get All Predictions
GET/api/predict/
Retrieve predictions for all active categories with available data.
{
"success": true,
"total_categories": 7,
"generated_at": "2025-08-02T12:08:32+00:00",
"data": [
{
"category_id": 3,
"category_name": "Canadian Experience Class",
"category_description": null,
"last_updated": "2025-08-02T12:05:32+00:00",
"recent_draws": [
{
"date": "2025-07-08",
"crs_score": 518,
"invitations": 3000
}
],
"predictions": [
{
"rank": 1,
"predicted_date": "2025-08-16",
"predicted_crs_score": 517,
"predicted_invitations": 2800,
"confidence_score": 75.2,
"model_used": "Bayesian Regression",
"uncertainty_range": {
"min": 420,
"max": 613,
"confidence_level": 95,
"margin_of_error": 96.5
}
}
]
}
]
}
# Python example
import requests
response = requests.get('https://expressentry.xeradb.com/api/predict/')
data = response.json()
if data['success']:
for category in data['data']:
print(f"Category: {category['category_name']}")
for pred in category['predictions'][:3]: # First 3 predictions
print(f" {pred['predicted_date']}: CRS {pred['predicted_crs_score']} (±{pred['confidence_score']:.1f}%)")
# JavaScript example
fetch('https://expressentry.xeradb.com/api/predict/')
.then(response => response.json())
.then(data => {
if (data.success) {
data.data.forEach(category => {
console.log(`${category.category_name}: ${category.predictions[0].predicted_crs_score}`);
});
}
});
Get Category-Specific Predictions
GET/api/predict/{category_id}/
Get predictions for a specific category.
| Parameter | Type | Description |
|---|---|---|
category_id |
integer | ID of the Express Entry category |
📂 Categories API
Manage and retrieve Express Entry draw categories.
List All Categories
GET/api/categories/
Retrieve all active Express Entry categories.
[
{
"id": 3,
"name": "Canadian Experience Class",
"description": null,
"is_active": true,
"created_at": "2024-01-01T00:00:00Z",
"total_draws": 45,
"avg_crs_score": 519.2,
"latest_draw_date": "2025-07-08"
}
]
Get Category Statistics
GET/api/categories/{id}/statistics/
Get detailed statistics for a specific category.
Get Category Predictions
GET/api/categories/{id}/predictions/
Get all predictions for a specific category.
📊 Draws API
Access historical Express Entry draw data.
List All Draws
GET/api/draws/
Retrieve Express Entry draws with optional filtering.
| Parameter | Type | Description |
|---|---|---|
category |
integer | Filter by category ID |
start_date |
date | Filter draws after this date (YYYY-MM-DD) |
end_date |
date | Filter draws before this date (YYYY-MM-DD) |
GET /api/draws/?category=3&start_date=2024-01-01
Get Recent Draws
GET/api/draws/recent/
Get draws from the last 30 days.
📈 Statistics API
Get comprehensive statistics and dashboard data.
Get Dashboard Statistics
GET/api/stats/
Retrieve overall system statistics including totals, averages, and recent activity.
{
"total_draws": 358,
"categories_count": 14,
"total_predictions": 37,
"avg_crs_score": 529.6,
"avg_invitations": 2247,
"min_crs_score": 75,
"max_crs_score": 818,
"recent_draws": [...],
"next_predictions": [...],
"last_updated": "2025-08-02T12:05:35+00:00"
}
🤖 Models API
Information about the AI prediction models used in the system.
List Prediction Models
GET/api/models/
Get information about available prediction models and their performance.
💻 Code Examples
Python (requests)
import requests
import json
# Base URL
base_url = "https://expressentry.xeradb.com/api"
# Get all predictions
def get_predictions():
response = requests.get(f"{base_url}/predict/")
return response.json()
# Get category statistics
def get_category_stats(category_id):
response = requests.get(f"{base_url}/categories/{category_id}/statistics/")
return response.json()
# Get recent draws
def get_recent_draws():
response = requests.get(f"{base_url}/draws/recent/")
return response.json()
# Example usage
predictions = get_predictions()
if predictions['success']:
for category in predictions['data']:
print(f"{category['category_name']}: {category['predictions'][0]['predicted_crs_score']}")
JavaScript (fetch)
const BASE_URL = "https://expressentry.xeradb.com/api";
// Get all predictions
async function getPredictions() {
const response = await fetch(`${BASE_URL}/predict/`);
return await response.json();
}
// Get category statistics
async function getCategoryStats(categoryId) {
const response = await fetch(`${BASE_URL}/categories/${categoryId}/statistics/`);
return await response.json();
}
// Get recent draws
async function getRecentDraws() {
const response = await fetch(`${BASE_URL}/draws/recent/`);
return await response.json();
}
// Example usage
getPredictions().then(data => {
if (data.success) {
data.data.forEach(category => {
console.log(`${category.category_name}: ${category.predictions[0].predicted_crs_score}`);
});
}
});
cURL Commands
# Get all predictions curl -X GET "https://expressentry.xeradb.com/api/predict/" # Get predictions for specific category curl -X GET "https://expressentry.xeradb.com/api/predict/3/" # Get dashboard statistics curl -X GET "https://expressentry.xeradb.com/api/stats/" # Get draws with filters curl -X GET "https://expressentry.xeradb.com/api/draws/?category=3&start_date=2024-01-01" # Get category statistics curl -X GET "https://expressentry.xeradb.com/api/categories/3/statistics/"
⚡ Rate Limits & Best Practices
Current Limits
- No rate limiting currently implemented
- Cached responses for better performance
- Please use responsibly
Best Practices
- Cache responses: Data updates daily, so cache for at least 1 hour
- Use filters: Filter by date range and category to reduce response size
- Error handling: Always check the `success` field in responses
- Respect the system: Don't make excessive requests
Error Responses
{
"success": false,
"error": "Error description",
"data": []
}