Getting Started
Make your first API call in under 5 minutes
The ViewRoyal.ai API is a free, read-only REST API that returns JSON. It provides access to council meeting data, people, matters, motions, bylaws, and full-text search for the Town of View Royal, BC.
Base URL: https://viewroyal.ai/api/v1/view-royal/
Step 0: Quick Test (No Auth Needed)
Before creating an account, verify you can reach the API by hitting the health endpoint. No API key is required.
curl https://viewroyal.ai/api/v1/healthconst res = await fetch('https://viewroyal.ai/api/v1/health');
const data = await res.json();
console.log(data);import requests
resp = requests.get('https://viewroyal.ai/api/v1/health')
print(resp.json())Expected response:
{ "status": "ok" }Step 1: Create an Account
Sign up for a free account at viewroyal.ai/signup. You will need an account to generate API keys.
Step 2: Generate an API Key
Navigate to viewroyal.ai/settings/api-keys and create a new API key.
Your API key is shown only once at creation time. Copy it immediately and store it securely (e.g., in an environment variable). Keys start with vr_ and cannot be retrieved after creation.
Step 3: Make an Authenticated Request
With your API key, you can access all data endpoints. Here is an example that lists the three most recent council meetings:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://viewroyal.ai/api/v1/view-royal/meetings?per_page=3"const res = await fetch(
'https://viewroyal.ai/api/v1/view-royal/meetings?per_page=3',
{ headers: { 'X-API-Key': 'YOUR_API_KEY' } }
);
const data = await res.json();
console.log(data);import requests
resp = requests.get(
'https://viewroyal.ai/api/v1/view-royal/meetings',
headers={'X-API-Key': 'YOUR_API_KEY'},
params={'per_page': 3}
)
data = resp.json()
print(data)Example response:
{
"data": [
{
"id": 42,
"slug": "2024-01-15-regular-council",
"title": "Regular Council Meeting",
"date": "2024-01-15",
"meeting_type": "Regular Council"
},
{
"id": 41,
"slug": "2024-01-08-committee-of-the-whole",
"title": "Committee of the Whole Meeting",
"date": "2024-01-08",
"meeting_type": "Committee of the Whole"
},
{
"id": 40,
"slug": "2023-12-18-regular-council",
"title": "Regular Council Meeting",
"date": "2023-12-18",
"meeting_type": "Regular Council"
}
],
"pagination": {
"has_more": true,
"next_cursor": "eyJ2IjoiMjAyMy0xMi0xOCIsImlkIjo0MH0=",
"per_page": 3
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}The response includes:
data-- An array of meeting objectspagination-- Cursor-based pagination info (has_more,next_cursor,per_page)meta-- Request metadata including a uniquerequest_id
See the full List Meetings endpoint for all query parameters and response fields.
Next Steps
Now that you have made your first API call, explore these guides for deeper detail:
- Authentication -- API key management, rate limits, and security best practices
- Pagination -- Navigate large result sets with cursors
- Error Handling -- Handle errors gracefully with retry logic
- API Reference -- Full endpoint documentation for all resources