Back to How-To
How-To

Legal Land Description API Integration for Developers

Integrate Canadian legal land descriptions into your app. Convert DLS, LSD, NTS, and Ontario formats to GPS coordinates with the Township Canada API.

Legal Land Description API Integration for Developers

You're building a web app, a data pipeline, or a field tool that handles Canadian land data, and your input column contains LSD 06-32-048-07W5, NW-25-24-1-W5, A-2-F/93-P-8, and Lot 2 Con 4 Osprey all mixed together. Each string follows a different survey system and resolves to a different parcel in a different province. Parsing and geocoding these correctly is the first problem any legal land description API integration needs to solve.

This guide covers the formats you'll encounter, how to authenticate and query the Township Canada Search API, and how to display results on a map using Google Maps, Leaflet, or Mapbox.

Canadian Survey Formats You Need to Handle

Four survey systems account for the vast majority of legal land descriptions in Canadian datasets:

DLS (Dominion Land Survey) covers Alberta, Saskatchewan, Manitoba, and BC's Peace River block. A quarter section like NW-25-24-1-W5 encodes direction (NW), section (25), township (24), range (1), and meridian (W5), roughly 160 acres. An LSD like 06-32-048-07W5 identifies a specific 40-acre legal subdivision within a DLS section. LSDs are the standard addressing format on AER well licences and appear in UWI codes as the middle segment (e.g., 100/06-32-048-07W5/00).

NTS (National Topographic System) is used in British Columbia and for federal resource permits. A reference like A-2-F/93-P-8 identifies a quarter unit within the NTS map sheet hierarchy. Formats vary more than DLS. The API normalizes input automatically.

Ontario Geographic Townships use lot-and-concession notation: Lot 2 Con 4 Osprey identifies Lot 2, Concession 4, in the Township of Osprey. This system predates Confederation and covers most of southern and central Ontario. The Ontario lot and concession lookup guide explains the format in detail.

River lots appear in Manitoba's historical settlement areas along the Red and Assiniboine rivers, using a distinct numbering scheme tied to river frontage.

Don't write your own parser for these formats. Edge cases include correction sections (columns 1 and 7 in each DLS township), historical resurveys, and BC PNG Grid references that resemble NTS but follow different rules. The API handles all of them.

Authentication and API Setup

The Township Canada Search API uses a REST interface at https://developer.townshipcanada.com. All requests require an X-API-Key header.

To get started:

  1. Create an account at townshipcanada.com and subscribe to the Search API
  2. Generate an API key from the Developer Portal
  3. Include the key as an X-API-Key header on every request

The Search API Build tier includes 1,000 requests/month (see pricing). The API integration guide covers all pricing tiers, rate limits, and quota management.

Making Your First API Request

The forward search endpoint converts a legal land description string to GPS coordinates:

GET /search/legal-location?location=NW-25-24-1-W5
const response = await fetch(
  `https://developer.townshipcanada.com/search/legal-location?location=${encodeURIComponent("NW-25-24-1-W5")}`,
  { headers: { "X-API-Key": process.env.TOWNSHIP_API_KEY } }
);

const data = await response.json();
const centroid = data.features.find((f) => f.properties.shape === "centroid");
const boundary = data.features.find((f) => f.properties.shape === "grid");

const [lng, lat] = centroid.geometry.coordinates;
// lng: -114.019, lat: 51.078
// boundary.geometry -> GeoJSON Polygon (160-acre quarter section boundary)

The response is a GeoJSON FeatureCollection containing two features: a centroid point at the centre of the parcel, and a grid polygon representing the full boundary. Properties include the detected survey_system, province, and normalized legal_location.

For reverse geocoding (converting GPS coordinates back to a legal description), use the coordinates endpoint:

GET /search/coordinates?location=-114.019,51.078&unit=Quarter%20Section

The unit parameter controls the resolution: Quarter Section (160 acres), LSD (40 acres), Section (640 acres), or Township. The response format is identical to the forward endpoint.

The Search API guide has complete examples in JavaScript, Node.js, Python, and React, including error handling and retry logic for rate limits.

Displaying Results on a Map

Once you have the centroid and boundary polygon from the API, you can render them directly on a web map. The GeoJSON format returned by the API works natively with all major mapping libraries:

  • Google Maps: Pass the boundary polygon to google.maps.data.addGeoJson() and place a marker at the centroid. Full setup in the Google Maps integration guide.
  • Leaflet: Use L.geoJSON(boundary) to add the polygon layer and L.marker([lat, lng]) for the centroid. Full setup in the Leaflet integration guide.
  • Mapbox GL JS: Add the boundary as a GeoJSON source with a fill layer, then fly the camera to the centroid. Full setup in the Mapbox integration guide.

For displaying the DLS or NTS survey grid itself as a base layer on your map, the Township Canada Maps API serves vector tiles compatible with all three libraries.

Batch Processing for Pipelines and Bulk Imports

For datasets larger than a handful of lookups (well inventories, regulatory filings, crop insurance claim lists), the Batch API accepts up to 100 legal land descriptions per request and returns GPS coordinates for each row. Failed lookups return an error per record rather than aborting the entire batch, so one bad description doesn't block the rest.

See pricing for Batch API tiers. For the web-based batch tool (CSV upload, export to Shapefile, KML, or GeoJSON), see the batch conversion guide.

Common Integration Mistakes

Assuming one format: A parser built for Alberta DLS will break on BC NTS references, Ontario lot-and-concession notation, or Manitoba river lots. Use the API instead of writing regex. It normalizes all Canadian formats on input.

Dropping the meridian: 06-32-048-07W5 and 06-32-048-07W4 look nearly identical but resolve to locations over 250 km apart. Always store and transmit the full legal land description string, including the meridian suffix.

Ignoring the boundary: Legal land descriptions identify areas, not points. A quarter section covers 160 acres. If your application does proximity calculations or spatial queries, use the boundary polygon from the API response rather than the centre point alone.

Start Building

Get an API key from the Developer Portal and make your first request in minutes. The Search API guide has complete code examples in multiple languages, and the DLS system overview and LSD overview explain the survey grid hierarchy underlying most Canadian legal land descriptions.

To see a conversion before writing any code, enter NW-25-24-1-W5 in Township Canada's search bar and view the parcel boundary, GPS coordinates, and surrounding grid on the map.