This API provides GET endpoints for accessing Canada data with comprehensive filtering and search capabilities.
Important: All API endpoints require authentication. You must be logged in to the application to access the API.
{
"success": true,
"count": 10,
"data": [...]
}
{
"error": "Error message description"
}
Retrieves all Canadian provinces and territories.
None
{
"success": true,
"count": 13,
"data": [
{
"pruid": "10",
"prname": "Newfoundland and Labrador"
},
{
"pruid": "11",
"prname": "Prince Edward Island"
}
]
}
Retrieves census divisions with optional filtering.
| Parameter | Type | Required | Description |
|---|---|---|---|
| pruid | string | No | Province ID to filter by |
| cduid | string | No | Specific Census Division ID to retrieve |
| limit | integer | No | Maximum number of results (default: 100, max: 1000) |
Retrieves addresses with various filtering options.
Note: At least one filter parameter is required.
| Parameter | Type | Required | Description |
|---|---|---|---|
| cduid | string | No* | Census Division ID to filter by |
| csduid | string | No* | Census Subdivision ID to filter by |
| city | string | No* | City name (partial match, case-insensitive) |
| street | string | No* | Street name (partial match, case-insensitive) |
| postcode | string | No* | Postal code (partial match, case-insensitive) |
| limit | integer | No | Maximum number of results (default: 100, max: 1000) |
* At least one of these parameters is required
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid parameters or missing required parameters |
| 401 | Unauthorized | Not logged in |
| 404 | Not Found | Endpoint not found |
| 405 | Method Not Allowed | Non-GET request |
| 500 | Internal Server Error | Server error |
// Get all provinces
fetch('/api.php?endpoint=provinces')
.then(response => response.json())
.then(data => {
if (data.success) {
console.log('Provinces:', data.data);
} else {
console.error('Error:', data.error);
}
});
// Get addresses in Toronto
fetch('/api.php?endpoint=addresses&city=Toronto&limit=10')
.then(response => response.json())
.then(data => {
if (data.success) {
console.log('Addresses:', data.data);
} else {
console.error('Error:', data.error);
}
});
# Get all provinces curl "http://your-domain.com/api.php?endpoint=provinces" # Get census divisions for Ontario curl "http://your-domain.com/api.php?endpoint=census-divisions&pruid=35" # Get addresses in Vancouver curl "http://your-domain.com/api.php?endpoint=addresses&city=Vancouver&limit=20"
import requests
# Get all provinces
response = requests.get('http://your-domain.com/api.php?endpoint=provinces')
data = response.json()
if data['success']:
print(f"Found {data['count']} provinces")
for province in data['data']:
print(f"- {province['prname']} (ID: {province['pruid']})")
else:
print(f"Error: {data['error']}")
Currently, there are no rate limits implemented, but it's recommended to use appropriate limit parameters to avoid large responses, cache responses when possible, and make requests only when necessary.
csd_list tablecsd_list tableaddresses_ca table