Quick start
Base URL: https://wellpad.ca/api/v1. Send your key in the Authorization: Bearer YOUR_API_KEY header (X-API-Key: YOUR_API_KEY works too). All requests and responses are JSON over HTTPS.
Call the API from your server or script, not from a web page or app that other people can open: anyone who sees the key can use your allowance.
curl "https://wellpad.ca/api/v1/lsd?code=13-34-042-04W5" \
-H "Authorization: Bearer YOUR_API_KEY"LSD, quarter and section formats
Look up a legal subdivision (LSD), a quarter section or a whole section. Upper or lower case, with or without leading zeros, dashes or spaces:
- LSD: 05-10-044-10W5, 5-10-44-10 W5, 05-10-044-10-W5, 05 10 044 10 W5, LSD 05-10-044-10W5
- Quarter section: NE-10-044-10W5, NE 10-44-10 W5, SW 1/4 10-044-10W5 (NE, NW, SE or SW)
- Whole section: SEC 10-044-10W5, or just three numbers: 10-44-10 W5
- An M after the meridian is fine everywhere: 05-10-044-10W5M
Alberta only: meridians W4, W5 and W6, LSD 1–16, section 1–36, township 1–126, range 1–30. Results give the code back in standard form and say which kind it is in type. Well identifiers (UWIs) aren’t supported yet.
Endpoints
GET /lsd: look up one LSD, quarter or section
curl "https://wellpad.ca/api/v1/lsd?code=13-34-042-04W5" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"code": "13-34-042-04W5",
"type": "lsd",
"found": true,
"latitude": 52.6669763,
"longitude": -114.502512
}URL-encode the code if it has spaces or a slash (e.g. ?code=NE%2034-42-4%20W5); dashes need nothing.
A valid LSD we have no location for returns 200 with "found": false and null coordinates. An invalid code returns 400 invalid_code.
POST /lsd/batch: look up up to 100 at once
curl -X POST "https://wellpad.ca/api/v1/lsd/batch" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"codes": ["13-34-042-04W5", "NE 34-42-4 W5", "34-42-4 W5", "hello"]}'
{
"results": [
{ "input": "13-34-042-04W5", "code": "13-34-042-04W5", "type": "lsd",
"found": true, "latitude": 52.6669763, "longitude": -114.502512 },
{ "input": "NE 34-42-4 W5", "code": "NE-34-042-04W5", "type": "quarter",
"found": true, "latitude": 52.6651038, "longitude": -114.487694 },
{ "input": "34-42-4 W5", "code": "34-042-04W5", "type": "section",
"found": true, "latitude": 52.6614872, "longitude": -114.4936167 },
{ "input": "hello", "code": null, "type": null, "found": false,
"latitude": null, "longitude": null,
"error": "Invalid format. Use LSD-SECTION-TOWNSHIP-RANGE + meridian, ..." }
]
}Results come back in the same order as codes, one per input. Invalid codes don’t fail the request; they get an error instead. Batches are the fastest way to look up many LSDs.
GET /lsd/at: the LSD at a GPS point
curl "https://wellpad.ca/api/v1/lsd/at?lat=52.6669763&lon=-114.501036" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"found": true,
"code": "13-34-042-04W5",
"quarter": "NW-34-042-04W5",
"section": "34-042-04W5",
"latitude": 52.6669763,
"longitude": -114.502512,
"distanceMeters": 100
}Send lat and lon in decimal degrees (WGS84, longitude negative). You get the LSD whose centre is nearest the point, the quarter and section it’s in, the LSD’s centre in latitude/longitude, and how far the point is from that centre. It counts as one lookup. Within a few metres of an LSD boundary it can return the neighbouring LSD. Points outside Alberta return 400 outside_alberta and aren’t counted.
GET /usage: your allowance (free, not counted)
curl "https://wellpad.ca/api/v1/usage" -H "Authorization: Bearer YOUR_API_KEY"
{
"plan": "Starter",
"used": 412,
"limit": 2000,
"remaining": 1588,
"periodStart": "2026-10-20T00:59:44.000Z",
"periodEnd": "2026-11-20T00:59:44.000Z"
}Dates are UTC (ISO 8601). Your allowance resets when your next billing period starts at periodEnd.
Response fields
| Field | Type | Meaning |
|---|---|---|
| input | string | Batch only: the code exactly as you sent it, so you can match results to your rows. |
| code | string | null | The code in standard form: 05-10-044-10W5 (LSD), NE-10-044-10W5 (quarter) or 10-044-10W5 (section). Null if the input wasn’t valid. |
| type | string | null | "lsd", "quarter" or "section". Null if the input wasn’t valid. |
| found | boolean | True if we have a location for it. A valid code can still be false if it isn’t in the survey data. |
| latitude | number | null | Latitude of the centre of the LSD, quarter or section, WGS84 decimal degrees (7 decimals). Null when not found. |
| longitude | number | null | Longitude of the centre, WGS84 decimal degrees (negative = west). Null when not found. |
| error | string | Batch only, and only for an input that isn’t valid: why it was rejected. |
What counts as a lookup
- Each valid LSD, quarter or section in a request is one lookup, whether or not it’s found.
- Each /lsd/at point inside Alberta is one lookup.
- Invalid codes and calls to /usage are free.
- The same code repeated in one batch (in any format) counts once.
- A batch is all or nothing: if it needs more lookups than you have left, the whole request gets a 429 and nothing is counted. Check /usage or the headers below and send a smaller batch.
- Lookup responses include X-Lookups-Limit and X-Lookups-Remaining headers.
Errors
Errors return JSON like {"error": {"code": "quota_exceeded", "message": "…"}}. Use code in your program; message is for people and may change.
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_code | The code in ?code= isn’t a valid LSD (the message says why). | Fix the code. Not counted. |
| 400 | invalid_request | The batch body isn’t {"codes": [...]} with at least one string. | Send JSON with Content-Type: application/json. |
| 400 | batch_too_large | More than 100 codes in one batch. | Split into batches of 100. |
| 400 | invalid_coordinates | /lsd/at needs lat and lon as decimal numbers. | Send ?lat=52.6669&lon=-114.5025. Not counted. |
| 400 | outside_alberta | /lsd/at was given a point outside Alberta. | Check the point (longitude is negative). Not counted. |
| 401 | missing_api_key | No key in the request. | Add the Authorization header. |
| 401 | invalid_api_key | The key is wrong or was revoked. | Check the key, or create a new one. |
| 403 | no_active_plan | The key’s account has no active plan (cancelled or payment failed). | Choose a plan or update your card in Manage billing. |
| 404 | not_found | Unknown endpoint. | Check the URL. |
| 405 | method_not_allowed | Right endpoint, wrong HTTP method. | Use the method in the Allow header. |
| 429 | quota_exceeded | The request needs more lookups than you have left this billing period. | Upgrade, or wait for the next period. Don’t retry. |
| 500 | internal | Something went wrong on our side. | Retry with backoff. |
Retries and limits
- Retry 500s and network errors with a growing wait (for example 1, 2, then 4 seconds).
- Don’t retry 400, 401, 403 or 429: the same request will fail the same way.
- Up to 100 codes per batch, and about 10 requests at a time at most.
JavaScript and Python
JavaScript (Node.js)
// Node 18+ (built-in fetch). Keep the key on your server.
const API_KEY = process.env.WELLPAD_API_KEY;
async function lookupLsds(codes) {
const res = await fetch('https://wellpad.ca/api/v1/lsd/batch', {
method: 'POST',
headers: {
Authorization: `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ codes }), // up to 100
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
return body.results; // same order as codes
}
const results = await lookupLsds(['13-34-042-04W5', '4-12-88-12 W6M']);
for (const r of results) {
console.log(r.input, r.found ? `${r.latitude}, ${r.longitude}` : r.error ?? 'not found');
}Python
# pip install requests
import os
import requests
API_KEY = os.environ["WELLPAD_API_KEY"]
def lookup_lsds(codes):
res = requests.post(
"https://wellpad.ca/api/v1/lsd/batch",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"codes": codes}, # up to 100
timeout=30,
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
return body["results"] # same order as codes
for r in lookup_lsds(["13-34-042-04W5", "4-12-88-12 W6M"]):
print(r["input"], (r["latitude"], r["longitude"]) if r["found"] else r.get("error", "not found"))Notes
- Coordinates are the centre of each LSD, quarter or section from the Alberta Township System survey grid. They’re for finding and mapping sites, not a legal survey.
- The API is versioned (/v1). If we ever need to change /v1 in a way that breaks existing requests, we’ll email subscribers at least 30 days ahead.
- Questions or a format we don’t handle? Email mike@wellpad.ca. See also the Terms of Service.