Guide
Build a civic lookup agent
Find public-facing civic service points with enough structure for agents, without scraping city websites.
Use case fit
Best for assistants that help residents find public-facing civic services, permits, and service counters.
Expected outcome: One authenticated civic service-point query with privacy-conscious, public-contact-only output.
SmartAPIs.net data is legally reviewed and machine-readable, but this guide is not legal, compliance, or professional advice.
1. Pull context
Start with public context so the agent knows which metro it is serving.
curl
curl https://smartapis.net/v1/agent/context/ottawa
Python
import urllib.request
with urllib.request.urlopen("https://smartapis.net/v1/agent/context/ottawa", timeout=30) as resp:
print(resp.read().decode("utf-8"))
2. Query public-facing service points
Use a client key with `civic:read` to retrieve public-only service point records.
curl
curl -H "X-API-Key: $SMARTAPIS_API_KEY" \
"https://smartapis.net/v1/civic/service-points?region_id=ottawa-region&q=permit&limit=5"
Python
import os, urllib.parse, urllib.request
params = urllib.parse.urlencode({"region_id": "ottawa-region", "q": "permit", "limit": 5})
request = urllib.request.Request(
f"https://smartapis.net/v1/civic/service-points?{params}",
headers={"X-API-Key": os.environ["SMARTAPIS_API_KEY"]},
)
with urllib.request.urlopen(request, timeout=30) as resp:
print(resp.read().decode("utf-8"))
JavaScript
const response = await fetch(
'https://smartapis.net/v1/civic/service-points?region_id=ottawa-region&q=permit&limit=5',
{ headers: { 'X-API-Key': process.env.SMARTAPIS_API_KEY } }
);
console.log(await response.json());