Quickstart
Get a free API key and make your first call to the BC Data REST API or MCP server.
1. Get a key
- Open bcmcp.ca/signup.
- Enter your first name, last name and email, and say whether you are a B.C. resident. Both answers are fine.
- Type the six digit code we send to that address. It lasts 10 minutes.
- On your account page, make a key. Copy it now. It is shown once, and we keep only a hash of it.
A key looks like bcd_ followed by 40 characters. Keep it out of source control.
2. Make a call
Put the key in an environment variable and ask which sources exist:
export BCDATA_KEY=bcd_your_key_here
curl -X POST https://api.bcmcp.ca/v1/tools/list_sources \
-H "Authorization: Bearer $BCDATA_KEY" \
-H "Content-Type: application/json" \
-d '{"domain":"elections"}'You get an envelope back: data with the answer, citations with the government sources, freshness and notes. See Citations and freshness.
3. Search
curl -X POST https://api.bcmcp.ca/v1/tools/search \
-H "Authorization: Bearer $BCDATA_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"Chilliwack results","domain":"elections"}'Each hit has a ref. Pass it to fetch_record for the stored record.
4. Check your key's allowance
curl https://api.bcmcp.ca/v1/usage -H "Authorization: Bearer $BCDATA_KEY"Use it from an AI app
Add the MCP server to your client with the same key. See Connect an MCP client.
If something fails
A missing or wrong key gets 401. Going over your allowance gets 429 with a retry-after header. All errors are listed under Errors.