[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"guide-agriculture-energy-api-guide":3,"related-agriculture-energy-api-guide":3666},{"id":4,"title":5,"body":6,"category":3656,"description":3657,"draft":3658,"extension":3659,"icon":3660,"meta":3661,"navigation":1733,"order":879,"path":3662,"seo":3663,"stem":3664,"__hash__":3665},"guides\u002Fguides\u002Fagriculture-energy-api-guide.md","Agriculture and Energy APIs - Wells, Soil and Tenure by Legal Land Description",{"type":7,"value":8,"toc":3629},"minimark",[9,14,27,38,42,60,93,97,108,156,163,167,177,217,221,238,245,300,307,313,341,366,437,441,450,491,512,519,523,526,555,1026,1045,1067,1165,1177,1186,1254,1302,1306,1309,1456,1500,1528,1532,1537,1638,1666,1670,1676,2445,2449,2452,3081,3085,3096,3104,3110,3113,3178,3181,3438,3452,3456,3516,3519,3525,3529,3532,3556,3559,3563,3567,3574,3578,3587,3591,3599,3606,3615,3619,3625],[10,11,13],"h2",{"id":12},"what-youll-build","What You'll Build",[15,16,17,18,22,23,26],"p",{},"The Agriculture API and the Energy API return parcel intelligence keyed by a Dominion Land Survey legal land description. Send ",[19,20,21],"code",{},"NW-11-5-6-W2"," and get soil classification, land capability, crop rotation and drought for that quarter section. Send ",[19,24,25],{},"7-10-13-9-W4"," and get every well, pipeline segment, facility and Crown disposition on that LSD, with 12 months of production.",[15,28,29,30,33,34,37],{},"This guide covers getting a key, the ",[19,31,32],{},"\u002Freport"," endpoint, ",[19,35,36],{},"include=",", the single-section endpoints, paging through Energy collections, the cross-parcel endpoints for operators and tenure, the response contract, rate limits, and the matching vector tiles. It's written for ag-tech and lending teams scoring farmland, and for energy software and GIS teams that need oil and gas well data by legal land description across Alberta, Saskatchewan and Manitoba.",[10,39,41],{"id":40},"prerequisites","Prerequisites",[43,44,45,54,57],"ul",{},[46,47,48,49],"li",{},"An Agriculture, Energy, or Agriculture + Energy API key. Subscribe on the ",[50,51,53],"a",{"href":52},"\u002Fapi","API page",[46,55,56],{},"Node.js 18+ or Python 3.8+",[46,58,59],{},"Basic familiarity with REST APIs and JSON",[15,61,62,63,67,68,71,72,67,75,78,79,82,83,87,88,92],{},"There are three products. The ",[64,65,66],"strong",{},"Agriculture API"," serves ",[19,69,70],{},"\u002Fag\u002F*",", the ",[64,73,74],{},"Energy API",[19,76,77],{},"\u002Fenergy\u002F*",", and the ",[64,80,81],{},"Agriculture + Energy API"," is one key that works on both, drawing on one monthly allowance. Each comes in Developer, Professional and Business plans, plus Enterprise. See ",[50,84,86],{"href":85},"\u002Fpricing#api-bundles","pricing"," for current prices. To keep separate keys for development and production, follow the ",[50,89,91],{"href":90},"\u002Fguides\u002Fapi-key-management","API key management guide",".",[10,94,96],{"id":95},"base-url-and-authentication","Base URL and Authentication",[15,98,99,100,103,104,107],{},"Every REST endpoint lives under ",[19,101,102],{},"https:\u002F\u002Fdeveloper.townshipcanada.com",", with the key in the ",[19,105,106],{},"X-API-Key"," header:",[109,110,115],"pre",{"className":111,"code":112,"language":113,"meta":114,"style":114},"language-bash shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","curl \"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fenergy\u002Freport?legal_location=7-10-13-9-W4\" \\\n  -H \"X-API-Key: your_api_key\"\n","bash","",[19,116,117,141],{"__ignoreMap":114},[118,119,122,126,130,134,137],"span",{"class":120,"line":121},"line",1,[118,123,125],{"class":124},"sYn-s","curl",[118,127,129],{"class":128},"sbYkP"," \"",[118,131,133],{"class":132},"sTbE_","https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fenergy\u002Freport?legal_location=7-10-13-9-W4",[118,135,136],{"class":128},"\"",[118,138,140],{"class":139},"se3Ec"," \\\n",[118,142,144,148,150,153],{"class":120,"line":143},2,[118,145,147],{"class":146},"sz9Cv","  -H",[118,149,129],{"class":128},[118,151,152],{"class":132},"X-API-Key: your_api_key",[118,154,155],{"class":128},"\"\n",[15,157,158,159,92],{},"Store keys in server-side environment variables. The vector tiles use a different host and a query parameter, covered ",[50,160,162],{"href":161},"#vector-tiles","below",[10,164,166],{"id":165},"coverage","Coverage",[15,168,169,170,173,174,92],{},"Both APIs cover Alberta, Saskatchewan and Manitoba. A BC (NTS) location returns ",[19,171,172],{},"400"," with code ",[19,175,176],{},"bc_not_supported",[43,178,179,205],{},[46,180,181,184,185,188,189,192,193,196,197,200,201,204],{},[64,182,183],{},"Agriculture"," is keyed by quarter section. An LSD input resolves to its containing quarter section: the response echoes your input in ",[19,186,187],{},"legal_location",", names the quarter it describes in ",[19,190,191],{},"resolved_legal_location",", and sets ",[19,194,195],{},"grain"," to ",[19,198,199],{},"\"lsd\""," or ",[19,202,203],{},"\"quarter_section\"",". Wetlands are published for Alberta only.",[46,206,207,210,211,213,214,92],{},[64,208,209],{},"Energy"," is keyed by LSD (",[19,212,25],{},"). Alberta reads AER data, Saskatchewan reads GeoAtlas, and Manitoba reads the Petroleum Branch. Manitoba publishes no open pipeline, facility or production layer, so those sections come back empty and are listed in ",[19,215,216],{},"meta.unavailable",[10,218,220],{"id":219},"the-report-endpoints","The Report Endpoints",[109,222,226],{"className":223,"code":224,"language":225,"meta":114,"style":114},"language-http shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","GET \u002Fag\u002Freport?legal_location=NW-11-5-6-W2\nGET \u002Fenergy\u002Freport?legal_location=7-10-13-9-W4\n","http",[19,227,228,233],{"__ignoreMap":114},[118,229,230],{"class":120,"line":121},[118,231,232],{},"GET \u002Fag\u002Freport?legal_location=NW-11-5-6-W2\n",[118,234,235],{"class":120,"line":143},[118,236,237],{},"GET \u002Fenergy\u002Freport?legal_location=7-10-13-9-W4\n",[15,239,240],{},[241,242],"img",{"alt":243,"src":244},"The Energy page of the developer documentation, listing the \u002Fenergy\u002Freport endpoint with an example curl request and every Energy route in the page outline","\u002Fimages\u002Fguides\u002Fagriculture-energy-api-guide\u002Fenergy-docs.webp",[15,246,247,248,251,252,255,256,255,259,255,262,255,265,255,268,255,271,274,275,278,279,255,282,255,285,255,288,255,291,255,294,274,297,92],{},"The Agriculture report returns ",[19,249,250],{},"productivity"," (LSRS and CLI scores, classes and limiters), ",[19,253,254],{},"cropping",", ",[19,257,258],{},"soil",[19,260,261],{},"land_use",[19,263,264],{},"drought",[19,266,267],{},"wetlands",[19,269,270],{},"hydrology",[19,272,273],{},"parcel_context"," and ",[19,276,277],{},"provincial_detail",". The Energy report returns ",[19,280,281],{},"summary",[19,283,284],{},"production",[19,286,287],{},"tenure",[19,289,290],{},"wells",[19,292,293],{},"pipelines",[19,295,296],{},"facilities",[19,298,299],{},"alternative_energy",[301,302,304,305],"h3",{"id":303},"request-only-what-you-need-with-include","Request only what you need with ",[19,306,36],{},[15,308,309,312],{},[19,310,311],{},"include"," takes a comma-separated list of section names. It is a projection, not a filter: sections you leave out are never queried, so a narrow request is faster.",[109,314,316],{"className":111,"code":315,"language":113,"meta":114,"style":114},"curl \"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fag\u002Freport?legal_location=NW-11-5-6-W2&include=soil,drought,geometry\" \\\n  -H \"X-API-Key: your_api_key\"\n",[19,317,318,331],{"__ignoreMap":114},[118,319,320,322,324,327,329],{"class":120,"line":121},[118,321,125],{"class":124},[118,323,129],{"class":128},[118,325,326],{"class":132},"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fag\u002Freport?legal_location=NW-11-5-6-W2&include=soil,drought,geometry",[118,328,136],{"class":128},[118,330,140],{"class":139},[118,332,333,335,337,339],{"class":120,"line":143},[118,334,147],{"class":146},[118,336,129],{"class":128},[118,338,152],{"class":132},[118,340,155],{"class":128},[15,342,343,346,347,350,351,354,355,357,358,361,362,365],{},[19,344,345],{},"geometry"," is a section name too. The parcel polygon is never in the default report; ",[19,348,349],{},"include=geometry"," attaches it as GeoJSON under ",[19,352,353],{},"parcel.geometry",". Otherwise ",[19,356,353],{}," is ",[19,359,360],{},"null",". An unknown section name returns ",[19,363,364],{},"400 invalid_parameter"," listing the valid values.",[367,368,369,385],"table",{},[370,371,372],"thead",{},[373,374,375,379],"tr",{},[376,377,378],"th",{},"API",[376,380,381,382,384],{},"Valid ",[19,383,311],{}," values",[386,387,388,415],"tbody",{},[373,389,390,393],{},[391,392,183],"td",{},[391,394,395,255,397,255,399,255,401,255,403,255,405,255,407,255,409,255,411,255,413],{},[19,396,250],{},[19,398,254],{},[19,400,258],{},[19,402,261],{},[19,404,264],{},[19,406,267],{},[19,408,270],{},[19,410,273],{},[19,412,277],{},[19,414,345],{},[373,416,417,419],{},[391,418,209],{},[391,420,421,255,423,255,425,255,427,255,429,255,431,255,433,255,435],{},[19,422,281],{},[19,424,284],{},[19,426,287],{},[19,428,290],{},[19,430,293],{},[19,432,296],{},[19,434,299],{},[19,436,345],{},[301,438,440],{"id":439},"single-section-endpoints","Single-section endpoints",[15,442,443,444,446,447,449],{},"Each of these returns one section, with the same ",[19,445,187],{}," parameter as ",[19,448,32],{},":",[43,451,452,479],{},[46,453,454,455,255,458,255,461,255,464,255,467,255,470,255,473,255,476],{},"Agriculture: ",[19,456,457],{},"\u002Fag\u002Fproductivity",[19,459,460],{},"\u002Fag\u002Fcropping",[19,462,463],{},"\u002Fag\u002Fsoil",[19,465,466],{},"\u002Fag\u002Fland-use",[19,468,469],{},"\u002Fag\u002Fdrought",[19,471,472],{},"\u002Fag\u002Fwetlands",[19,474,475],{},"\u002Fag\u002Fhydrology",[19,477,478],{},"\u002Fag\u002Fparcel-context",[46,480,481,482,255,485,255,488],{},"Energy: ",[19,483,484],{},"\u002Fenergy\u002Fsummary",[19,486,487],{},"\u002Fenergy\u002Fproduction",[19,489,490],{},"\u002Fenergy\u002Falternative-energy",[15,492,493,274,495,497,498,501,502,505,506,508,509,92],{},[19,494,277],{},[19,496,345],{}," have no route of their own. Request them through ",[19,499,500],{},"\u002Fag\u002Freport?include=...",". A section with no data for that parcel is a ",[19,503,504],{},"200"," with a ",[19,507,360],{}," payload, not a ",[19,510,511],{},"404",[15,513,514,515,518],{},"Each section call counts as one request, the same as a full report. If you need three sections for one parcel, ",[19,516,517],{},"\u002Freport?include=soil,drought,hydrology"," is one request instead of three.",[10,520,522],{"id":521},"the-response-contract","The Response Contract",[15,524,525],{},"Both APIs follow the same rules, so one client handles both.",[15,527,528,531,532,535,536,539,540,357,543,546,547,550,551,554],{},[64,529,530],{},"Array sections are envelopes."," Every array in an Energy report is shaped ",[19,533,534],{},"{total, returned, truncated, more, rows}",". ",[19,537,538],{},"total"," is the true count, ",[19,541,542],{},"truncated",[19,544,545],{},"true"," when ",[19,548,549],{},"returned \u003C total",", and ",[19,552,553],{},"more"," is the path of the collection endpoint that pages through all of it:",[109,556,560],{"className":557,"code":558,"language":559,"meta":114,"style":114},"language-json shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","{\n  \"legal_location\": \"7-10-13-9-W4\",\n  \"province\": \"AB\",\n  \"parcel\": { \"area_ha\": 16.19, \"centroid\": { \"lat\": 50.06, \"lng\": -111.12 }, \"geometry\": null },\n  \"wells\": {\n    \"total\": 3,\n    \"returned\": 3,\n    \"truncated\": false,\n    \"more\": \"\u002Fenergy\u002Fwells?legal_location=7-10-13-9-W4\",\n    \"rows\": [{ \"...\": \"...\" }]\n  },\n  \"units\": {\n    \"length\": \"m\",\n    \"area\": \"ha\",\n    \"depth\": \"m\",\n    \"pressure\": \"kPa\",\n    \"oil\": \"m3\",\n    \"gas\": \"e3m3\"\n  },\n  \"meta\": { \"unavailable\": [], \"sources\": { \"...\": \"...\" } }\n}\n","json",[19,561,562,568,590,611,699,713,730,746,762,782,815,821,835,856,877,897,918,939,958,963,1020],{"__ignoreMap":114},[118,563,564],{"class":120,"line":121},[118,565,567],{"class":566},"soVBu","{\n",[118,569,570,574,577,579,581,583,585,587],{"class":120,"line":143},[118,571,573],{"class":572},"s4Jsk","  \"",[118,575,187],{"class":576},"sLorS",[118,578,136],{"class":572},[118,580,449],{"class":566},[118,582,129],{"class":128},[118,584,25],{"class":132},[118,586,136],{"class":128},[118,588,589],{"class":566},",\n",[118,591,593,595,598,600,602,604,607,609],{"class":120,"line":592},3,[118,594,573],{"class":572},[118,596,597],{"class":576},"province",[118,599,136],{"class":572},[118,601,449],{"class":566},[118,603,129],{"class":128},[118,605,606],{"class":132},"AB",[118,608,136],{"class":128},[118,610,589],{"class":566},[118,612,614,616,619,621,623,626,628,632,634,636,640,643,645,648,650,652,654,656,660,662,664,667,669,671,674,676,678,681,684,686,688,690,692,696],{"class":120,"line":613},4,[118,615,573],{"class":572},[118,617,618],{"class":576},"parcel",[118,620,136],{"class":572},[118,622,449],{"class":566},[118,624,625],{"class":566}," {",[118,627,129],{"class":572},[118,629,631],{"class":630},"sa2tF","area_ha",[118,633,136],{"class":572},[118,635,449],{"class":566},[118,637,639],{"class":638},"s7CZa"," 16.19",[118,641,642],{"class":566},",",[118,644,129],{"class":572},[118,646,647],{"class":630},"centroid",[118,649,136],{"class":572},[118,651,449],{"class":566},[118,653,625],{"class":566},[118,655,129],{"class":572},[118,657,659],{"class":658},"skNjk","lat",[118,661,136],{"class":572},[118,663,449],{"class":566},[118,665,666],{"class":638}," 50.06",[118,668,642],{"class":566},[118,670,129],{"class":572},[118,672,673],{"class":658},"lng",[118,675,136],{"class":572},[118,677,449],{"class":566},[118,679,680],{"class":638}," -111.12",[118,682,683],{"class":566}," },",[118,685,129],{"class":572},[118,687,345],{"class":630},[118,689,136],{"class":572},[118,691,449],{"class":566},[118,693,695],{"class":694},"s8XtY"," null",[118,697,698],{"class":566}," },\n",[118,700,702,704,706,708,710],{"class":120,"line":701},5,[118,703,573],{"class":572},[118,705,290],{"class":576},[118,707,136],{"class":572},[118,709,449],{"class":566},[118,711,712],{"class":566}," {\n",[118,714,716,719,721,723,725,728],{"class":120,"line":715},6,[118,717,718],{"class":572},"    \"",[118,720,538],{"class":630},[118,722,136],{"class":572},[118,724,449],{"class":566},[118,726,727],{"class":638}," 3",[118,729,589],{"class":566},[118,731,733,735,738,740,742,744],{"class":120,"line":732},7,[118,734,718],{"class":572},[118,736,737],{"class":630},"returned",[118,739,136],{"class":572},[118,741,449],{"class":566},[118,743,727],{"class":638},[118,745,589],{"class":566},[118,747,749,751,753,755,757,760],{"class":120,"line":748},8,[118,750,718],{"class":572},[118,752,542],{"class":630},[118,754,136],{"class":572},[118,756,449],{"class":566},[118,758,759],{"class":694}," false",[118,761,589],{"class":566},[118,763,765,767,769,771,773,775,778,780],{"class":120,"line":764},9,[118,766,718],{"class":572},[118,768,553],{"class":630},[118,770,136],{"class":572},[118,772,449],{"class":566},[118,774,129],{"class":128},[118,776,777],{"class":132},"\u002Fenergy\u002Fwells?legal_location=7-10-13-9-W4",[118,779,136],{"class":128},[118,781,589],{"class":566},[118,783,785,787,790,792,794,797,799,802,804,806,808,810,812],{"class":120,"line":784},10,[118,786,718],{"class":572},[118,788,789],{"class":630},"rows",[118,791,136],{"class":572},[118,793,449],{"class":566},[118,795,796],{"class":566}," [{",[118,798,129],{"class":572},[118,800,801],{"class":658},"...",[118,803,136],{"class":572},[118,805,449],{"class":566},[118,807,129],{"class":128},[118,809,801],{"class":132},[118,811,136],{"class":128},[118,813,814],{"class":566}," }]\n",[118,816,818],{"class":120,"line":817},11,[118,819,820],{"class":566},"  },\n",[118,822,824,826,829,831,833],{"class":120,"line":823},12,[118,825,573],{"class":572},[118,827,828],{"class":576},"units",[118,830,136],{"class":572},[118,832,449],{"class":566},[118,834,712],{"class":566},[118,836,838,840,843,845,847,849,852,854],{"class":120,"line":837},13,[118,839,718],{"class":572},[118,841,842],{"class":630},"length",[118,844,136],{"class":572},[118,846,449],{"class":566},[118,848,129],{"class":128},[118,850,851],{"class":132},"m",[118,853,136],{"class":128},[118,855,589],{"class":566},[118,857,859,861,864,866,868,870,873,875],{"class":120,"line":858},14,[118,860,718],{"class":572},[118,862,863],{"class":630},"area",[118,865,136],{"class":572},[118,867,449],{"class":566},[118,869,129],{"class":128},[118,871,872],{"class":132},"ha",[118,874,136],{"class":128},[118,876,589],{"class":566},[118,878,880,882,885,887,889,891,893,895],{"class":120,"line":879},15,[118,881,718],{"class":572},[118,883,884],{"class":630},"depth",[118,886,136],{"class":572},[118,888,449],{"class":566},[118,890,129],{"class":128},[118,892,851],{"class":132},[118,894,136],{"class":128},[118,896,589],{"class":566},[118,898,900,902,905,907,909,911,914,916],{"class":120,"line":899},16,[118,901,718],{"class":572},[118,903,904],{"class":630},"pressure",[118,906,136],{"class":572},[118,908,449],{"class":566},[118,910,129],{"class":128},[118,912,913],{"class":132},"kPa",[118,915,136],{"class":128},[118,917,589],{"class":566},[118,919,921,923,926,928,930,932,935,937],{"class":120,"line":920},17,[118,922,718],{"class":572},[118,924,925],{"class":630},"oil",[118,927,136],{"class":572},[118,929,449],{"class":566},[118,931,129],{"class":128},[118,933,934],{"class":132},"m3",[118,936,136],{"class":128},[118,938,589],{"class":566},[118,940,942,944,947,949,951,953,956],{"class":120,"line":941},18,[118,943,718],{"class":572},[118,945,946],{"class":630},"gas",[118,948,136],{"class":572},[118,950,449],{"class":566},[118,952,129],{"class":128},[118,954,955],{"class":132},"e3m3",[118,957,155],{"class":128},[118,959,961],{"class":120,"line":960},19,[118,962,820],{"class":566},[118,964,966,968,971,973,975,977,979,982,984,986,989,991,994,996,998,1000,1002,1004,1006,1008,1010,1012,1014,1017],{"class":120,"line":965},20,[118,967,573],{"class":572},[118,969,970],{"class":576},"meta",[118,972,136],{"class":572},[118,974,449],{"class":566},[118,976,625],{"class":566},[118,978,129],{"class":572},[118,980,981],{"class":630},"unavailable",[118,983,136],{"class":572},[118,985,449],{"class":566},[118,987,988],{"class":566}," [],",[118,990,129],{"class":572},[118,992,993],{"class":630},"sources",[118,995,136],{"class":572},[118,997,449],{"class":566},[118,999,625],{"class":566},[118,1001,129],{"class":572},[118,1003,801],{"class":658},[118,1005,136],{"class":572},[118,1007,449],{"class":566},[118,1009,129],{"class":128},[118,1011,801],{"class":132},[118,1013,136],{"class":128},[118,1015,1016],{"class":566}," }",[118,1018,1019],{"class":566}," }\n",[118,1021,1023],{"class":120,"line":1022},21,[118,1024,1025],{"class":566},"}\n",[15,1027,1028,1029,255,1032,255,1034,274,1036,1038,1039,1041,1042,1044],{},"Inside ",[19,1030,1031],{},"\u002Fenergy\u002Freport",[19,1033,290],{},[19,1035,293],{},[19,1037,296],{}," are capped at 50 rows and ",[19,1040,287],{}," at 20. Check ",[19,1043,542],{}," before you assume you have every row.",[15,1046,1047,1052,1053,1056,1057,255,1060,200,1063,1066],{},[64,1048,1049,1051],{},[19,1050,216],{}," explains gaps."," Each entry is ",[19,1054,1055],{},"{section, reason}",", with reason ",[19,1058,1059],{},"source_error",[19,1061,1062],{},"timeout",[19,1064,1065],{},"not_published_in_province",". A Saskatchewan quarter section comes back with:",[109,1068,1070],{"className":557,"code":1069,"language":559,"meta":114,"style":114},"\"meta\": {\n  \"unavailable\": [{ \"section\": \"wetlands\", \"reason\": \"not_published_in_province\" }],\n  \"sources\": { \"...\": \"...\" }\n}\n",[19,1071,1072,1086,1133,1161],{"__ignoreMap":114},[118,1073,1074,1076,1078,1080,1084],{"class":120,"line":121},[118,1075,136],{"class":128},[118,1077,970],{"class":132},[118,1079,136],{"class":128},[118,1081,1083],{"class":1082},"sftqT",": ",[118,1085,567],{"class":566},[118,1087,1088,1090,1092,1094,1096,1098,1100,1103,1105,1107,1109,1111,1113,1115,1117,1120,1122,1124,1126,1128,1130],{"class":120,"line":143},[118,1089,573],{"class":572},[118,1091,981],{"class":576},[118,1093,136],{"class":572},[118,1095,449],{"class":566},[118,1097,796],{"class":566},[118,1099,129],{"class":572},[118,1101,1102],{"class":630},"section",[118,1104,136],{"class":572},[118,1106,449],{"class":566},[118,1108,129],{"class":128},[118,1110,267],{"class":132},[118,1112,136],{"class":128},[118,1114,642],{"class":566},[118,1116,129],{"class":572},[118,1118,1119],{"class":630},"reason",[118,1121,136],{"class":572},[118,1123,449],{"class":566},[118,1125,129],{"class":128},[118,1127,1065],{"class":132},[118,1129,136],{"class":128},[118,1131,1132],{"class":566}," }],\n",[118,1134,1135,1137,1139,1141,1143,1145,1147,1149,1151,1153,1155,1157,1159],{"class":120,"line":592},[118,1136,573],{"class":572},[118,1138,993],{"class":576},[118,1140,136],{"class":572},[118,1142,449],{"class":566},[118,1144,625],{"class":566},[118,1146,129],{"class":572},[118,1148,801],{"class":630},[118,1150,136],{"class":572},[118,1152,449],{"class":566},[118,1154,129],{"class":128},[118,1156,801],{"class":132},[118,1158,136],{"class":128},[118,1160,1019],{"class":566},[118,1162,1163],{"class":120,"line":613},[118,1164,1025],{"class":566},[15,1166,1167,1170,1171,1173,1174,1176],{},[19,1168,1169],{},"meta.sources"," names the upstream dataset per section. Treat a ",[19,1172,360],{}," section listed in ",[19,1175,216],{}," as \"not known\", not \"none\".",[15,1178,1179,1182,1183,449],{},[64,1180,1181],{},"Errors have one shape."," Every error from these APIs is ",[19,1184,1185],{},"{error: {code, message}}",[109,1187,1189],{"className":557,"code":1188,"language":559,"meta":114,"style":114},"{\n  \"error\": {\n    \"code\": \"invalid_legal_location\",\n    \"message\": \"'legal_location' must be a Legal Subdivision (e.g. 10-36-42-3-W5).\"\n  }\n}\n",[19,1190,1191,1195,1208,1227,1245,1250],{"__ignoreMap":114},[118,1192,1193],{"class":120,"line":121},[118,1194,567],{"class":566},[118,1196,1197,1199,1202,1204,1206],{"class":120,"line":143},[118,1198,573],{"class":572},[118,1200,1201],{"class":576},"error",[118,1203,136],{"class":572},[118,1205,449],{"class":566},[118,1207,712],{"class":566},[118,1209,1210,1212,1214,1216,1218,1220,1223,1225],{"class":120,"line":592},[118,1211,718],{"class":572},[118,1213,19],{"class":630},[118,1215,136],{"class":572},[118,1217,449],{"class":566},[118,1219,129],{"class":128},[118,1221,1222],{"class":132},"invalid_legal_location",[118,1224,136],{"class":128},[118,1226,589],{"class":566},[118,1228,1229,1231,1234,1236,1238,1240,1243],{"class":120,"line":613},[118,1230,718],{"class":572},[118,1232,1233],{"class":630},"message",[118,1235,136],{"class":572},[118,1237,449],{"class":566},[118,1239,129],{"class":128},[118,1241,1242],{"class":132},"'legal_location' must be a Legal Subdivision (e.g. 10-36-42-3-W5).",[118,1244,155],{"class":128},[118,1246,1247],{"class":120,"line":701},[118,1248,1249],{"class":566},"  }\n",[118,1251,1252],{"class":120,"line":715},[118,1253,1025],{"class":566},[15,1255,1256,1257,255,1260,255,1263,255,1265,1267,1268,1270,1271,1274,1275,1277,1278,1274,1281,1284,1285,1274,1288,1291,1292,1294,1295,1297,1298,92],{},"The codes are ",[19,1258,1259],{},"invalid_parameter",[19,1261,1262],{},"missing_parameter",[19,1264,1222],{},[19,1266,176],{}," (all ",[19,1269,172],{},"), ",[19,1272,1273],{},"not_found"," (",[19,1276,511],{},", a valid location with no data), ",[19,1279,1280],{},"rate_limit_exceeded",[19,1282,1283],{},"429",") and ",[19,1286,1287],{},"internal_error",[19,1289,1290],{},"503","). Branch on ",[19,1293,19],{},", not on ",[19,1296,1233],{},". The full list is in ",[50,1299,1301],{"href":1300},"\u002Fapi\u002Fdocs\u002Freference","errors, limits and OpenAPI",[10,1303,1305],{"id":1304},"energy-collections-filters-and-pagination","Energy Collections: Filters and Pagination",[15,1307,1308],{},"Four collection endpoints page past the report's caps, one LSD at a time. Rows are identical to the report's envelope rows.",[367,1310,1311,1324],{},[370,1312,1313],{},[373,1314,1315,1318,1321],{},[376,1316,1317],{},"Endpoint",[376,1319,1320],{},"Filters",[376,1322,1323],{},"Sort keys",[386,1325,1326,1364,1390,1415],{},[373,1327,1328,1333,1353],{},[391,1329,1330],{},[19,1331,1332],{},"\u002Fenergy\u002Fwells",[391,1334,1335,1274,1338,255,1341,255,1344,255,1347,1270,1350],{},[19,1336,1337],{},"status",[19,1339,1340],{},"active",[19,1342,1343],{},"abandoned",[19,1345,1346],{},"suspended",[19,1348,1349],{},"orphan",[19,1351,1352],{},"operator",[391,1354,1355,255,1358,255,1360,255,1362],{},[19,1356,1357],{},"id",[19,1359,1337],{},[19,1361,1352],{},[19,1363,884],{},[373,1365,1366,1371,1380],{},[391,1367,1368],{},[19,1369,1370],{},"\u002Fenergy\u002Fpipelines",[391,1372,1373,255,1376,255,1378],{},[19,1374,1375],{},"substance",[19,1377,1337],{},[19,1379,1352],{},[391,1381,1382,255,1384,255,1386,1389],{},[19,1383,1357],{},[19,1385,842],{},[19,1387,1388],{},"h2s"," (default)",[373,1391,1392,1397,1406],{},[391,1393,1394],{},[19,1395,1396],{},"\u002Fenergy\u002Ffacilities",[391,1398,1399,255,1402,255,1404],{},[19,1400,1401],{},"category",[19,1403,1337],{},[19,1405,1352],{},[391,1407,1408,255,1410,255,1413],{},[19,1409,1357],{},[19,1411,1412],{},"name",[19,1414,1337],{},[373,1416,1417,1422,1443],{},[391,1418,1419],{},[19,1420,1421],{},"\u002Fenergy\u002Ftenure",[391,1423,1424,1274,1427,255,1430,255,1433,1270,1436,255,1438,255,1440],{},[19,1425,1426],{},"tenure_kind",[19,1428,1429],{},"png",[19,1431,1432],{},"mineral",[19,1434,1435],{},"all",[19,1437,1337],{},[19,1439,1352],{},[19,1441,1442],{},"expires_within_days",[391,1444,1445,255,1448,1451,1452,255,1454],{},[19,1446,1447],{},"expiry",[19,1449,1450],{},"urgency"," (default), ",[19,1453,863],{},[19,1455,1357],{},[15,1457,1458,1459,1274,1462,200,1465,1270,1468,1471,1472,1475,1476,550,1479,1481,1482,255,1484,255,1486,255,1488,255,1491,1493,1494,1496,1497,92],{},"All four take ",[19,1460,1461],{},"dir",[19,1463,1464],{},"asc",[19,1466,1467],{},"desc",[19,1469,1470],{},"page"," (1-based, default 1) and ",[19,1473,1474],{},"per_page"," (1 to 200, default 50). The response is ",[19,1477,1478],{},"{legal_location, province, rows, meta}",[19,1480,970],{}," carries ",[19,1483,538],{},[19,1485,1470],{},[19,1487,1474],{},[19,1489,1490],{},"sort",[19,1492,1461],{}," and every filter echoed back, ",[19,1495,360],{}," where you didn't supply it. Page count is ",[19,1498,1499],{},"Math.ceil(meta.total \u002F meta.per_page)",[109,1501,1503],{"className":111,"code":1502,"language":113,"meta":114,"style":114},"curl \"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fenergy\u002Fwells?legal_location=7-10-13-9-W4&status=abandoned&sort=depth&dir=desc&per_page=100\" \\\n  -H \"X-API-Key: your_api_key\"\n",[19,1504,1505,1518],{"__ignoreMap":114},[118,1506,1507,1509,1511,1514,1516],{"class":120,"line":121},[118,1508,125],{"class":124},[118,1510,129],{"class":128},[118,1512,1513],{"class":132},"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fenergy\u002Fwells?legal_location=7-10-13-9-W4&status=abandoned&sort=depth&dir=desc&per_page=100",[118,1515,136],{"class":128},[118,1517,140],{"class":139},[118,1519,1520,1522,1524,1526],{"class":120,"line":143},[118,1521,147],{"class":146},[118,1523,129],{"class":128},[118,1525,152],{"class":132},[118,1527,155],{"class":128},[10,1529,1531],{"id":1530},"cross-parcel-endpoints","Cross-Parcel Endpoints",[15,1533,1534,1535,449],{},"Five Energy endpoints are keyed on an operator, a disposition or a licence, and take no ",[19,1536,187],{},[43,1538,1539,1562,1584,1605,1624],{},[46,1540,1541,1546,1547,1550,1551,1451,1553,255,1555,255,1557,200,1559,92],{},[64,1542,1543],{},[19,1544,1545],{},"\u002Fenergy\u002Foperators",": a directory of licensees with active, abandoned and orphan well counts and disposition totals. Search with ",[19,1548,1549],{},"q"," (name or BA code), sort by ",[19,1552,1349],{},[19,1554,1340],{},[19,1556,1343],{},[19,1558,1412],{},[19,1560,1561],{},"dispositions",[46,1563,1564,1569,1570,1573,1574,255,1577,274,1580,1583],{},[64,1565,1566],{},[19,1567,1568],{},"\u002Fenergy\u002Foperators\u002F{name}",": one licensee, by BA code, display name or slug. ",[19,1571,1572],{},"view=summary"," (default) returns liability counts, transfers, tenure totals and a footprint of LSDs. ",[19,1575,1576],{},"view=dispositions",[19,1578,1579],{},"view=wells",[19,1581,1582],{},"view=lsds"," are paged lists.",[46,1585,1586,1591,1592,1594,1595,255,1597,255,1600,274,1602,1604],{},[64,1587,1588],{},[19,1589,1590],{},"\u002Fenergy\u002Ftenure\u002Fexpiring",": Crown PNG and mineral dispositions expiring within ",[19,1593,1442],{}," (1 to 3650, default 365), filterable by ",[19,1596,1352],{},[19,1598,1599],{},"type",[19,1601,1426],{},[19,1603,1549],{},". Perpetual dispositions never enter the window.",[46,1606,1607,1612,1613,1616,1617,1620,1621,1623],{},[64,1608,1609],{},[19,1610,1611],{},"\u002Fenergy\u002Fdispositions\u002F{number}",": one disposition. Use the PNG number, or ",[19,1614,1615],{},"category:number"," for mineral tenure with the colon percent-encoded (",[19,1618,1619],{},"metallic%3A0512345678","). This is the ",[19,1622,1357],{}," every tenure row carries.",[46,1625,1626,1631,1632,1634,1635,92],{},[64,1627,1628],{},[19,1629,1630],{},"\u002Fenergy\u002Fpipelines\u002F{licence}",": every segment on one AER pipeline licence, with ",[19,1633,970],{}," shaped ",[19,1636,1637],{},"{total, returned, truncated}",[109,1639,1641],{"className":111,"code":1640,"language":113,"meta":114,"style":114},"curl \"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fenergy\u002Ftenure\u002Fexpiring?expires_within_days=180&tenure_kind=png&sort=expiry\" \\\n  -H \"X-API-Key: your_api_key\"\n",[19,1642,1643,1656],{"__ignoreMap":114},[118,1644,1645,1647,1649,1652,1654],{"class":120,"line":121},[118,1646,125],{"class":124},[118,1648,129],{"class":128},[118,1650,1651],{"class":132},"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fenergy\u002Ftenure\u002Fexpiring?expires_within_days=180&tenure_kind=png&sort=expiry",[118,1653,136],{"class":128},[118,1655,140],{"class":139},[118,1657,1658,1660,1662,1664],{"class":120,"line":143},[118,1659,147],{"class":146},[118,1661,129],{"class":128},[118,1663,152],{"class":132},[118,1665,155],{"class":128},[10,1667,1669],{"id":1668},"javascript-example","JavaScript Example",[15,1671,1672,1673,1675],{},"This script fetches the Energy summary and wells for one LSD, then follows ",[19,1674,553],{}," when the report's wells array is truncated:",[109,1677,1681],{"className":1678,"code":1679,"language":1680,"meta":114,"style":114},"language-javascript shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","const API_KEY = process.env.TOWNSHIP_CANADA_API_KEY;\nconst BASE_URL = \"https:\u002F\u002Fdeveloper.townshipcanada.com\";\n\nasync function get(path) {\n  const response = await fetch(`${BASE_URL}${path}`, {\n    headers: { \"X-API-Key\": API_KEY }\n  });\n  const body = await response.json();\n  if (!response.ok) {\n    throw new Error(`HTTP ${response.status} ${body.error?.code}: ${body.error?.message}`);\n  }\n  return body;\n}\n\nasync function allWells(lsd) {\n  const report = await get(\n    `\u002Fenergy\u002Freport?legal_location=${encodeURIComponent(lsd)}&include=summary,wells`\n  );\n  if (!report.wells.truncated) return report.wells.rows;\n\n  \u002F\u002F Page the collection endpoint the envelope points at\n  const rows = [];\n  for (let page = 1; ; page++) {\n    const result = await get(`${report.wells.more}&page=${page}&per_page=200`);\n    rows.push(...result.rows);\n    if (page >= Math.ceil(result.meta.total \u002F result.meta.per_page)) break;\n  }\n  return rows;\n}\n\nallWells(\"7-10-13-9-W4\")\n  .then((wells) => {\n    const orphans = wells.filter((w) => w.is_orphan);\n    console.log(`${wells.length} wells, ${orphans.length} orphan`);\n  })\n  .catch(console.error);\n","javascript",[19,1682,1683,1712,1729,1735,1759,1803,1826,1835,1857,1880,1947,1951,1960,1964,1968,1986,2002,2030,2037,2073,2077,2083,2098,2132,2183,2209,2263,2268,2277,2282,2287,2304,2327,2368,2417,2424],{"__ignoreMap":114},[118,1684,1685,1689,1693,1696,1699,1701,1704,1706,1709],{"class":120,"line":121},[118,1686,1688],{"class":1687},"s5Kfy","const",[118,1690,1692],{"class":1691},"sSC40"," API_KEY",[118,1694,1695],{"class":566}," =",[118,1697,1698],{"class":1691}," process",[118,1700,92],{"class":566},[118,1702,1703],{"class":1691},"env",[118,1705,92],{"class":566},[118,1707,1708],{"class":1691},"TOWNSHIP_CANADA_API_KEY",[118,1710,1711],{"class":566},";\n",[118,1713,1714,1716,1719,1721,1723,1725,1727],{"class":120,"line":143},[118,1715,1688],{"class":1687},[118,1717,1718],{"class":1691}," BASE_URL",[118,1720,1695],{"class":566},[118,1722,129],{"class":128},[118,1724,102],{"class":132},[118,1726,136],{"class":128},[118,1728,1711],{"class":566},[118,1730,1731],{"class":120,"line":592},[118,1732,1734],{"emptyLinePlaceholder":1733},true,"\n",[118,1736,1737,1740,1743,1747,1750,1754,1757],{"class":120,"line":613},[118,1738,1739],{"class":1687},"async",[118,1741,1742],{"class":1687}," function",[118,1744,1746],{"class":1745},"sljsM"," get",[118,1748,1749],{"class":566},"(",[118,1751,1753],{"class":1752},"sqOPj","path",[118,1755,1756],{"class":566},")",[118,1758,712],{"class":566},[118,1760,1761,1764,1767,1769,1773,1776,1779,1782,1785,1789,1792,1794,1797,1799,1801],{"class":120,"line":701},[118,1762,1763],{"class":1687},"  const",[118,1765,1766],{"class":1691}," response",[118,1768,1695],{"class":566},[118,1770,1772],{"class":1771},"siDh9"," await",[118,1774,1775],{"class":1745}," fetch",[118,1777,1749],{"class":1778},"sLdnO",[118,1780,1781],{"class":128},"`",[118,1783,1784],{"class":694},"${",[118,1786,1788],{"class":1787},"su_V2","BASE_URL",[118,1790,1791],{"class":694},"}${",[118,1793,1753],{"class":1787},[118,1795,1796],{"class":694},"}",[118,1798,1781],{"class":128},[118,1800,642],{"class":566},[118,1802,712],{"class":566},[118,1804,1805,1809,1811,1813,1815,1818,1820,1822,1824],{"class":120,"line":715},[118,1806,1808],{"class":1807},"suXOh","    headers",[118,1810,449],{"class":566},[118,1812,625],{"class":566},[118,1814,129],{"class":128},[118,1816,106],{"class":1817},"sQtxO",[118,1819,136],{"class":128},[118,1821,449],{"class":566},[118,1823,1692],{"class":1691},[118,1825,1019],{"class":566},[118,1827,1828,1831,1833],{"class":120,"line":732},[118,1829,1830],{"class":566},"  }",[118,1832,1756],{"class":1778},[118,1834,1711],{"class":566},[118,1836,1837,1839,1842,1844,1846,1848,1850,1852,1855],{"class":120,"line":748},[118,1838,1763],{"class":1687},[118,1840,1841],{"class":1691}," body",[118,1843,1695],{"class":566},[118,1845,1772],{"class":1771},[118,1847,1766],{"class":1691},[118,1849,92],{"class":566},[118,1851,559],{"class":1745},[118,1853,1854],{"class":1778},"()",[118,1856,1711],{"class":566},[118,1858,1859,1862,1864,1868,1871,1873,1876,1878],{"class":120,"line":764},[118,1860,1861],{"class":1771},"  if",[118,1863,1274],{"class":1778},[118,1865,1867],{"class":1866},"sVsLi","!",[118,1869,1870],{"class":1691},"response",[118,1872,92],{"class":566},[118,1874,1875],{"class":1691},"ok",[118,1877,1756],{"class":1778},[118,1879,712],{"class":566},[118,1881,1882,1885,1888,1891,1893,1895,1898,1900,1902,1904,1906,1908,1911,1914,1916,1918,1921,1923,1925,1927,1929,1931,1933,1935,1937,1939,1941,1943,1945],{"class":120,"line":784},[118,1883,1884],{"class":1771},"    throw",[118,1886,1887],{"class":1866}," new",[118,1889,1890],{"class":1745}," Error",[118,1892,1749],{"class":1778},[118,1894,1781],{"class":128},[118,1896,1897],{"class":132},"HTTP ",[118,1899,1784],{"class":694},[118,1901,1870],{"class":1787},[118,1903,92],{"class":566},[118,1905,1337],{"class":1787},[118,1907,1796],{"class":694},[118,1909,1910],{"class":694}," ${",[118,1912,1913],{"class":1787},"body",[118,1915,92],{"class":566},[118,1917,1201],{"class":1787},[118,1919,1920],{"class":566},"?.",[118,1922,19],{"class":1787},[118,1924,1796],{"class":694},[118,1926,1083],{"class":132},[118,1928,1784],{"class":694},[118,1930,1913],{"class":1787},[118,1932,92],{"class":566},[118,1934,1201],{"class":1787},[118,1936,1920],{"class":566},[118,1938,1233],{"class":1787},[118,1940,1796],{"class":694},[118,1942,1781],{"class":128},[118,1944,1756],{"class":1778},[118,1946,1711],{"class":566},[118,1948,1949],{"class":120,"line":817},[118,1950,1249],{"class":566},[118,1952,1953,1956,1958],{"class":120,"line":823},[118,1954,1955],{"class":1771},"  return",[118,1957,1841],{"class":1691},[118,1959,1711],{"class":566},[118,1961,1962],{"class":120,"line":837},[118,1963,1025],{"class":566},[118,1965,1966],{"class":120,"line":858},[118,1967,1734],{"emptyLinePlaceholder":1733},[118,1969,1970,1972,1974,1977,1979,1982,1984],{"class":120,"line":879},[118,1971,1739],{"class":1687},[118,1973,1742],{"class":1687},[118,1975,1976],{"class":1745}," allWells",[118,1978,1749],{"class":566},[118,1980,1981],{"class":1752},"lsd",[118,1983,1756],{"class":566},[118,1985,712],{"class":566},[118,1987,1988,1990,1993,1995,1997,1999],{"class":120,"line":899},[118,1989,1763],{"class":1687},[118,1991,1992],{"class":1691}," report",[118,1994,1695],{"class":566},[118,1996,1772],{"class":1771},[118,1998,1746],{"class":1745},[118,2000,2001],{"class":1778},"(\n",[118,2003,2004,2007,2010,2012,2015,2018,2020,2022,2024,2027],{"class":120,"line":920},[118,2005,2006],{"class":128},"    `",[118,2008,2009],{"class":132},"\u002Fenergy\u002Freport?legal_location=",[118,2011,1784],{"class":694},[118,2013,2014],{"class":1745},"encodeURIComponent",[118,2016,1749],{"class":2017},"snCua",[118,2019,1981],{"class":1787},[118,2021,1756],{"class":2017},[118,2023,1796],{"class":694},[118,2025,2026],{"class":132},"&include=summary,wells",[118,2028,2029],{"class":128},"`\n",[118,2031,2032,2035],{"class":120,"line":941},[118,2033,2034],{"class":1778},"  )",[118,2036,1711],{"class":566},[118,2038,2039,2041,2043,2045,2048,2050,2052,2054,2056,2058,2061,2063,2065,2067,2069,2071],{"class":120,"line":960},[118,2040,1861],{"class":1771},[118,2042,1274],{"class":1778},[118,2044,1867],{"class":1866},[118,2046,2047],{"class":1691},"report",[118,2049,92],{"class":566},[118,2051,290],{"class":1691},[118,2053,92],{"class":566},[118,2055,542],{"class":1691},[118,2057,1756],{"class":1778},[118,2059,2060],{"class":1771}," return",[118,2062,1992],{"class":1691},[118,2064,92],{"class":566},[118,2066,290],{"class":1691},[118,2068,92],{"class":566},[118,2070,789],{"class":1691},[118,2072,1711],{"class":566},[118,2074,2075],{"class":120,"line":965},[118,2076,1734],{"emptyLinePlaceholder":1733},[118,2078,2079],{"class":120,"line":1022},[118,2080,2082],{"class":2081},"s9Tkl","  \u002F\u002F Page the collection endpoint the envelope points at\n",[118,2084,2086,2088,2091,2093,2096],{"class":120,"line":2085},22,[118,2087,1763],{"class":1687},[118,2089,2090],{"class":1691}," rows",[118,2092,1695],{"class":566},[118,2094,2095],{"class":1778}," []",[118,2097,1711],{"class":566},[118,2099,2101,2104,2106,2109,2112,2114,2117,2120,2123,2125,2128,2130],{"class":120,"line":2100},23,[118,2102,2103],{"class":1771},"  for",[118,2105,1274],{"class":1778},[118,2107,2108],{"class":1687},"let",[118,2110,2111],{"class":1691}," page",[118,2113,1695],{"class":566},[118,2115,2116],{"class":638}," 1",[118,2118,2119],{"class":566},";",[118,2121,2122],{"class":566}," ;",[118,2124,2111],{"class":1691},[118,2126,2127],{"class":1866},"++",[118,2129,1756],{"class":1778},[118,2131,712],{"class":566},[118,2133,2135,2138,2141,2143,2145,2147,2149,2151,2153,2155,2157,2159,2161,2163,2165,2168,2170,2172,2174,2177,2179,2181],{"class":120,"line":2134},24,[118,2136,2137],{"class":1687},"    const",[118,2139,2140],{"class":1691}," result",[118,2142,1695],{"class":566},[118,2144,1772],{"class":1771},[118,2146,1746],{"class":1745},[118,2148,1749],{"class":1778},[118,2150,1781],{"class":128},[118,2152,1784],{"class":694},[118,2154,2047],{"class":1787},[118,2156,92],{"class":566},[118,2158,290],{"class":1787},[118,2160,92],{"class":566},[118,2162,553],{"class":1787},[118,2164,1796],{"class":694},[118,2166,2167],{"class":132},"&page=",[118,2169,1784],{"class":694},[118,2171,1470],{"class":1787},[118,2173,1796],{"class":694},[118,2175,2176],{"class":132},"&per_page=200",[118,2178,1781],{"class":128},[118,2180,1756],{"class":1778},[118,2182,1711],{"class":566},[118,2184,2186,2189,2191,2194,2196,2198,2201,2203,2205,2207],{"class":120,"line":2185},25,[118,2187,2188],{"class":1691},"    rows",[118,2190,92],{"class":566},[118,2192,2193],{"class":1745},"push",[118,2195,1749],{"class":1778},[118,2197,801],{"class":566},[118,2199,2200],{"class":1691},"result",[118,2202,92],{"class":566},[118,2204,789],{"class":1691},[118,2206,1756],{"class":1778},[118,2208,1711],{"class":566},[118,2210,2212,2215,2217,2219,2222,2225,2227,2230,2232,2234,2236,2238,2240,2242,2245,2247,2249,2251,2253,2255,2258,2261],{"class":120,"line":2211},26,[118,2213,2214],{"class":1771},"    if",[118,2216,1274],{"class":1778},[118,2218,1470],{"class":1691},[118,2220,2221],{"class":566}," >=",[118,2223,2224],{"class":1691}," Math",[118,2226,92],{"class":566},[118,2228,2229],{"class":1745},"ceil",[118,2231,1749],{"class":1778},[118,2233,2200],{"class":1691},[118,2235,92],{"class":566},[118,2237,970],{"class":1691},[118,2239,92],{"class":566},[118,2241,538],{"class":1691},[118,2243,2244],{"class":1866}," \u002F",[118,2246,2140],{"class":1691},[118,2248,92],{"class":566},[118,2250,970],{"class":1691},[118,2252,92],{"class":566},[118,2254,1474],{"class":1691},[118,2256,2257],{"class":1778},"))",[118,2259,2260],{"class":1771}," break",[118,2262,1711],{"class":566},[118,2264,2266],{"class":120,"line":2265},27,[118,2267,1249],{"class":566},[118,2269,2271,2273,2275],{"class":120,"line":2270},28,[118,2272,1955],{"class":1771},[118,2274,2090],{"class":1691},[118,2276,1711],{"class":566},[118,2278,2280],{"class":120,"line":2279},29,[118,2281,1025],{"class":566},[118,2283,2285],{"class":120,"line":2284},30,[118,2286,1734],{"emptyLinePlaceholder":1733},[118,2288,2290,2293,2295,2297,2299,2301],{"class":120,"line":2289},31,[118,2291,2292],{"class":1745},"allWells",[118,2294,1749],{"class":2017},[118,2296,136],{"class":128},[118,2298,25],{"class":132},[118,2300,136],{"class":128},[118,2302,2303],{"class":2017},")\n",[118,2305,2307,2310,2313,2315,2317,2319,2321,2325],{"class":120,"line":2306},32,[118,2308,2309],{"class":566},"  .",[118,2311,2312],{"class":1745},"then",[118,2314,1749],{"class":2017},[118,2316,1749],{"class":566},[118,2318,290],{"class":1752},[118,2320,1756],{"class":566},[118,2322,2324],{"class":2323},"sIOqK"," =>",[118,2326,712],{"class":566},[118,2328,2330,2332,2335,2337,2340,2342,2345,2347,2349,2352,2354,2356,2359,2361,2364,2366],{"class":120,"line":2329},33,[118,2331,2137],{"class":1687},[118,2333,2334],{"class":1691}," orphans",[118,2336,1695],{"class":566},[118,2338,2339],{"class":1691}," wells",[118,2341,92],{"class":566},[118,2343,2344],{"class":1745},"filter",[118,2346,1749],{"class":1778},[118,2348,1749],{"class":566},[118,2350,2351],{"class":1752},"w",[118,2353,1756],{"class":566},[118,2355,2324],{"class":2323},[118,2357,2358],{"class":1691}," w",[118,2360,92],{"class":566},[118,2362,2363],{"class":1691},"is_orphan",[118,2365,1756],{"class":1778},[118,2367,1711],{"class":566},[118,2369,2371,2374,2376,2379,2381,2383,2385,2387,2389,2392,2394,2397,2399,2402,2404,2406,2408,2411,2413,2415],{"class":120,"line":2370},34,[118,2372,2373],{"class":1691},"    console",[118,2375,92],{"class":566},[118,2377,2378],{"class":1745},"log",[118,2380,1749],{"class":1778},[118,2382,1781],{"class":128},[118,2384,1784],{"class":694},[118,2386,290],{"class":1787},[118,2388,92],{"class":566},[118,2390,842],{"class":2391},"s131V",[118,2393,1796],{"class":694},[118,2395,2396],{"class":132}," wells, ",[118,2398,1784],{"class":694},[118,2400,2401],{"class":1787},"orphans",[118,2403,92],{"class":566},[118,2405,842],{"class":2391},[118,2407,1796],{"class":694},[118,2409,2410],{"class":132}," orphan",[118,2412,1781],{"class":128},[118,2414,1756],{"class":1778},[118,2416,1711],{"class":566},[118,2418,2420,2422],{"class":120,"line":2419},35,[118,2421,1830],{"class":566},[118,2423,2303],{"class":2017},[118,2425,2427,2429,2432,2434,2437,2439,2441,2443],{"class":120,"line":2426},36,[118,2428,2309],{"class":566},[118,2430,2431],{"class":1745},"catch",[118,2433,1749],{"class":2017},[118,2435,2436],{"class":1691},"console",[118,2438,92],{"class":566},[118,2440,1201],{"class":1691},[118,2442,1756],{"class":2017},[118,2444,1711],{"class":566},[10,2446,2448],{"id":2447},"python-example","Python Example",[15,2450,2451],{},"The Agriculture equivalent, asking for three sections and the polygon, and reporting any section the source couldn't serve:",[109,2453,2457],{"className":2454,"code":2455,"language":2456,"meta":114,"style":114},"language-python shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","import os\n\nimport requests\n\nAPI_KEY = os.environ[\"TOWNSHIP_CANADA_API_KEY\"]\nBASE_URL = \"https:\u002F\u002Fdeveloper.townshipcanada.com\"\n\n\ndef ag_report(legal_location, include):\n    response = requests.get(\n        f\"{BASE_URL}\u002Fag\u002Freport\",\n        headers={\"X-API-Key\": API_KEY},\n        params={\"legal_location\": legal_location, \"include\": \",\".join(include)},\n        timeout=30,\n    )\n    if not response.ok:\n        error = response.json().get(\"error\", {})\n        raise RuntimeError(f\"HTTP {response.status_code} {error.get('code')}: {error.get('message')}\")\n    return response.json()\n\n\nreport = ag_report(\"NW-11-5-6-W2\", [\"productivity\", \"soil\", \"drought\", \"geometry\"])\n\nprint(report[\"resolved_legal_location\"], report[\"province\"])\nprint(\"LSRS:\", report[\"productivity\"][\"lsrs\"])\nprint(\"Soil order:\", report[\"soil\"][\"classification\"][\"order\"])\n\nfor gap in report[\"meta\"][\"unavailable\"]:\n    print(f\"Unavailable: {gap['section']} ({gap['reason']})\")\n","python",[19,2458,2459,2467,2471,2478,2482,2510,2522,2526,2530,2551,2570,2591,2612,2658,2670,2675,2691,2722,2796,2810,2814,2818,2873,2877,2910,2947,2992,2996,3028],{"__ignoreMap":114},[118,2460,2461,2464],{"class":120,"line":121},[118,2462,2463],{"class":1771},"import",[118,2465,2466],{"class":1082}," os\n",[118,2468,2469],{"class":120,"line":143},[118,2470,1734],{"emptyLinePlaceholder":1733},[118,2472,2473,2475],{"class":120,"line":592},[118,2474,2463],{"class":1771},[118,2476,2477],{"class":1082}," requests\n",[118,2479,2480],{"class":120,"line":613},[118,2481,1734],{"emptyLinePlaceholder":1733},[118,2483,2484,2487,2489,2492,2494,2498,2501,2503,2505,2507],{"class":120,"line":701},[118,2485,2486],{"class":139},"API_KEY",[118,2488,1695],{"class":566},[118,2490,2491],{"class":1082}," os",[118,2493,92],{"class":566},[118,2495,2497],{"class":2496},"sBPpx","environ",[118,2499,2500],{"class":566},"[",[118,2502,136],{"class":128},[118,2504,1708],{"class":132},[118,2506,136],{"class":128},[118,2508,2509],{"class":566},"]\n",[118,2511,2512,2514,2516,2518,2520],{"class":120,"line":715},[118,2513,1788],{"class":139},[118,2515,1695],{"class":566},[118,2517,129],{"class":128},[118,2519,102],{"class":132},[118,2521,155],{"class":128},[118,2523,2524],{"class":120,"line":732},[118,2525,1734],{"emptyLinePlaceholder":1733},[118,2527,2528],{"class":120,"line":748},[118,2529,1734],{"emptyLinePlaceholder":1733},[118,2531,2532,2535,2538,2540,2543,2545,2548],{"class":120,"line":764},[118,2533,2534],{"class":1687},"def",[118,2536,2537],{"class":1745}," ag_report",[118,2539,1749],{"class":566},[118,2541,187],{"class":2542},"sCyAa",[118,2544,642],{"class":566},[118,2546,2547],{"class":2542}," include",[118,2549,2550],{"class":566},"):\n",[118,2552,2553,2556,2559,2562,2564,2568],{"class":120,"line":784},[118,2554,2555],{"class":1082},"    response ",[118,2557,2558],{"class":566},"=",[118,2560,2561],{"class":1082}," requests",[118,2563,92],{"class":566},[118,2565,2567],{"class":2566},"siWMO","get",[118,2569,2001],{"class":566},[118,2571,2572,2575,2577,2581,2584,2586,2589],{"class":120,"line":817},[118,2573,2574],{"class":1687},"        f",[118,2576,136],{"class":132},[118,2578,2580],{"class":2579},"s3h35","{",[118,2582,1788],{"class":2583},"s6DHA",[118,2585,1796],{"class":2579},[118,2587,2588],{"class":132},"\u002Fag\u002Freport\"",[118,2590,589],{"class":566},[118,2592,2593,2596,2599,2601,2603,2605,2607,2609],{"class":120,"line":823},[118,2594,2595],{"class":1752},"        headers",[118,2597,2598],{"class":566},"={",[118,2600,136],{"class":128},[118,2602,106],{"class":132},[118,2604,136],{"class":128},[118,2606,449],{"class":566},[118,2608,1692],{"class":2583},[118,2610,2611],{"class":566},"},\n",[118,2613,2614,2617,2619,2621,2623,2625,2627,2630,2632,2634,2636,2638,2640,2642,2644,2646,2648,2651,2653,2655],{"class":120,"line":837},[118,2615,2616],{"class":1752},"        params",[118,2618,2598],{"class":566},[118,2620,136],{"class":128},[118,2622,187],{"class":132},[118,2624,136],{"class":128},[118,2626,449],{"class":566},[118,2628,2629],{"class":2566}," legal_location",[118,2631,642],{"class":566},[118,2633,129],{"class":128},[118,2635,311],{"class":132},[118,2637,136],{"class":128},[118,2639,449],{"class":566},[118,2641,129],{"class":128},[118,2643,642],{"class":132},[118,2645,136],{"class":128},[118,2647,92],{"class":566},[118,2649,2650],{"class":2566},"join",[118,2652,1749],{"class":566},[118,2654,311],{"class":2566},[118,2656,2657],{"class":566},")},\n",[118,2659,2660,2663,2665,2668],{"class":120,"line":858},[118,2661,2662],{"class":1752},"        timeout",[118,2664,2558],{"class":566},[118,2666,2667],{"class":638},"30",[118,2669,589],{"class":566},[118,2671,2672],{"class":120,"line":879},[118,2673,2674],{"class":566},"    )\n",[118,2676,2677,2679,2682,2684,2686,2688],{"class":120,"line":899},[118,2678,2214],{"class":1771},[118,2680,2681],{"class":1866}," not",[118,2683,1766],{"class":1082},[118,2685,92],{"class":566},[118,2687,1875],{"class":2496},[118,2689,2690],{"class":566},":\n",[118,2692,2693,2696,2698,2700,2702,2704,2707,2709,2711,2713,2715,2717,2719],{"class":120,"line":920},[118,2694,2695],{"class":1082},"        error ",[118,2697,2558],{"class":566},[118,2699,1766],{"class":1082},[118,2701,92],{"class":566},[118,2703,559],{"class":2566},[118,2705,2706],{"class":566},"().",[118,2708,2567],{"class":2566},[118,2710,1749],{"class":566},[118,2712,136],{"class":128},[118,2714,1201],{"class":132},[118,2716,136],{"class":128},[118,2718,642],{"class":566},[118,2720,2721],{"class":566}," {})\n",[118,2723,2724,2727,2730,2732,2735,2738,2740,2742,2744,2747,2749,2751,2753,2755,2757,2759,2762,2764,2766,2768,2770,2772,2774,2776,2778,2780,2782,2784,2786,2788,2790,2792,2794],{"class":120,"line":941},[118,2725,2726],{"class":1771},"        raise",[118,2728,2729],{"class":630}," RuntimeError",[118,2731,1749],{"class":566},[118,2733,2734],{"class":1687},"f",[118,2736,2737],{"class":132},"\"HTTP ",[118,2739,2580],{"class":2579},[118,2741,1870],{"class":2566},[118,2743,92],{"class":566},[118,2745,2746],{"class":2496},"status_code",[118,2748,1796],{"class":2579},[118,2750,625],{"class":2579},[118,2752,1201],{"class":2566},[118,2754,92],{"class":566},[118,2756,2567],{"class":2566},[118,2758,1749],{"class":566},[118,2760,2761],{"class":128},"'",[118,2763,19],{"class":132},[118,2765,2761],{"class":128},[118,2767,1756],{"class":566},[118,2769,1796],{"class":2579},[118,2771,1083],{"class":132},[118,2773,2580],{"class":2579},[118,2775,1201],{"class":2566},[118,2777,92],{"class":566},[118,2779,2567],{"class":2566},[118,2781,1749],{"class":566},[118,2783,2761],{"class":128},[118,2785,1233],{"class":132},[118,2787,2761],{"class":128},[118,2789,1756],{"class":566},[118,2791,1796],{"class":2579},[118,2793,136],{"class":132},[118,2795,2303],{"class":566},[118,2797,2798,2801,2803,2805,2807],{"class":120,"line":960},[118,2799,2800],{"class":1771},"    return",[118,2802,1766],{"class":1082},[118,2804,92],{"class":566},[118,2806,559],{"class":2566},[118,2808,2809],{"class":566},"()\n",[118,2811,2812],{"class":120,"line":965},[118,2813,1734],{"emptyLinePlaceholder":1733},[118,2815,2816],{"class":120,"line":1022},[118,2817,1734],{"emptyLinePlaceholder":1733},[118,2819,2820,2823,2825,2827,2829,2831,2833,2835,2837,2840,2842,2844,2846,2848,2850,2852,2854,2856,2858,2860,2862,2864,2866,2868,2870],{"class":120,"line":2085},[118,2821,2822],{"class":1082},"report ",[118,2824,2558],{"class":566},[118,2826,2537],{"class":2566},[118,2828,1749],{"class":566},[118,2830,136],{"class":128},[118,2832,21],{"class":132},[118,2834,136],{"class":128},[118,2836,642],{"class":566},[118,2838,2839],{"class":566}," [",[118,2841,136],{"class":128},[118,2843,250],{"class":132},[118,2845,136],{"class":128},[118,2847,642],{"class":566},[118,2849,129],{"class":128},[118,2851,258],{"class":132},[118,2853,136],{"class":128},[118,2855,642],{"class":566},[118,2857,129],{"class":128},[118,2859,264],{"class":132},[118,2861,136],{"class":128},[118,2863,642],{"class":566},[118,2865,129],{"class":128},[118,2867,345],{"class":132},[118,2869,136],{"class":128},[118,2871,2872],{"class":566},"])\n",[118,2874,2875],{"class":120,"line":2100},[118,2876,1734],{"emptyLinePlaceholder":1733},[118,2878,2879,2883,2885,2887,2889,2891,2893,2895,2898,2900,2902,2904,2906,2908],{"class":120,"line":2134},[118,2880,2882],{"class":2881},"sJdAF","print",[118,2884,1749],{"class":566},[118,2886,2047],{"class":2566},[118,2888,2500],{"class":566},[118,2890,136],{"class":128},[118,2892,191],{"class":132},[118,2894,136],{"class":128},[118,2896,2897],{"class":566},"],",[118,2899,1992],{"class":2566},[118,2901,2500],{"class":566},[118,2903,136],{"class":128},[118,2905,597],{"class":132},[118,2907,136],{"class":128},[118,2909,2872],{"class":566},[118,2911,2912,2914,2916,2918,2921,2923,2925,2927,2929,2931,2933,2935,2938,2940,2943,2945],{"class":120,"line":2185},[118,2913,2882],{"class":2881},[118,2915,1749],{"class":566},[118,2917,136],{"class":128},[118,2919,2920],{"class":132},"LSRS:",[118,2922,136],{"class":128},[118,2924,642],{"class":566},[118,2926,1992],{"class":2566},[118,2928,2500],{"class":566},[118,2930,136],{"class":128},[118,2932,250],{"class":132},[118,2934,136],{"class":128},[118,2936,2937],{"class":566},"][",[118,2939,136],{"class":128},[118,2941,2942],{"class":132},"lsrs",[118,2944,136],{"class":128},[118,2946,2872],{"class":566},[118,2948,2949,2951,2953,2955,2958,2960,2962,2964,2966,2968,2970,2972,2974,2976,2979,2981,2983,2985,2988,2990],{"class":120,"line":2211},[118,2950,2882],{"class":2881},[118,2952,1749],{"class":566},[118,2954,136],{"class":128},[118,2956,2957],{"class":132},"Soil order:",[118,2959,136],{"class":128},[118,2961,642],{"class":566},[118,2963,1992],{"class":2566},[118,2965,2500],{"class":566},[118,2967,136],{"class":128},[118,2969,258],{"class":132},[118,2971,136],{"class":128},[118,2973,2937],{"class":566},[118,2975,136],{"class":128},[118,2977,2978],{"class":132},"classification",[118,2980,136],{"class":128},[118,2982,2937],{"class":566},[118,2984,136],{"class":128},[118,2986,2987],{"class":132},"order",[118,2989,136],{"class":128},[118,2991,2872],{"class":566},[118,2993,2994],{"class":120,"line":2265},[118,2995,1734],{"emptyLinePlaceholder":1733},[118,2997,2998,3001,3004,3007,3009,3011,3013,3015,3017,3019,3021,3023,3025],{"class":120,"line":2270},[118,2999,3000],{"class":1771},"for",[118,3002,3003],{"class":1082}," gap ",[118,3005,3006],{"class":1771},"in",[118,3008,1992],{"class":1082},[118,3010,2500],{"class":566},[118,3012,136],{"class":128},[118,3014,970],{"class":132},[118,3016,136],{"class":128},[118,3018,2937],{"class":566},[118,3020,136],{"class":128},[118,3022,981],{"class":132},[118,3024,136],{"class":128},[118,3026,3027],{"class":566},"]:\n",[118,3029,3030,3033,3035,3037,3040,3042,3045,3047,3049,3051,3053,3056,3058,3060,3062,3064,3066,3068,3070,3072,3074,3076,3079],{"class":120,"line":2279},[118,3031,3032],{"class":2881},"    print",[118,3034,1749],{"class":566},[118,3036,2734],{"class":1687},[118,3038,3039],{"class":132},"\"Unavailable: ",[118,3041,2580],{"class":2579},[118,3043,3044],{"class":2566},"gap",[118,3046,2500],{"class":566},[118,3048,2761],{"class":128},[118,3050,1102],{"class":132},[118,3052,2761],{"class":128},[118,3054,3055],{"class":566},"]",[118,3057,1796],{"class":2579},[118,3059,1274],{"class":132},[118,3061,2580],{"class":2579},[118,3063,3044],{"class":2566},[118,3065,2500],{"class":566},[118,3067,2761],{"class":128},[118,3069,1119],{"class":132},[118,3071,2761],{"class":128},[118,3073,3055],{"class":566},[118,3075,1796],{"class":2579},[118,3077,3078],{"class":132},")\"",[118,3080,2303],{"class":566},[10,3082,3084],{"id":3083},"vector-tiles","Vector Tiles",[15,3086,3087,3088,3091,3092,3095],{},"The same data renders as Mapbox Vector Tiles from ",[19,3089,3090],{},"maps.townshipcanada.com",", authenticated with an ",[19,3093,3094],{},"api_key"," query parameter:",[109,3097,3102],{"className":3098,"code":3100,"language":3101},[3099],"language-text","https:\u002F\u002Fmaps.townshipcanada.com\u002Fag\u002F{archive}\u002F{z}\u002F{x}\u002F{y}.mvt?api_key=YOUR_API_KEY\nhttps:\u002F\u002Fmaps.townshipcanada.com\u002Fenergy\u002F{archive}\u002F{z}\u002F{x}\u002F{y}.mvt?api_key=YOUR_API_KEY\nhttps:\u002F\u002Fmaps.townshipcanada.com\u002Fenergy\u002F{archive}.json?api_key=YOUR_API_KEY   (TileJSON)\n","text",[19,3103,3100],{"__ignoreMap":114},[15,3105,3106,3107,92],{},"The tiles are their own products, the Ag Maps API (18 archives: soils, capability, crop rotation, Crown land, pastures, the ALR) and the Energy Maps API (12 archives: wells, pipelines, facilities, production, tenure), with their own keys. An archive outside your product returns ",[19,3108,3109],{},"403",[15,3111,3112],{},"Three things trip people up:",[3114,3115,3116,3139,3166],"ol",{},[46,3117,3118,3124,3125,3128,3129,3132,3133,1481,3136,92],{},[64,3119,3120,3123],{},[19,3121,3122],{},"source-layer"," is not always the archive name."," ",[19,3126,3127],{},"ag_summary_qs"," carries layer ",[19,3130,3131],{},"ag_summary","; ",[19,3134,3135],{},"og_activity_lsd",[19,3137,3138],{},"og_activity",[46,3140,3141,3124,3144,255,3146,255,3149,255,3152,274,3154,3157,3158,3161,3162,3165],{},[64,3142,3143],{},"Rollups are zoom-banded.",[19,3145,3131],{},[19,3147,3148],{},"aafc_crop_summary",[19,3150,3151],{},"lsrs_productivity",[19,3153,3138],{},[19,3155,3156],{},"lsd_production_12mo"," each ship as three archives: ",[19,3159,3160],{},"_twp"," (z0-6), ",[19,3163,3164],{},"_sec"," (z6-9) and the base archive (z9+). Add all three as sources, or the map is empty below z9.",[46,3167,3168,1274,3171,3174,3175,3177],{},[64,3169,3170],{},"Labels are separate archives",[19,3172,3173],{},"_labels","), except ",[19,3176,293],{},", which carries both.",[15,3179,3180],{},"In a MapLibre or Mapbox style, the Energy well-activity family looks like this:",[109,3182,3184],{"className":557,"code":3183,"language":559,"meta":114,"style":114},"\"sources\": {\n  \"og-activity-twp\": { \"type\": \"vector\", \"minzoom\": 0, \"maxzoom\": 6,\n    \"tiles\": [\"https:\u002F\u002Fmaps.townshipcanada.com\u002Fenergy\u002Fog_activity_twp\u002F{z}\u002F{x}\u002F{y}.mvt?api_key=YOUR_API_KEY\"] },\n  \"og-activity-sec\": { \"type\": \"vector\", \"minzoom\": 6, \"maxzoom\": 9,\n    \"tiles\": [\"https:\u002F\u002Fmaps.townshipcanada.com\u002Fenergy\u002Fog_activity_sec\u002F{z}\u002F{x}\u002F{y}.mvt?api_key=YOUR_API_KEY\"] },\n  \"og-activity-lsd\": { \"type\": \"vector\", \"minzoom\": 9, \"maxzoom\": 14,\n    \"tiles\": [\"https:\u002F\u002Fmaps.townshipcanada.com\u002Fenergy\u002Fog_activity_lsd\u002F{z}\u002F{x}\u002F{y}.mvt?api_key=YOUR_API_KEY\"] }\n}\n",[19,3185,3186,3198,3256,3280,3334,3357,3411,3434],{"__ignoreMap":114},[118,3187,3188,3190,3192,3194,3196],{"class":120,"line":121},[118,3189,136],{"class":128},[118,3191,993],{"class":132},[118,3193,136],{"class":128},[118,3195,1083],{"class":1082},[118,3197,567],{"class":566},[118,3199,3200,3202,3205,3207,3209,3211,3213,3215,3217,3219,3221,3224,3226,3228,3230,3233,3235,3237,3240,3242,3244,3247,3249,3251,3254],{"class":120,"line":143},[118,3201,573],{"class":572},[118,3203,3204],{"class":576},"og-activity-twp",[118,3206,136],{"class":572},[118,3208,449],{"class":566},[118,3210,625],{"class":566},[118,3212,129],{"class":572},[118,3214,1599],{"class":630},[118,3216,136],{"class":572},[118,3218,449],{"class":566},[118,3220,129],{"class":128},[118,3222,3223],{"class":132},"vector",[118,3225,136],{"class":128},[118,3227,642],{"class":566},[118,3229,129],{"class":572},[118,3231,3232],{"class":630},"minzoom",[118,3234,136],{"class":572},[118,3236,449],{"class":566},[118,3238,3239],{"class":638}," 0",[118,3241,642],{"class":566},[118,3243,129],{"class":572},[118,3245,3246],{"class":630},"maxzoom",[118,3248,136],{"class":572},[118,3250,449],{"class":566},[118,3252,3253],{"class":638}," 6",[118,3255,589],{"class":566},[118,3257,3258,3260,3263,3265,3267,3269,3271,3274,3276,3278],{"class":120,"line":592},[118,3259,718],{"class":572},[118,3261,3262],{"class":630},"tiles",[118,3264,136],{"class":572},[118,3266,449],{"class":566},[118,3268,2839],{"class":566},[118,3270,136],{"class":128},[118,3272,3273],{"class":132},"https:\u002F\u002Fmaps.townshipcanada.com\u002Fenergy\u002Fog_activity_twp\u002F{z}\u002F{x}\u002F{y}.mvt?api_key=YOUR_API_KEY",[118,3275,136],{"class":128},[118,3277,3055],{"class":566},[118,3279,698],{"class":566},[118,3281,3282,3284,3287,3289,3291,3293,3295,3297,3299,3301,3303,3305,3307,3309,3311,3313,3315,3317,3319,3321,3323,3325,3327,3329,3332],{"class":120,"line":613},[118,3283,573],{"class":572},[118,3285,3286],{"class":576},"og-activity-sec",[118,3288,136],{"class":572},[118,3290,449],{"class":566},[118,3292,625],{"class":566},[118,3294,129],{"class":572},[118,3296,1599],{"class":630},[118,3298,136],{"class":572},[118,3300,449],{"class":566},[118,3302,129],{"class":128},[118,3304,3223],{"class":132},[118,3306,136],{"class":128},[118,3308,642],{"class":566},[118,3310,129],{"class":572},[118,3312,3232],{"class":630},[118,3314,136],{"class":572},[118,3316,449],{"class":566},[118,3318,3253],{"class":638},[118,3320,642],{"class":566},[118,3322,129],{"class":572},[118,3324,3246],{"class":630},[118,3326,136],{"class":572},[118,3328,449],{"class":566},[118,3330,3331],{"class":638}," 9",[118,3333,589],{"class":566},[118,3335,3336,3338,3340,3342,3344,3346,3348,3351,3353,3355],{"class":120,"line":701},[118,3337,718],{"class":572},[118,3339,3262],{"class":630},[118,3341,136],{"class":572},[118,3343,449],{"class":566},[118,3345,2839],{"class":566},[118,3347,136],{"class":128},[118,3349,3350],{"class":132},"https:\u002F\u002Fmaps.townshipcanada.com\u002Fenergy\u002Fog_activity_sec\u002F{z}\u002F{x}\u002F{y}.mvt?api_key=YOUR_API_KEY",[118,3352,136],{"class":128},[118,3354,3055],{"class":566},[118,3356,698],{"class":566},[118,3358,3359,3361,3364,3366,3368,3370,3372,3374,3376,3378,3380,3382,3384,3386,3388,3390,3392,3394,3396,3398,3400,3402,3404,3406,3409],{"class":120,"line":715},[118,3360,573],{"class":572},[118,3362,3363],{"class":576},"og-activity-lsd",[118,3365,136],{"class":572},[118,3367,449],{"class":566},[118,3369,625],{"class":566},[118,3371,129],{"class":572},[118,3373,1599],{"class":630},[118,3375,136],{"class":572},[118,3377,449],{"class":566},[118,3379,129],{"class":128},[118,3381,3223],{"class":132},[118,3383,136],{"class":128},[118,3385,642],{"class":566},[118,3387,129],{"class":572},[118,3389,3232],{"class":630},[118,3391,136],{"class":572},[118,3393,449],{"class":566},[118,3395,3331],{"class":638},[118,3397,642],{"class":566},[118,3399,129],{"class":572},[118,3401,3246],{"class":630},[118,3403,136],{"class":572},[118,3405,449],{"class":566},[118,3407,3408],{"class":638}," 14",[118,3410,589],{"class":566},[118,3412,3413,3415,3417,3419,3421,3423,3425,3428,3430,3432],{"class":120,"line":732},[118,3414,718],{"class":572},[118,3416,3262],{"class":630},[118,3418,136],{"class":572},[118,3420,449],{"class":566},[118,3422,2839],{"class":566},[118,3424,136],{"class":128},[118,3426,3427],{"class":132},"https:\u002F\u002Fmaps.townshipcanada.com\u002Fenergy\u002Fog_activity_lsd\u002F{z}\u002F{x}\u002F{y}.mvt?api_key=YOUR_API_KEY",[118,3429,136],{"class":128},[118,3431,3055],{"class":566},[118,3433,1019],{"class":566},[118,3435,3436],{"class":120,"line":748},[118,3437,1025],{"class":566},[15,3439,3440,3441,274,3444,3447,3448,92],{},"The full archive tables are in the ",[50,3442,183],{"href":3443},"\u002Fapi\u002Fdocs\u002Fagriculture",[50,3445,209],{"href":3446},"\u002Fapi\u002Fdocs\u002Fenergy"," references. For the survey grid underneath, see the ",[50,3449,3451],{"href":3450},"\u002Fguides\u002Fmaps-api-vector-tiles","Maps API vector tile reference",[10,3453,3455],{"id":3454},"rate-limiting","Rate Limiting",[367,3457,3458,3471],{},[370,3459,3460],{},[373,3461,3462,3465,3468],{},[376,3463,3464],{},"Plan",[376,3466,3467],{},"Requests\u002Fmonth",[376,3469,3470],{},"Rate limit",[386,3472,3473,3484,3495,3506],{},[373,3474,3475,3478,3481],{},[391,3476,3477],{},"Developer",[391,3479,3480],{},"25",[391,3482,3483],{},"1 req\u002Fsec",[373,3485,3486,3489,3492],{},[391,3487,3488],{},"Professional",[391,3490,3491],{},"250",[391,3493,3494],{},"2 req\u002Fsec",[373,3496,3497,3500,3503],{},[391,3498,3499],{},"Business",[391,3501,3502],{},"1,000",[391,3504,3505],{},"5 req\u002Fsec",[373,3507,3508,3511,3514],{},[391,3509,3510],{},"Enterprise",[391,3512,3513],{},"Custom",[391,3515,3513],{},[15,3517,3518],{},"The volumes are the same for the single and combined products. Every call counts: a full report, a section endpoint, a collection page and a cross-parcel lookup each use one request. Allowances are hard stops with no overage.",[15,3520,3521,3522,3524],{},"On ",[19,3523,1283],{},", back off and retry with exponential delay and a retry cap. A monthly allowance is separate from throttling, so check usage before retrying repeatedly.",[10,3526,3528],{"id":3527},"no-batch-or-autocomplete-here","No Batch or Autocomplete Here",[15,3530,3531],{},"These APIs answer one parcel per request. They don't accept arrays of locations and don't offer type-ahead. For those, use the core APIs:",[43,3533,3534,3549],{},[46,3535,3536,3537,1274,3541,3545,3546,3548],{},"To resolve a spreadsheet of descriptions or coordinates first, use the ",[50,3538,3540],{"href":3539},"\u002Fapi\u002Fdocs\u002Fbatch","Batch API",[50,3542,3544],{"href":3543},"\u002Fguides\u002Fbatch-api-guide","guide","), then call ",[19,3547,32],{}," per parcel within your rate limit.",[46,3550,3551,3552,92],{},"For type-ahead input, use ",[50,3553,3555],{"href":3554},"\u002Fapi\u002Fdocs\u002Fsearch","Search and Autocomplete",[15,3557,3558],{},"Batch Agriculture and Energy enrichment of large parcel lists is available on Enterprise.",[10,3560,3562],{"id":3561},"faq","FAQ",[301,3564,3566],{"id":3565},"is-there-an-aer-wells-api-by-legal-land-description","Is there an AER wells API by legal land description?",[15,3568,3569,3570,3573],{},"Yes. ",[19,3571,3572],{},"GET \u002Fenergy\u002Fwells?legal_location=7-10-13-9-W4"," returns every well on that LSD, with UWI, licence number, derived status, operator, fluid and total depth. In Alberta the rows come from AER data.",[301,3575,3577],{"id":3576},"can-i-get-farmland-soil-data-from-an-api","Can I get farmland soil data from an API?",[15,3579,3569,3580,3583,3584,3586],{},[19,3581,3582],{},"GET \u002Fag\u002Fsoil?legal_location=NW-11-5-6-W2"," returns soil classification, drainage and slope for the quarter section. ",[19,3585,457],{}," adds LSRS and CLI capability.",[301,3588,3590],{"id":3589},"do-i-need-separate-keys-for-agriculture-and-energy","Do I need separate keys for Agriculture and Energy?",[15,3592,3593,3594,274,3596,3598],{},"Not if you subscribe to Agriculture + Energy: one key works on both ",[19,3595,70],{},[19,3597,77],{},". The vector tiles are separate products with their own keys.",[301,3600,3602,3603,3605],{"id":3601},"why-is-a-section-null","Why is a section ",[19,3604,360],{},"?",[15,3607,3608,3609,3611,3612,3614],{},"Either the parcel has no data for it, or the source couldn't serve it. Check ",[19,3610,216],{},": an entry there with ",[19,3613,1065],{}," means the province doesn't publish that layer.",[301,3616,3618],{"id":3617},"does-the-api-cover-british-columbia","Does the API cover British Columbia?",[15,3620,3621,3622,92],{},"Not yet. BC (NTS) locations return ",[19,3623,3624],{},"400 bc_not_supported",[3626,3627,3628],"style",{},"html pre.shiki code .sYn-s, html code.shiki .sYn-s{--shiki-light:#E2931D;--shiki-default:#59873A;--shiki-dark:#80A665}html pre.shiki code .sbYkP, html code.shiki .sbYkP{--shiki-light:#39ADB5;--shiki-default:#B5695977;--shiki-dark:#C98A7D77}html pre.shiki code .sTbE_, html code.shiki .sTbE_{--shiki-light:#91B859;--shiki-default:#B56959;--shiki-dark:#C98A7D}html pre.shiki code .se3Ec, html code.shiki .se3Ec{--shiki-light:#90A4AE;--shiki-default:#A65E2B;--shiki-dark:#C99076}html pre.shiki code .sz9Cv, html code.shiki .sz9Cv{--shiki-light:#91B859;--shiki-default:#A65E2B;--shiki-dark:#C99076}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .soVBu, html code.shiki .soVBu{--shiki-light:#39ADB5;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .s4Jsk, html code.shiki .s4Jsk{--shiki-light:#39ADB5;--shiki-default:#99841877;--shiki-dark:#B8A96577}html pre.shiki code .sLorS, html code.shiki .sLorS{--shiki-light:#9C3EDA;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .sa2tF, html code.shiki .sa2tF{--shiki-light:#E2931D;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .s7CZa, html code.shiki .s7CZa{--shiki-light:#F76D47;--shiki-default:#2F798A;--shiki-dark:#4C9A91}html pre.shiki code .skNjk, html code.shiki .skNjk{--shiki-light:#F76D47;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .s8XtY, html code.shiki .s8XtY{--shiki-light:#39ADB5;--shiki-default:#1E754F;--shiki-dark:#4D9375}html pre.shiki code .sftqT, html code.shiki .sftqT{--shiki-light:#90A4AE;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .s5Kfy, html code.shiki .s5Kfy{--shiki-light:#9C3EDA;--shiki-default:#AB5959;--shiki-dark:#CB7676}html pre.shiki code .sSC40, html code.shiki .sSC40{--shiki-light:#90A4AE;--shiki-default:#B07D48;--shiki-dark:#BD976A}html pre.shiki code .sljsM, html code.shiki .sljsM{--shiki-light:#6182B8;--shiki-default:#59873A;--shiki-dark:#80A665}html pre.shiki code .sqOPj, html code.shiki .sqOPj{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#B07D48;--shiki-default-font-style:inherit;--shiki-dark:#BD976A;--shiki-dark-font-style:inherit}html pre.shiki code .siDh9, html code.shiki .siDh9{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#1E754F;--shiki-default-font-style:inherit;--shiki-dark:#4D9375;--shiki-dark-font-style:inherit}html pre.shiki code .sLdnO, html code.shiki .sLdnO{--shiki-light:#E53935;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .su_V2, html code.shiki .su_V2{--shiki-light:#90A4AE;--shiki-default:#B56959;--shiki-dark:#C98A7D}html pre.shiki code .suXOh, html code.shiki .suXOh{--shiki-light:#E53935;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .sQtxO, html code.shiki .sQtxO{--shiki-light:#E53935;--shiki-default:#B56959;--shiki-dark:#C98A7D}html pre.shiki code .sVsLi, html code.shiki .sVsLi{--shiki-light:#39ADB5;--shiki-default:#AB5959;--shiki-dark:#CB7676}html pre.shiki code .snCua, html code.shiki .snCua{--shiki-light:#90A4AE;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .s9Tkl, html code.shiki .s9Tkl{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#A0ADA0;--shiki-default-font-style:inherit;--shiki-dark:#758575DD;--shiki-dark-font-style:inherit}html pre.shiki code .sIOqK, html code.shiki .sIOqK{--shiki-light:#9C3EDA;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .s131V, html code.shiki .s131V{--shiki-light:#90A4AE;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .sBPpx, html code.shiki .sBPpx{--shiki-light:#E53935;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .sCyAa, html code.shiki .sCyAa{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#393A34;--shiki-default-font-style:inherit;--shiki-dark:#DBD7CAEE;--shiki-dark-font-style:inherit}html pre.shiki code .siWMO, html code.shiki .siWMO{--shiki-light:#6182B8;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .s3h35, html code.shiki .s3h35{--shiki-light:#F76D47;--shiki-default:#A65E2B;--shiki-dark:#C99076}html pre.shiki code .s6DHA, html code.shiki .s6DHA{--shiki-light:#6182B8;--shiki-default:#A65E2B;--shiki-dark:#C99076}html pre.shiki code .sJdAF, html code.shiki .sJdAF{--shiki-light:#6182B8;--shiki-default:#998418;--shiki-dark:#B8A965}",{"title":114,"searchDepth":143,"depth":143,"links":3630},[3631,3632,3633,3634,3635,3640,3641,3642,3643,3644,3645,3646,3647,3648],{"id":12,"depth":143,"text":13},{"id":40,"depth":143,"text":41},{"id":95,"depth":143,"text":96},{"id":165,"depth":143,"text":166},{"id":219,"depth":143,"text":220,"children":3636},[3637,3639],{"id":303,"depth":592,"text":3638},"Request only what you need with include=",{"id":439,"depth":592,"text":440},{"id":521,"depth":143,"text":522},{"id":1304,"depth":143,"text":1305},{"id":1530,"depth":143,"text":1531},{"id":1668,"depth":143,"text":1669},{"id":2447,"depth":143,"text":2448},{"id":3083,"depth":143,"text":3084},{"id":3454,"depth":143,"text":3455},{"id":3527,"depth":143,"text":3528},{"id":3561,"depth":143,"text":3562,"children":3649},[3650,3651,3652,3653,3655],{"id":3565,"depth":592,"text":3566},{"id":3576,"depth":592,"text":3577},{"id":3589,"depth":592,"text":3590},{"id":3601,"depth":592,"text":3654},"Why is a section null?",{"id":3617,"depth":592,"text":3618},"api","Query AER wells, pipelines, Crown tenure, soil and crop data by Canadian legal land description. Reports, filters, paging and vector tiles.",false,"md","i-lucide-braces",{},"\u002Fguides\u002Fagriculture-energy-api-guide",{"title":5,"description":3657},"guides\u002Fagriculture-energy-api-guide","UHq4ywo-yz-wULzqybNO89kXugsJxrK0ErDwwTwZQ0I",[3667,4125,4994],{"id":3668,"title":3669,"body":3670,"category":3656,"description":4118,"draft":3658,"extension":3659,"icon":4119,"meta":4120,"navigation":1733,"order":121,"path":4121,"seo":4122,"stem":4123,"__hash__":4124},"guides\u002Fguides\u002Fapi-integration.md","Legal Land Description API Integration Guide",{"type":7,"value":3671,"toc":4083},[3672,3675,3681,3685,3712,3718,3722,3725,3729,3732,3738,3742,3745,3750,3753,3756,3761,3765,3768,3773,3777,3784,3789,3837,3842,3881,3884,3888,3892,3895,3899,3902,3906,3909,3913,3916,3920,3923,3927,3968,3972,3978,3998,4002,4005,4008,4011,4015,4018,4022,4025,4029,4039,4043,4075],[15,3673,3674],{},"Integrate Township Canada's legal land description services directly into your applications and workflows. Our REST APIs enable LLD-to-coordinate conversion, autocomplete search, batch processing, and interactive grid maps-all with simple JSON responses.",[15,3676,3677],{},[241,3678],{"alt":3679,"src":3680},"Developer Portal","\u002Fimages\u002Fguides\u002Fapi-portal.webp",[10,3682,3684],{"id":3683},"quick-start","Quick start",[3686,3687,3688,3692,3698,3702,3705,3709],"steps",{},[301,3689,3691],{"id":3690},"get-an-api-key","Get an API key",[15,3693,3694,3695,3697],{},"Log into your Township Canada account and go to ",[64,3696,378],{}," in the main navigation. Subscribe to an API endpoint and create your first API key.",[301,3699,3701],{"id":3700},"make-your-first-request","Make your first request",[15,3703,3704],{},"Add your API key to the request header and make a test request.",[301,3706,3708],{"id":3707},"parse-the-response","Parse the response",[15,3710,3711],{},"All APIs return JSON with coordinates, legal descriptions, and metadata.",[15,3713,3714,3715,92],{},"For full documentation and code examples, visit the ",[50,3716,3717],{"href":52},"API documentation",[10,3719,3721],{"id":3720},"api-endpoints","API endpoints",[15,3723,3724],{},"Township Canada offers four distinct API endpoints:",[301,3726,3728],{"id":3727},"search-api","Search API",[15,3730,3731],{},"Convert legal land descriptions to geographic coordinates and vice versa. Supports DLS, NTS, Geographic Townships, and FPS formats.",[15,3733,3734,3737],{},[64,3735,3736],{},"Use cases",": Property lookup, coordinate conversion, reverse geocoding",[301,3739,3741],{"id":3740},"autocomplete-api","Autocomplete API",[15,3743,3744],{},"Search legal land descriptions with partial text. Returns up to 10 matching results with coordinates-ideal for search boxes and type-ahead interfaces.",[15,3746,3747,3749],{},[64,3748,3736],{},": Search boxes, type-ahead, field validation",[301,3751,3540],{"id":3752},"batch-api",[15,3754,3755],{},"Process up to 100 records per request. Convert lists of legal land descriptions to coordinates or coordinates to legal land descriptions.",[15,3757,3758,3760],{},[64,3759,3736],{},": Bulk data processing, migration, spatial analysis",[301,3762,3764],{"id":3763},"maps-api","Maps API",[15,3766,3767],{},"Display legal survey grids on maps in your web or mobile applications. Vector tiles format compatible with Mapbox GL, Leaflet, and other mapping libraries.",[15,3769,3770,3772],{},[64,3771,3736],{},": Custom mapping applications, data visualization",[10,3774,3776],{"id":3775},"api-pricing-tiers","API pricing tiers",[15,3778,3779,3780,3783],{},"Each API offers three pricing tiers. See the ",[50,3781,3782],{"href":52},"API pricing page"," for current prices.",[15,3785,3786],{},[64,3787,3788],{},"Search, Autocomplete & Batch APIs",[367,3790,3791,3804],{},[370,3792,3793],{},[373,3794,3795,3798,3801],{},[376,3796,3797],{},"Tier",[376,3799,3800],{},"Monthly Requests",[376,3802,3803],{},"Rate Limit",[386,3805,3806,3816,3827],{},[373,3807,3808,3811,3813],{},[391,3809,3810],{},"Build",[391,3812,3502],{},[391,3814,3815],{},"1\u002Fsec",[373,3817,3818,3821,3824],{},[391,3819,3820],{},"Scale",[391,3822,3823],{},"10,000",[391,3825,3826],{},"5\u002Fsec",[373,3828,3829,3831,3834],{},[391,3830,3510],{},[391,3832,3833],{},"100,000",[391,3835,3836],{},"25\u002Fsec",[15,3838,3839,3841],{},[64,3840,3764],{}," (higher request quotas for tile rendering)",[367,3843,3844,3854],{},[370,3845,3846],{},[373,3847,3848,3850,3852],{},[376,3849,3797],{},[376,3851,3800],{},[376,3853,3803],{},[386,3855,3856,3864,3872],{},[373,3857,3858,3860,3862],{},[391,3859,3810],{},[391,3861,3823],{},[391,3863,3815],{},[373,3865,3866,3868,3870],{},[391,3867,3820],{},[391,3869,3833],{},[391,3871,3826],{},[373,3873,3874,3876,3879],{},[391,3875,3510],{},[391,3877,3878],{},"1,000,000",[391,3880,3836],{},[15,3882,3883],{},"Annual billing saves two months compared to monthly billing.",[10,3885,3887],{"id":3886},"common-integration-patterns","Common integration patterns",[301,3889,3891],{"id":3890},"real-estate-applications","Real Estate Applications",[15,3893,3894],{},"Add legal land description lookup to property search interfaces. Use the Autocomplete API for type-ahead search and the Search API for coordinate conversion.",[301,3896,3898],{"id":3897},"oil-gas-software","Oil & Gas Software",[15,3900,3901],{},"Integrate batch conversion for well location management. Use the Maps API to display DLS\u002FNTS grids in custom mapping applications.",[301,3903,3905],{"id":3904},"mobile-field-apps","Mobile Field Apps",[15,3907,3908],{},"Add LLD search and coordinate conversion for field workers. The APIs work with any mobile development framework (React Native, Flutter, native iOS\u002FAndroid).",[301,3910,3912],{"id":3911},"gis-platforms","GIS Platforms",[15,3914,3915],{},"Enhance ArcGIS, QGIS, or custom GIS tools with legal land description support. Batch API enables bulk coordinate conversion for spatial analysis.",[301,3917,3919],{"id":3918},"agriculture-technology","Agriculture Technology",[15,3921,3922],{},"Add quarter section and LSD lookup to farm management software. Combine with soil and boundary data for precision agriculture applications.",[10,3924,3926],{"id":3925},"getting-an-api-key","Getting an API key",[3686,3928,3929,3933,3939,3943,3946,3950,3957,3961],{},[301,3930,3932],{"id":3931},"open-the-developer-portal","Open the Developer Portal",[15,3934,3935,3936,3938],{},"Go to ",[64,3937,378],{}," in the main navigation to access the Developer Portal.",[301,3940,3942],{"id":3941},"subscribe-to-an-api","Subscribe to an API",[15,3944,3945],{},"Click on the API you want to use (Search, Autocomplete, Batch, or Maps). Select a tier and complete payment.",[301,3947,3949],{"id":3948},"create-an-api-key","Create an API key",[15,3951,3952,3953,3956],{},"Click ",[64,3954,3955],{},"+ Add Key"," and give your key a descriptive name. Copy the key immediately-it won't be shown again.",[301,3958,3960],{"id":3959},"use-your-key","Use your key",[15,3962,3963,3964,3967],{},"Include the API key in the ",[19,3965,3966],{},"x-api-key"," header for all requests.",[10,3969,3971],{"id":3970},"managing-api-subscriptions","Managing API subscriptions",[15,3973,3974,3975,3977],{},"Manage your API subscriptions from the ",[64,3976,378],{}," page in the main navigation. The Developer Portal provides:",[43,3979,3980,3986,3992],{},[46,3981,3982,3985],{},[64,3983,3984],{},"Overview",": View all your API keys and subscriptions",[46,3987,3988,3991],{},[64,3989,3990],{},"Logs",": Monitor API requests with timestamps and response codes",[46,3993,3994,3997],{},[64,3995,3996],{},"Alerts",": Configure usage threshold notifications",[301,3999,4001],{"id":4000},"usage-monitoring","Usage monitoring",[15,4003,4004],{},"Track your API usage in real-time from the Overview tab. Usage resets at the start of each billing period.",[301,4006,4007],{"id":3454},"Rate limiting",[15,4009,4010],{},"Exceeding your rate limit results in HTTP 429 Too Many Requests responses. Implement exponential backoff in your integration to handle rate limits gracefully.",[301,4012,4014],{"id":4013},"quota-management","Quota management",[15,4016,4017],{},"When you reach your monthly quota, requests return HTTP 429 until the next billing cycle. Upgrade your tier for higher quotas or implement caching to reduce request volume.",[10,4019,4021],{"id":4020},"code-examples","Code examples",[15,4023,4024],{},"Access code examples in JavaScript, Python, and cURL from the Developer Portal. Each API endpoint includes ready-to-use code snippets you can copy and customize.",[10,4026,4028],{"id":4027},"checking-system-health","Checking system health",[15,4030,4031,4032,4038],{},"For the current status of Township Canada's APIs, including uptime, response time, and incident history, visit ",[50,4033,4037],{"href":4034,"rel":4035},"https:\u002F\u002Fstatus.townshipcanada.com",[4036],"nofollow","status.townshipcanada.com",". This site provides real-time updates on API system health.",[10,4040,4042],{"id":4041},"related-guides","Related guides",[43,4044,4045,4052,4059,4066],{},[46,4046,4047,4051],{},[50,4048,4050],{"href":4049},"\u002Fguides\u002Faccount-management","Account Management"," - Manage billing for API subscriptions",[46,4053,4054,4058],{},[50,4055,4057],{"href":4056},"\u002Fguides\u002Fbatch-conversion","Batch Conversion"," - Web interface for batch processing",[46,4060,4061,4065],{},[50,4062,4064],{"href":4063},"\u002Fguides\u002Fmap","Interactive Maps"," - Map features available through the Maps API",[46,4067,4068,4074],{},[50,4069,4071],{"href":4070},"\u002Fblog\u002Ftownshipcanada-sdk-typescript-npm-package",[19,4072,4073],{},"townshipcanada"," - Official TypeScript SDK for Node.js developers",[15,4076,4077,4078,4082],{},"Need help with your integration? ",[50,4079,4081],{"href":4080},"\u002Fcontact-us","Contact us"," for technical support and custom API solutions.",{"title":114,"searchDepth":143,"depth":143,"links":4084},[4085,4090,4096,4097,4104,4110,4115,4116,4117],{"id":3683,"depth":143,"text":3684,"children":4086},[4087,4088,4089],{"id":3690,"depth":592,"text":3691},{"id":3700,"depth":592,"text":3701},{"id":3707,"depth":592,"text":3708},{"id":3720,"depth":143,"text":3721,"children":4091},[4092,4093,4094,4095],{"id":3727,"depth":592,"text":3728},{"id":3740,"depth":592,"text":3741},{"id":3752,"depth":592,"text":3540},{"id":3763,"depth":592,"text":3764},{"id":3775,"depth":143,"text":3776},{"id":3886,"depth":143,"text":3887,"children":4098},[4099,4100,4101,4102,4103],{"id":3890,"depth":592,"text":3891},{"id":3897,"depth":592,"text":3898},{"id":3904,"depth":592,"text":3905},{"id":3911,"depth":592,"text":3912},{"id":3918,"depth":592,"text":3919},{"id":3925,"depth":143,"text":3926,"children":4105},[4106,4107,4108,4109],{"id":3931,"depth":592,"text":3932},{"id":3941,"depth":592,"text":3942},{"id":3948,"depth":592,"text":3949},{"id":3959,"depth":592,"text":3960},{"id":3970,"depth":143,"text":3971,"children":4111},[4112,4113,4114],{"id":4000,"depth":592,"text":4001},{"id":3454,"depth":592,"text":4007},{"id":4013,"depth":592,"text":4014},{"id":4020,"depth":143,"text":4021},{"id":4027,"depth":143,"text":4028},{"id":4041,"depth":143,"text":4042},"Integrate legal land description APIs into your applications. Convert LLDs to coordinates, add autocomplete search, process batch records, and display DLS\u002FNTS grid maps. REST API with JSON responses.","i-lucide-code",{},"\u002Fguides\u002Fapi-integration",{"title":3669,"description":4118},"guides\u002Fapi-integration","WA7Jyw47YZZa52v9jY_hjpq25eq9Z9vRfgor8JTCZU4",{"id":4126,"title":4127,"body":4128,"category":3656,"description":4988,"draft":3658,"extension":3659,"icon":4989,"meta":4990,"navigation":1733,"order":817,"path":90,"seo":4991,"stem":4992,"__hash__":4993},"guides\u002Fguides\u002Fapi-key-management.md","Managing API Keys for Development, Staging, and Production",{"type":7,"value":4129,"toc":4972},[4130,4133,4139,4142,4146,4153,4175,4178,4184,4188,4191,4197,4200,4264,4267,4271,4274,4278,4285,4299,4302,4416,4419,4458,4461,4466,4478,4484,4636,4640,4649,4674,4681,4700,4704,4707,4733,4736,4740,4743,4747,4750,4774,4777,4872,4875,4879,4882,4885,4888,4892,4895,4910,4916,4922,4928,4934,4936,4969],[15,4131,4132],{},"Most API integrations span multiple environments-local development, a staging server, and production. Using a single API key across all three creates problems: one accidental revocation takes everything down, you can't track which environment is generating traffic, and debugging becomes harder when all requests look identical in the logs.",[15,4134,4135],{},[241,4136],{"alt":4137,"src":4138},"The Developer Portal overview with usage for the period and the API keys table showing name, masked key, tier, usage, and actions","\u002Fimages\u002Fguides\u002Fapi-key-management.webp",[15,4140,4141],{},"Township Canada lets you create unlimited API keys on paid plans. The recommended approach is one key per environment, per project.",[10,4143,4145],{"id":4144},"creating-api-keys","Creating API keys",[15,4147,4148,4149,4152],{},"API keys are managed from the ",[50,4150,3679],{"href":4151},"\u002Fapp\u002Fapi",". To create a new key:",[3114,4154,4155,4160,4164,4167,4172],{},[46,4156,3935,4157,4159],{},[64,4158,378],{}," in the main navigation",[46,4161,3952,4162],{},[64,4163,3955],{},[46,4165,4166],{},"Enter a descriptive name (see naming conventions below)",[46,4168,3952,4169],{},[64,4170,4171],{},"Create",[46,4173,4174],{},"Copy the key immediately - it will not be shown again",[15,4176,4177],{},"Each key displays its name, creation date, and last-used timestamp. Keys can be revoked individually without affecting any other key on your account.",[4179,4180,4181],"warning",{},[15,4182,4183],{},"Copy your key before closing the dialog. Township Canada does not store the full key value after creation. If you lose it, revoke the key and create a new one.",[10,4185,4187],{"id":4186},"naming-conventions","Naming conventions",[15,4189,4190],{},"A consistent naming pattern makes it easy to identify keys at a glance, especially once you have several. Use the format:",[109,4192,4195],{"className":4193,"code":4194,"language":3101},[3099],"{Environment} - {Project} {Version}\n",[19,4196,4194],{"__ignoreMap":114},[15,4198,4199],{},"Examples:",[367,4201,4202,4212],{},[370,4203,4204],{},[373,4205,4206,4209],{},[376,4207,4208],{},"Key name",[376,4210,4211],{},"What it's for",[386,4213,4214,4224,4234,4244,4254],{},[373,4215,4216,4221],{},[391,4217,4218],{},[19,4219,4220],{},"Production - Well Mapper v2",[391,4222,4223],{},"Live production traffic for version 2 of your app",[373,4225,4226,4231],{},[391,4227,4228],{},[19,4229,4230],{},"Staging - Well Mapper v2",[391,4232,4233],{},"Pre-release testing against real data",[373,4235,4236,4241],{},[391,4237,4238],{},[19,4239,4240],{},"Dev - Local Testing",[391,4242,4243],{},"Your local development environment",[373,4245,4246,4251],{},[391,4247,4248],{},[19,4249,4250],{},"CI - Well Mapper",[391,4252,4253],{},"Automated tests in your CI pipeline",[373,4255,4256,4261],{},[391,4257,4258],{},[19,4259,4260],{},"Dev - Jane Smith",[391,4262,4263],{},"A team member's personal development key",[15,4265,4266],{},"Avoid generic names like \"API Key 1\" or \"Test Key\". When you're reviewing keys six months from now, a descriptive name tells you exactly what to keep and what to revoke.",[10,4268,4270],{"id":4269},"environment-variable-setup","Environment variable setup",[15,4272,4273],{},"Never hardcode an API key in your source code. Use environment variables so keys stay out of version control.",[301,4275,4277],{"id":4276},"nodejs","Node.js",[15,4279,4280,4281,4284],{},"Create a ",[19,4282,4283],{},".env"," file in your project root:",[109,4286,4288],{"className":111,"code":4287,"language":113,"meta":114,"style":114},"TOWNSHIP_CANADA_API_KEY=tc_live_your_key_here\n",[19,4289,4290],{"__ignoreMap":114},[118,4291,4292,4294,4296],{"class":120,"line":121},[118,4293,1708],{"class":1691},[118,4295,2558],{"class":566},[118,4297,4298],{"class":132},"tc_live_your_key_here\n",[15,4300,4301],{},"Load and use it in your application:",[109,4303,4305],{"className":1678,"code":4304,"language":1680,"meta":114,"style":114},"\u002F\u002F Make sure dotenv is loaded early (e.g., in your entry file)\nrequire(\"dotenv\").config();\n\nconst response = await fetch(\n  \"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fsearch\u002Flegal-location?location=NW-36-42-3-W5\",\n  {\n    headers: {\n      \"X-API-Key\": process.env.TOWNSHIP_CANADA_API_KEY\n    }\n  }\n);\n",[19,4306,4307,4312,4337,4341,4355,4366,4371,4379,4401,4406,4410],{"__ignoreMap":114},[118,4308,4309],{"class":120,"line":121},[118,4310,4311],{"class":2081},"\u002F\u002F Make sure dotenv is loaded early (e.g., in your entry file)\n",[118,4313,4314,4317,4319,4321,4324,4326,4328,4330,4333,4335],{"class":120,"line":143},[118,4315,4316],{"class":1745},"require",[118,4318,1749],{"class":2017},[118,4320,136],{"class":128},[118,4322,4323],{"class":132},"dotenv",[118,4325,136],{"class":128},[118,4327,1756],{"class":2017},[118,4329,92],{"class":566},[118,4331,4332],{"class":1745},"config",[118,4334,1854],{"class":2017},[118,4336,1711],{"class":566},[118,4338,4339],{"class":120,"line":592},[118,4340,1734],{"emptyLinePlaceholder":1733},[118,4342,4343,4345,4347,4349,4351,4353],{"class":120,"line":613},[118,4344,1688],{"class":1687},[118,4346,1766],{"class":1691},[118,4348,1695],{"class":566},[118,4350,1772],{"class":1771},[118,4352,1775],{"class":1745},[118,4354,2001],{"class":2017},[118,4356,4357,4359,4362,4364],{"class":120,"line":701},[118,4358,573],{"class":128},[118,4360,4361],{"class":132},"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fsearch\u002Flegal-location?location=NW-36-42-3-W5",[118,4363,136],{"class":128},[118,4365,589],{"class":566},[118,4367,4368],{"class":120,"line":715},[118,4369,4370],{"class":566},"  {\n",[118,4372,4373,4375,4377],{"class":120,"line":732},[118,4374,1808],{"class":1807},[118,4376,449],{"class":566},[118,4378,712],{"class":566},[118,4380,4381,4384,4386,4388,4390,4392,4394,4396,4398],{"class":120,"line":748},[118,4382,4383],{"class":128},"      \"",[118,4385,106],{"class":1817},[118,4387,136],{"class":128},[118,4389,449],{"class":566},[118,4391,1698],{"class":1691},[118,4393,92],{"class":566},[118,4395,1703],{"class":1691},[118,4397,92],{"class":566},[118,4399,4400],{"class":1691},"TOWNSHIP_CANADA_API_KEY\n",[118,4402,4403],{"class":120,"line":764},[118,4404,4405],{"class":566},"    }\n",[118,4407,4408],{"class":120,"line":784},[118,4409,1249],{"class":566},[118,4411,4412,4414],{"class":120,"line":817},[118,4413,1756],{"class":2017},[118,4415,1711],{"class":566},[15,4417,4418],{},"For the Maps API tiles, pass the key as a query parameter instead:",[109,4420,4422],{"className":1678,"code":4421,"language":1680,"meta":114,"style":114},"const tileUrl = `https:\u002F\u002Fmaps.townshipcanada.com\u002Fab\u002Ftwp\u002F{z}\u002F{x}\u002F{y}.mvt?api_key=${process.env.TOWNSHIP_CANADA_API_KEY}`;\n",[19,4423,4424],{"__ignoreMap":114},[118,4425,4426,4428,4431,4433,4436,4439,4441,4444,4446,4448,4450,4452,4454,4456],{"class":120,"line":121},[118,4427,1688],{"class":1687},[118,4429,4430],{"class":1691}," tileUrl",[118,4432,1695],{"class":566},[118,4434,4435],{"class":128}," `",[118,4437,4438],{"class":132},"https:\u002F\u002Fmaps.townshipcanada.com\u002Fab\u002Ftwp\u002F{z}\u002F{x}\u002F{y}.mvt?api_key=",[118,4440,1784],{"class":694},[118,4442,4443],{"class":1787},"process",[118,4445,92],{"class":566},[118,4447,1703],{"class":1787},[118,4449,92],{"class":566},[118,4451,1708],{"class":1787},[118,4453,1796],{"class":694},[118,4455,1781],{"class":128},[118,4457,1711],{"class":566},[301,4459,4460],{"id":2456},"Python",[15,4462,4280,4463,4465],{},[19,4464,4283],{}," file:",[109,4467,4468],{"className":111,"code":4287,"language":113,"meta":114,"style":114},[19,4469,4470],{"__ignoreMap":114},[118,4471,4472,4474,4476],{"class":120,"line":121},[118,4473,1708],{"class":1691},[118,4475,2558],{"class":566},[118,4477,4298],{"class":132},[15,4479,4480,4481,449],{},"Load it using ",[19,4482,4483],{},"python-dotenv",[109,4485,4487],{"className":2454,"code":4486,"language":2456,"meta":114,"style":114},"import os\nfrom dotenv import load_dotenv\nimport requests\n\nload_dotenv()\n\napi_key = os.environ.get('TOWNSHIP_CANADA_API_KEY')\n\nresponse = requests.get(\n    'https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fsearch\u002Flegal-location',\n    headers={'X-API-Key': api_key},\n    params={'location': '10-15-23-4-W4'}\n)\n",[19,4488,4489,4495,4508,4514,4518,4525,4529,4556,4560,4575,4587,4606,4632],{"__ignoreMap":114},[118,4490,4491,4493],{"class":120,"line":121},[118,4492,2463],{"class":1771},[118,4494,2466],{"class":1082},[118,4496,4497,4500,4503,4505],{"class":120,"line":143},[118,4498,4499],{"class":1771},"from",[118,4501,4502],{"class":1082}," dotenv ",[118,4504,2463],{"class":1771},[118,4506,4507],{"class":1082}," load_dotenv\n",[118,4509,4510,4512],{"class":120,"line":592},[118,4511,2463],{"class":1771},[118,4513,2477],{"class":1082},[118,4515,4516],{"class":120,"line":613},[118,4517,1734],{"emptyLinePlaceholder":1733},[118,4519,4520,4523],{"class":120,"line":701},[118,4521,4522],{"class":2566},"load_dotenv",[118,4524,2809],{"class":566},[118,4526,4527],{"class":120,"line":715},[118,4528,1734],{"emptyLinePlaceholder":1733},[118,4530,4531,4534,4536,4538,4540,4542,4544,4546,4548,4550,4552,4554],{"class":120,"line":732},[118,4532,4533],{"class":1082},"api_key ",[118,4535,2558],{"class":566},[118,4537,2491],{"class":1082},[118,4539,92],{"class":566},[118,4541,2497],{"class":2496},[118,4543,92],{"class":566},[118,4545,2567],{"class":2566},[118,4547,1749],{"class":566},[118,4549,2761],{"class":128},[118,4551,1708],{"class":132},[118,4553,2761],{"class":128},[118,4555,2303],{"class":566},[118,4557,4558],{"class":120,"line":748},[118,4559,1734],{"emptyLinePlaceholder":1733},[118,4561,4562,4565,4567,4569,4571,4573],{"class":120,"line":764},[118,4563,4564],{"class":1082},"response ",[118,4566,2558],{"class":566},[118,4568,2561],{"class":1082},[118,4570,92],{"class":566},[118,4572,2567],{"class":2566},[118,4574,2001],{"class":566},[118,4576,4577,4580,4583,4585],{"class":120,"line":784},[118,4578,4579],{"class":128},"    '",[118,4581,4582],{"class":132},"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fsearch\u002Flegal-location",[118,4584,2761],{"class":128},[118,4586,589],{"class":566},[118,4588,4589,4591,4593,4595,4597,4599,4601,4604],{"class":120,"line":817},[118,4590,1808],{"class":1752},[118,4592,2598],{"class":566},[118,4594,2761],{"class":128},[118,4596,106],{"class":132},[118,4598,2761],{"class":128},[118,4600,449],{"class":566},[118,4602,4603],{"class":2566}," api_key",[118,4605,2611],{"class":566},[118,4607,4608,4611,4613,4615,4618,4620,4622,4625,4628,4630],{"class":120,"line":823},[118,4609,4610],{"class":1752},"    params",[118,4612,2598],{"class":566},[118,4614,2761],{"class":128},[118,4616,4617],{"class":132},"location",[118,4619,2761],{"class":128},[118,4621,449],{"class":566},[118,4623,4624],{"class":128}," '",[118,4626,4627],{"class":132},"10-15-23-4-W4",[118,4629,2761],{"class":128},[118,4631,1025],{"class":566},[118,4633,4634],{"class":120,"line":837},[118,4635,2303],{"class":566},[301,4637,4639],{"id":4638},"keeping-keys-out-of-git","Keeping keys out of git",[15,4641,4642,4643,4645,4646,4465],{},"Add ",[19,4644,4283],{}," to your ",[19,4647,4648],{},".gitignore",[109,4650,4652],{"className":111,"code":4651,"language":113,"meta":114,"style":114},"# .gitignore\n.env\n.env.local\n.env.*.local\n",[19,4653,4654,4659,4664,4669],{"__ignoreMap":114},[118,4655,4656],{"class":120,"line":121},[118,4657,4658],{"class":2081},"# .gitignore\n",[118,4660,4661],{"class":120,"line":143},[118,4662,4663],{"class":124},".env\n",[118,4665,4666],{"class":120,"line":592},[118,4667,4668],{"class":124},".env.local\n",[118,4670,4671],{"class":120,"line":613},[118,4672,4673],{"class":124},".env.*.local\n",[15,4675,4676,4677,4680],{},"Commit a ",[19,4678,4679],{},".env.example"," file with placeholder values instead. Other developers on your team know what variables to set without seeing real credentials:",[109,4682,4684],{"className":111,"code":4683,"language":113,"meta":114,"style":114},"# .env.example\nTOWNSHIP_CANADA_API_KEY=your_api_key_here\n",[19,4685,4686,4691],{"__ignoreMap":114},[118,4687,4688],{"class":120,"line":121},[118,4689,4690],{"class":2081},"# .env.example\n",[118,4692,4693,4695,4697],{"class":120,"line":143},[118,4694,1708],{"class":1691},[118,4696,2558],{"class":566},[118,4698,4699],{"class":132},"your_api_key_here\n",[10,4701,4703],{"id":4702},"key-rotation-without-downtime","Key rotation without downtime",[15,4705,4706],{},"Rotating a production key requires a brief overlap period where both the old and new key are valid. Follow this sequence:",[3114,4708,4709,4715,4721,4727],{},[46,4710,4711,4714],{},[64,4712,4713],{},"Create the new key"," in the Developer Portal with the same name (add \"v2\" or today's date to distinguish it)",[46,4716,4717,4720],{},[64,4718,4719],{},"Update your deployment"," - set the new key value in your environment variables or secrets manager",[46,4722,4723,4726],{},[64,4724,4725],{},"Deploy and verify"," - confirm requests are succeeding with the new key in your application logs",[46,4728,4729,4732],{},[64,4730,4731],{},"Revoke the old key"," - only after confirming the new key is working",[15,4734,4735],{},"Never revoke the old key before confirming the new one works. A failed deploy with no fallback means downtime.",[10,4737,4739],{"id":4738},"cicd-secrets","CI\u002FCD secrets",[15,4741,4742],{},"Automated pipelines need API keys without human involvement. Store keys in your CI provider's secrets store, not in configuration files.",[301,4744,4746],{"id":4745},"github-actions","GitHub Actions",[15,4748,4749],{},"Add your API key as a repository secret:",[3114,4751,4752,4758,4763,4769],{},[46,4753,3935,4754,4757],{},[64,4755,4756],{},"Settings → Secrets and variables → Actions"," in your GitHub repository",[46,4759,3952,4760],{},[64,4761,4762],{},"New repository secret",[46,4764,4765,4766,4768],{},"Name it ",[19,4767,1708],{}," and paste your CI key value",[46,4770,3952,4771],{},[64,4772,4773],{},"Add secret",[15,4775,4776],{},"Reference it in your workflow file:",[109,4778,4782],{"className":4779,"code":4780,"language":4781,"meta":114,"style":114},"language-yaml shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","# .github\u002Fworkflows\u002Ftest.yml\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - name: Run integration tests\n        env:\n          TOWNSHIP_CANADA_API_KEY: ${{ secrets.TOWNSHIP_CANADA_API_KEY }}\n        run: npm test\n","yaml",[19,4783,4784,4789,4796,4803,4813,4820,4833,4845,4852,4862],{"__ignoreMap":114},[118,4785,4786],{"class":120,"line":121},[118,4787,4788],{"class":2081},"# .github\u002Fworkflows\u002Ftest.yml\n",[118,4790,4791,4794],{"class":120,"line":143},[118,4792,4793],{"class":1807},"jobs",[118,4795,2690],{"class":566},[118,4797,4798,4801],{"class":120,"line":592},[118,4799,4800],{"class":1807},"  test",[118,4802,2690],{"class":566},[118,4804,4805,4808,4810],{"class":120,"line":613},[118,4806,4807],{"class":1807},"    runs-on",[118,4809,449],{"class":566},[118,4811,4812],{"class":132}," ubuntu-latest\n",[118,4814,4815,4818],{"class":120,"line":701},[118,4816,4817],{"class":1807},"    steps",[118,4819,2690],{"class":566},[118,4821,4822,4825,4828,4830],{"class":120,"line":715},[118,4823,4824],{"class":566},"      -",[118,4826,4827],{"class":1807}," uses",[118,4829,449],{"class":566},[118,4831,4832],{"class":132}," actions\u002Fcheckout@v4\n",[118,4834,4835,4837,4840,4842],{"class":120,"line":732},[118,4836,4824],{"class":566},[118,4838,4839],{"class":1807}," name",[118,4841,449],{"class":566},[118,4843,4844],{"class":132}," Run integration tests\n",[118,4846,4847,4850],{"class":120,"line":748},[118,4848,4849],{"class":1807},"        env",[118,4851,2690],{"class":566},[118,4853,4854,4857,4859],{"class":120,"line":764},[118,4855,4856],{"class":1807},"          TOWNSHIP_CANADA_API_KEY",[118,4858,449],{"class":566},[118,4860,4861],{"class":132}," ${{ secrets.TOWNSHIP_CANADA_API_KEY }}\n",[118,4863,4864,4867,4869],{"class":120,"line":784},[118,4865,4866],{"class":1807},"        run",[118,4868,449],{"class":566},[118,4870,4871],{"class":132}," npm test\n",[15,4873,4874],{},"The same pattern applies to other CI platforms - GitLab CI uses project variables, Bitbucket Pipelines uses repository variables, and CircleCI uses environment variables in project settings. The key principle is the same: the secret is stored in the platform, referenced by name in the config file, and never written to disk or logs.",[10,4876,4878],{"id":4877},"team-key-management","Team key management",[15,4880,4881],{},"On the Business plan, account admins can view all API keys created by team members - including the key name, creator, creation date, and last-used timestamp. This makes it possible to audit which keys are active, identify keys that haven't been used recently, and revoke credentials when a team member leaves.",[15,4883,4884],{},"Individual developers see only their own keys. Admins see keys across the entire team.",[15,4886,4887],{},"If your team uses a shared integration (for example, a company-wide internal tool), create that key under an admin account rather than a personal one. That way the key doesn't become inaccessible if the original creator's account is deactivated.",[10,4889,4891],{"id":4890},"security-practices","Security practices",[15,4893,4894],{},"A few habits that prevent the most common problems:",[15,4896,4897,4900,4901,4903,4904,4909],{},[64,4898,4899],{},"Don't commit keys."," The ",[19,4902,4648],{}," pattern above covers most cases. For extra protection, consider a tool like ",[50,4905,4908],{"href":4906,"rel":4907},"https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fgit-secrets",[4036],"git-secrets"," that scans commits for credential patterns before they're pushed.",[15,4911,4912,4915],{},[64,4913,4914],{},"Use separate keys for separate projects."," If Project A's key is ever compromised, you revoke that key without touching Project B. It also makes usage monitoring cleaner - each key's activity in the logs maps to exactly one project.",[15,4917,4918,4921],{},[64,4919,4920],{},"Rotate keys periodically."," There's no hard rule on frequency, but a yearly rotation for production keys is a reasonable baseline. After a team member departure, rotate any keys they had access to.",[15,4923,4924,4927],{},[64,4925,4926],{},"Delete unused keys."," Old keys from completed projects or former team members are attack surface with no benefit. If a key hasn't been used in 90 days and you don't recognize its purpose, revoke it.",[15,4929,4930,4933],{},[64,4931,4932],{},"Treat keys like passwords."," Don't paste them into chat messages, emails, or support tickets. If you need to share a key temporarily, do it through a password manager or secrets vault.",[10,4935,4042],{"id":4041},[43,4937,4938,4944,4950,4957,4962],{},[46,4939,4940,4943],{},[50,4941,4942],{"href":4121},"API Integration"," - Get started with the Township Canada API",[46,4945,4946,4949],{},[50,4947,4948],{"href":3543},"Batch API Guide"," - Process multiple records in a single request",[46,4951,4952,4956],{},[50,4953,4955],{"href":4954},"\u002Fguides\u002Fautocomplete-api-guide","Autocomplete API Guide"," - Add LLD search suggestions to your app",[46,4958,4959,4961],{},[50,4960,4050],{"href":4049}," - Manage subscriptions and billing",[46,4963,4964,4968],{},[50,4965,4967],{"href":4966},"\u002Fpricing","Pricing"," - API plan tiers and request quotas",[3626,4970,4971],{},"html pre.shiki code .sSC40, html code.shiki .sSC40{--shiki-light:#90A4AE;--shiki-default:#B07D48;--shiki-dark:#BD976A}html pre.shiki code .soVBu, html code.shiki .soVBu{--shiki-light:#39ADB5;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .sTbE_, html code.shiki .sTbE_{--shiki-light:#91B859;--shiki-default:#B56959;--shiki-dark:#C98A7D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s9Tkl, html code.shiki .s9Tkl{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#A0ADA0;--shiki-default-font-style:inherit;--shiki-dark:#758575DD;--shiki-dark-font-style:inherit}html pre.shiki code .sljsM, html code.shiki .sljsM{--shiki-light:#6182B8;--shiki-default:#59873A;--shiki-dark:#80A665}html pre.shiki code .snCua, html code.shiki .snCua{--shiki-light:#90A4AE;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .sbYkP, html code.shiki .sbYkP{--shiki-light:#39ADB5;--shiki-default:#B5695977;--shiki-dark:#C98A7D77}html pre.shiki code .s5Kfy, html code.shiki .s5Kfy{--shiki-light:#9C3EDA;--shiki-default:#AB5959;--shiki-dark:#CB7676}html pre.shiki code .siDh9, html code.shiki .siDh9{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#1E754F;--shiki-default-font-style:inherit;--shiki-dark:#4D9375;--shiki-dark-font-style:inherit}html pre.shiki code .suXOh, html code.shiki .suXOh{--shiki-light:#E53935;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .sQtxO, html code.shiki .sQtxO{--shiki-light:#E53935;--shiki-default:#B56959;--shiki-dark:#C98A7D}html pre.shiki code .s8XtY, html code.shiki .s8XtY{--shiki-light:#39ADB5;--shiki-default:#1E754F;--shiki-dark:#4D9375}html pre.shiki code .su_V2, html code.shiki .su_V2{--shiki-light:#90A4AE;--shiki-default:#B56959;--shiki-dark:#C98A7D}html pre.shiki code .sftqT, html code.shiki .sftqT{--shiki-light:#90A4AE;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .siWMO, html code.shiki .siWMO{--shiki-light:#6182B8;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .sBPpx, html code.shiki .sBPpx{--shiki-light:#E53935;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .sqOPj, html code.shiki .sqOPj{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#B07D48;--shiki-default-font-style:inherit;--shiki-dark:#BD976A;--shiki-dark-font-style:inherit}html pre.shiki code .sYn-s, html code.shiki .sYn-s{--shiki-light:#E2931D;--shiki-default:#59873A;--shiki-dark:#80A665}",{"title":114,"searchDepth":143,"depth":143,"links":4973},[4974,4975,4976,4981,4982,4985,4986,4987],{"id":4144,"depth":143,"text":4145},{"id":4186,"depth":143,"text":4187},{"id":4269,"depth":143,"text":4270,"children":4977},[4978,4979,4980],{"id":4276,"depth":592,"text":4277},{"id":2456,"depth":592,"text":4460},{"id":4638,"depth":592,"text":4639},{"id":4702,"depth":143,"text":4703},{"id":4738,"depth":143,"text":4739,"children":4983},[4984],{"id":4745,"depth":592,"text":4746},{"id":4877,"depth":143,"text":4878},{"id":4890,"depth":143,"text":4891},{"id":4041,"depth":143,"text":4042},"Create and manage multiple Township Canada API keys for different environments. Naming conventions, key rotation, environment variables, and CI\u002FCD setup.","i-lucide-key-round",{},{"title":4127,"description":4988},"guides\u002Fapi-key-management","QZYRlzwTYTK7i762-oBqnlcf5dfrrCGmmJ2jKgR2NBs",{"id":4995,"title":4996,"body":4997,"category":3656,"description":5975,"draft":3658,"extension":3659,"icon":5976,"meta":5977,"navigation":1733,"order":748,"path":5978,"seo":5979,"stem":5980,"__hash__":5981},"guides\u002Fguides\u002Fapi-troubleshooting.md","API Troubleshooting & Best Practices",{"type":7,"value":4998,"toc":5953},[4999,5005,5011,5015,5019,5045,5051,5056,5073,5103,5106,5110,5115,5148,5152,5178,5182,5188,5193,5198,5211,5215,5218,5223,5234,5239,5270,5274,5284,5289,5307,5311,5318,5353,5357,5361,5468,5549,5553,5761,5765,5768,5774,5778,5781,5838,5841,5855,5859,5863,5870,5874,5877,5905,5909,5916,5918,5950],[15,5000,5001,5004],{},[64,5002,5003],{},"Getting errors from the Township Canada API?"," This guide covers the most common issues developers run into - authentication failures, CORS blocks, rate limits, and unexpected empty responses - with clear fixes for each one.",[15,5006,5007],{},[241,5008],{"alt":5009,"src":5010},"The Developer Portal Logs tab with request counts, success rate, filters for errors and slow requests, and the request log table","\u002Fimages\u002Fguides\u002Fapi-request-logs.webp",[10,5012,5014],{"id":5013},"common-errors-and-what-they-mean","Common errors and what they mean",[301,5016,5018],{"id":5017},"forbidden-http-403","Forbidden (HTTP 403)",[109,5020,5022],{"className":557,"code":5021,"language":559,"meta":114,"style":114},"{ \"message\": \"Forbidden\" }\n",[19,5023,5024],{"__ignoreMap":114},[118,5025,5026,5028,5030,5032,5034,5036,5038,5041,5043],{"class":120,"line":121},[118,5027,2580],{"class":566},[118,5029,129],{"class":572},[118,5031,1233],{"class":576},[118,5033,136],{"class":572},[118,5035,449],{"class":566},[118,5037,129],{"class":128},[118,5039,5040],{"class":132},"Forbidden",[118,5042,136],{"class":128},[118,5044,1019],{"class":566},[15,5046,5047,5050],{},[64,5048,5049],{},"Cause:"," Your API key is missing, invalid, or not included correctly.",[15,5052,5053],{},[64,5054,5055],{},"Fix:",[3114,5057,5058,5064,5070],{},[46,5059,5060,5061],{},"Confirm your API key exists: go to ",[64,5062,5063],{},"My Account → API Access",[46,5065,5066,5067,5069],{},"Include it in the ",[19,5068,106],{}," header (not as a URL parameter)",[46,5071,5072],{},"Test with curl:",[109,5074,5076],{"className":111,"code":5075,"language":113,"meta":114,"style":114},"curl -H \"X-API-Key: YOUR_KEY\" \\\n  \"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fsearch\u002Flegal-location?q=SW-25-24-1-W5\"\n",[19,5077,5078,5094],{"__ignoreMap":114},[118,5079,5080,5082,5085,5087,5090,5092],{"class":120,"line":121},[118,5081,125],{"class":124},[118,5083,5084],{"class":146}," -H",[118,5086,129],{"class":128},[118,5088,5089],{"class":132},"X-API-Key: YOUR_KEY",[118,5091,136],{"class":128},[118,5093,140],{"class":139},[118,5095,5096,5098,5101],{"class":120,"line":143},[118,5097,573],{"class":128},[118,5099,5100],{"class":132},"https:\u002F\u002Fdeveloper.townshipcanada.com\u002Fsearch\u002Flegal-location?q=SW-25-24-1-W5",[118,5102,155],{"class":128},[15,5104,5105],{},"If you get a valid JSON response, your key works. If you still get Forbidden, the key may have been rotated - generate a new one from your account page.",[301,5107,5109],{"id":5108},"too-many-requests-http-429","Too Many Requests (HTTP 429)",[15,5111,5112,5114],{},[64,5113,5049],{}," You exceeded the rate limit for your API tier.",[367,5116,5117,5125],{},[370,5118,5119],{},[373,5120,5121,5123],{},[376,5122,3797],{},[376,5124,3803],{},[386,5126,5127,5134,5141],{},[373,5128,5129,5131],{},[391,5130,3810],{},[391,5132,5133],{},"1 request\u002Fsecond",[373,5135,5136,5138],{},[391,5137,3820],{},[391,5139,5140],{},"5 requests\u002Fsecond",[373,5142,5143,5145],{},[391,5144,3510],{},[391,5146,5147],{},"25 requests\u002Fsecond",[15,5149,5150],{},[64,5151,5055],{},[43,5153,5154,5165,5171],{},[46,5155,5156,5157,5160,5161,5164],{},"Add a delay between requests: ",[19,5158,5159],{},"await new Promise(r => setTimeout(r, 1000))"," in JavaScript, or ",[19,5162,5163],{},"time.sleep(1)"," in Python",[46,5166,5167,5168,5170],{},"Use the ",[50,5169,3540],{"href":3543}," instead of looping single calls - it processes up to 100 records per request",[46,5172,5173,5174,5177],{},"If you consistently need higher throughput, ",[50,5175,5176],{"href":4080},"contact us"," about upgrading your tier",[301,5179,5181],{"id":5180},"cors-policy-error","CORS Policy Error",[109,5183,5186],{"className":5184,"code":5185,"language":3101},[3099],"Access to fetch at 'https:\u002F\u002Fdeveloper.townshipcanada.com\u002F...' has been blocked by CORS policy\n",[19,5187,5185],{"__ignoreMap":114},[15,5189,5190,5192],{},[64,5191,5049],{}," You are calling the API directly from a browser (client-side JavaScript). The API is designed for server-to-server calls and does not include CORS headers by default.",[15,5194,5195],{},[64,5196,5197],{},"Fix options:",[3114,5199,5200,5206],{},[46,5201,5202,5205],{},[64,5203,5204],{},"Proxy through your backend"," - Make the API call from your server (Node.js, Python, etc.) and return the result to your frontend",[46,5207,5208,5210],{},[64,5209,4081],{}," - If you need direct browser access, we can add your domain to the CORS allowlist",[301,5212,5214],{"id":5213},"empty-response-no-features","Empty Response (no features)",[15,5216,5217],{},"The API returns a valid HTTP 200 response, but the result contains no features or coordinates.",[15,5219,5220],{},[64,5221,5222],{},"Possible causes:",[43,5224,5225,5228,5231],{},[46,5226,5227],{},"The legal description does not exist (e.g., a township\u002Frange combination that was never surveyed)",[46,5229,5230],{},"The description is at a resolution not supported for that region",[46,5232,5233],{},"Format is slightly wrong - the API is stricter than the web app",[15,5235,5236],{},[64,5237,5238],{},"Debugging steps:",[3114,5240,5241,5249,5259,5262],{},[46,5242,5243,5244,5248],{},"Try the same description in the ",[50,5245,5247],{"href":5246},"\u002Fapp","web app search box"," - does it work there?",[46,5250,5251,5252,5255,5256,1756],{},"Check that you included the full meridian (e.g., ",[19,5253,5254],{},"W5"," not just ",[19,5257,5258],{},"5",[46,5260,5261],{},"Verify component ranges: LSD 1–16, Section 1–36, Township 1–126, Range 1–34",[46,5263,5264,5265,5269],{},"Check the ",[50,5266,5268],{"href":5267},"\u002Fguides\u002Fcoverage","Coverage Guide"," for resolution limits by region",[301,5271,5273],{"id":5272},"database-errors-28000-08006","Database Errors (28000, 08006)",[15,5275,5276,5277,200,5280,5283],{},"Errors with codes like ",[19,5278,5279],{},"28000",[19,5281,5282],{},"08006"," indicate a service disruption, not an issue with your code.",[15,5285,5286],{},[64,5287,5288],{},"What to do:",[43,5290,5291,5299,5302],{},[46,5292,5264,5293,5298],{},[50,5294,5297],{"href":5295,"rel":5296},"https:\u002F\u002Fstatus.townshipcanada.com\u002F",[4036],"status page"," for incident reports",[46,5300,5301],{},"Wait a few minutes and retry",[46,5303,5304,5305],{},"If the issue persists beyond 15 minutes, ",[50,5306,5176],{"href":4080},[10,5308,5310],{"id":5309},"api-key-setup","API key setup",[15,5312,5313,5314,5317],{},"Quick recap of key setup (see the ",[50,5315,5316],{"href":90},"full API key management guide"," for details):",[3114,5319,5320,5326,5335,5341,5347],{},[46,5321,5322,5325],{},[64,5323,5324],{},"Find your key:"," My Account → API Access",[46,5327,5328,5331,5332,5334],{},[64,5329,5330],{},"Include in requests:"," Add the ",[19,5333,106],{}," header to every request",[46,5336,5337,5340],{},[64,5338,5339],{},"Test before coding:"," Use curl or Postman to confirm the key works",[46,5342,5343,5346],{},[64,5344,5345],{},"Name your keys:"," Use descriptive names like \"production-backend\" or \"staging-test\" to keep track of which key is used where",[46,5348,5349,5352],{},[64,5350,5351],{},"Rotate regularly:"," Generate new keys periodically and phase out old ones",[10,5354,5356],{"id":5355},"rate-limiting-best-practices","Rate limiting best practices",[301,5358,5360],{"id":5359},"add-delay-between-requests","Add delay between requests",[109,5362,5364],{"className":1678,"code":5363,"language":1680,"meta":114,"style":114},"\u002F\u002F JavaScript - simple delay\nfor (const query of queries) {\n  const result = await fetch(url + query, { headers });\n  await new Promise((r) => setTimeout(r, 1000));\n}\n",[19,5365,5366,5371,5392,5427,5464],{"__ignoreMap":114},[118,5367,5368],{"class":120,"line":121},[118,5369,5370],{"class":2081},"\u002F\u002F JavaScript - simple delay\n",[118,5372,5373,5375,5377,5379,5382,5385,5388,5390],{"class":120,"line":143},[118,5374,3000],{"class":1771},[118,5376,1274],{"class":2017},[118,5378,1688],{"class":1687},[118,5380,5381],{"class":1691}," query",[118,5383,5384],{"class":1866}," of",[118,5386,5387],{"class":1691}," queries",[118,5389,1756],{"class":2017},[118,5391,712],{"class":566},[118,5393,5394,5396,5398,5400,5402,5404,5406,5409,5412,5414,5416,5418,5421,5423,5425],{"class":120,"line":592},[118,5395,1763],{"class":1687},[118,5397,2140],{"class":1691},[118,5399,1695],{"class":566},[118,5401,1772],{"class":1771},[118,5403,1775],{"class":1745},[118,5405,1749],{"class":1778},[118,5407,5408],{"class":1691},"url",[118,5410,5411],{"class":1866}," +",[118,5413,5381],{"class":1691},[118,5415,642],{"class":566},[118,5417,625],{"class":566},[118,5419,5420],{"class":1691}," headers",[118,5422,1016],{"class":566},[118,5424,1756],{"class":1778},[118,5426,1711],{"class":566},[118,5428,5429,5432,5434,5437,5439,5441,5444,5446,5448,5451,5453,5455,5457,5460,5462],{"class":120,"line":613},[118,5430,5431],{"class":1771},"  await",[118,5433,1887],{"class":1866},[118,5435,5436],{"class":630}," Promise",[118,5438,1749],{"class":1778},[118,5440,1749],{"class":566},[118,5442,5443],{"class":1752},"r",[118,5445,1756],{"class":566},[118,5447,2324],{"class":2323},[118,5449,5450],{"class":1745}," setTimeout",[118,5452,1749],{"class":1778},[118,5454,5443],{"class":1691},[118,5456,642],{"class":566},[118,5458,5459],{"class":638}," 1000",[118,5461,2257],{"class":1778},[118,5463,1711],{"class":566},[118,5465,5466],{"class":120,"line":701},[118,5467,1025],{"class":566},[109,5469,5471],{"className":2454,"code":5470,"language":2456,"meta":114,"style":114},"# Python - simple delay\nimport time\nfor query in queries:\n    result = requests.get(url + query, headers=headers)\n    time.sleep(1)\n",[19,5472,5473,5478,5485,5498,5532],{"__ignoreMap":114},[118,5474,5475],{"class":120,"line":121},[118,5476,5477],{"class":2081},"# Python - simple delay\n",[118,5479,5480,5482],{"class":120,"line":143},[118,5481,2463],{"class":1771},[118,5483,5484],{"class":1082}," time\n",[118,5486,5487,5489,5492,5494,5496],{"class":120,"line":592},[118,5488,3000],{"class":1771},[118,5490,5491],{"class":1082}," query ",[118,5493,3006],{"class":1771},[118,5495,5387],{"class":1082},[118,5497,2690],{"class":566},[118,5499,5500,5503,5505,5507,5509,5511,5513,5516,5519,5521,5523,5525,5527,5530],{"class":120,"line":613},[118,5501,5502],{"class":1082},"    result ",[118,5504,2558],{"class":566},[118,5506,2561],{"class":1082},[118,5508,92],{"class":566},[118,5510,2567],{"class":2566},[118,5512,1749],{"class":566},[118,5514,5515],{"class":2566},"url ",[118,5517,5518],{"class":1866},"+",[118,5520,5381],{"class":2566},[118,5522,642],{"class":566},[118,5524,5420],{"class":1752},[118,5526,2558],{"class":566},[118,5528,5529],{"class":2566},"headers",[118,5531,2303],{"class":566},[118,5533,5534,5537,5539,5542,5544,5547],{"class":120,"line":701},[118,5535,5536],{"class":1082},"    time",[118,5538,92],{"class":566},[118,5540,5541],{"class":2566},"sleep",[118,5543,1749],{"class":566},[118,5545,5546],{"class":638},"1",[118,5548,2303],{"class":566},[301,5550,5552],{"id":5551},"use-exponential-backoff-on-429","Use exponential backoff on 429",[109,5554,5556],{"className":1678,"code":5555,"language":1680,"meta":114,"style":114},"async function fetchWithBackoff(url, headers, maxRetries = 3) {\n  for (let i = 0; i \u003C maxRetries; i++) {\n    const res = await fetch(url, { headers });\n    if (res.status !== 429) return res;\n    await new Promise((r) => setTimeout(r, 1000 * Math.pow(2, i)));\n  }\n  throw new Error(\"Rate limit exceeded after retries\");\n}\n",[19,5557,5558,5588,5622,5651,5678,5731,5735,5757],{"__ignoreMap":114},[118,5559,5560,5562,5564,5567,5569,5571,5573,5575,5577,5580,5582,5584,5586],{"class":120,"line":121},[118,5561,1739],{"class":1687},[118,5563,1742],{"class":1687},[118,5565,5566],{"class":1745}," fetchWithBackoff",[118,5568,1749],{"class":566},[118,5570,5408],{"class":1752},[118,5572,642],{"class":566},[118,5574,5420],{"class":1752},[118,5576,642],{"class":566},[118,5578,5579],{"class":1752}," maxRetries",[118,5581,1695],{"class":566},[118,5583,727],{"class":638},[118,5585,1756],{"class":566},[118,5587,712],{"class":566},[118,5589,5590,5592,5594,5596,5599,5601,5603,5605,5607,5610,5612,5614,5616,5618,5620],{"class":120,"line":143},[118,5591,2103],{"class":1771},[118,5593,1274],{"class":1778},[118,5595,2108],{"class":1687},[118,5597,5598],{"class":1691}," i",[118,5600,1695],{"class":566},[118,5602,3239],{"class":638},[118,5604,2119],{"class":566},[118,5606,5598],{"class":1691},[118,5608,5609],{"class":566}," \u003C",[118,5611,5579],{"class":1691},[118,5613,2119],{"class":566},[118,5615,5598],{"class":1691},[118,5617,2127],{"class":1866},[118,5619,1756],{"class":1778},[118,5621,712],{"class":566},[118,5623,5624,5626,5629,5631,5633,5635,5637,5639,5641,5643,5645,5647,5649],{"class":120,"line":592},[118,5625,2137],{"class":1687},[118,5627,5628],{"class":1691}," res",[118,5630,1695],{"class":566},[118,5632,1772],{"class":1771},[118,5634,1775],{"class":1745},[118,5636,1749],{"class":1778},[118,5638,5408],{"class":1691},[118,5640,642],{"class":566},[118,5642,625],{"class":566},[118,5644,5420],{"class":1691},[118,5646,1016],{"class":566},[118,5648,1756],{"class":1778},[118,5650,1711],{"class":566},[118,5652,5653,5655,5657,5660,5662,5664,5667,5670,5672,5674,5676],{"class":120,"line":613},[118,5654,2214],{"class":1771},[118,5656,1274],{"class":1778},[118,5658,5659],{"class":1691},"res",[118,5661,92],{"class":566},[118,5663,1337],{"class":1691},[118,5665,5666],{"class":1866}," !==",[118,5668,5669],{"class":638}," 429",[118,5671,1756],{"class":1778},[118,5673,2060],{"class":1771},[118,5675,5628],{"class":1691},[118,5677,1711],{"class":566},[118,5679,5680,5683,5685,5687,5689,5691,5693,5695,5697,5699,5701,5703,5705,5707,5710,5712,5714,5717,5719,5722,5724,5726,5729],{"class":120,"line":701},[118,5681,5682],{"class":1771},"    await",[118,5684,1887],{"class":1866},[118,5686,5436],{"class":630},[118,5688,1749],{"class":1778},[118,5690,1749],{"class":566},[118,5692,5443],{"class":1752},[118,5694,1756],{"class":566},[118,5696,2324],{"class":2323},[118,5698,5450],{"class":1745},[118,5700,1749],{"class":1778},[118,5702,5443],{"class":1691},[118,5704,642],{"class":566},[118,5706,5459],{"class":638},[118,5708,5709],{"class":1866}," *",[118,5711,2224],{"class":1691},[118,5713,92],{"class":566},[118,5715,5716],{"class":1745},"pow",[118,5718,1749],{"class":1778},[118,5720,5721],{"class":638},"2",[118,5723,642],{"class":566},[118,5725,5598],{"class":1691},[118,5727,5728],{"class":1778},")))",[118,5730,1711],{"class":566},[118,5732,5733],{"class":120,"line":715},[118,5734,1249],{"class":566},[118,5736,5737,5740,5742,5744,5746,5748,5751,5753,5755],{"class":120,"line":732},[118,5738,5739],{"class":1771},"  throw",[118,5741,1887],{"class":1866},[118,5743,1890],{"class":1745},[118,5745,1749],{"class":1778},[118,5747,136],{"class":128},[118,5749,5750],{"class":132},"Rate limit exceeded after retries",[118,5752,136],{"class":128},[118,5754,1756],{"class":1778},[118,5756,1711],{"class":566},[118,5758,5759],{"class":120,"line":748},[118,5760,1025],{"class":566},[301,5762,5764],{"id":5763},"use-the-batch-api-for-bulk-work","Use the Batch API for bulk work",[15,5766,5767],{},"Instead of looping 1,000 single calls (which takes 17+ minutes at 1\u002Fsec), use the Batch API to process 100 records per call - the same 1,000 records take 10 calls.",[15,5769,5770,5771,5773],{},"See the ",[50,5772,4948],{"href":3543}," for chunking examples in Node.js and Python.",[10,5775,5777],{"id":5776},"format-differences-web-app-vs-api","Format differences: web app vs. API",[15,5779,5780],{},"The web app's search box is more forgiving than the API:",[367,5782,5783,5795],{},[370,5784,5785],{},[373,5786,5787,5790,5793],{},[376,5788,5789],{},"Issue",[376,5791,5792],{},"Web App",[376,5794,378],{},[386,5796,5797,5808,5819,5828],{},[373,5798,5799,5802,5805],{},[391,5800,5801],{},"Missing \"W\" on meridian",[391,5803,5804],{},"May auto-correct",[391,5806,5807],{},"Returns empty",[373,5809,5810,5813,5816],{},[391,5811,5812],{},"Extra spaces",[391,5814,5815],{},"Handled",[391,5817,5818],{},"May cause issues",[373,5820,5821,5824,5826],{},[391,5822,5823],{},"Mixed case",[391,5825,5815],{},[391,5827,5815],{},[373,5829,5830,5833,5836],{},[391,5831,5832],{},"Partial descriptions",[391,5834,5835],{},"Shows suggestions",[391,5837,5807],{},[15,5839,5840],{},"When building API integrations, always normalize your input first:",[43,5842,5843,5846,5849,5852],{},[46,5844,5845],{},"Include dashes between all components",[46,5847,5848],{},"Add the \"W\" prefix on meridians",[46,5850,5851],{},"Remove extra text, parentheses, and place names",[46,5853,5854],{},"Trim whitespace",[10,5856,5858],{"id":5857},"integration-patterns","Integration patterns",[301,5860,5862],{"id":5861},"caching","Caching",[15,5864,5865,5866,5869],{},"If your application looks up the same legal descriptions repeatedly, cache the results. Legal land descriptions map to fixed coordinates - the result for ",[19,5867,5868],{},"SW-25-24-1-W5"," will not change.",[301,5871,5873],{"id":5872},"error-handling","Error handling",[15,5875,5876],{},"Always handle these response codes:",[43,5878,5879,5884,5889,5894,5899],{},[46,5880,5881,5883],{},[64,5882,504],{}," - Success, parse the result",[46,5885,5886,5888],{},[64,5887,172],{}," - Bad request, check your input format",[46,5890,5891,5893],{},[64,5892,3109],{}," - Authentication failed, check your API key",[46,5895,5896,5898],{},[64,5897,1283],{}," - Rate limited, wait and retry",[46,5900,5901,5904],{},[64,5902,5903],{},"500\u002F502\u002F503"," - Server issue, retry after a short delay",[301,5906,5908],{"id":5907},"openapi-spec","OpenAPI spec",[15,5910,5911,5912,5915],{},"Download the OpenAPI specification at ",[50,5913,5914],{"href":5914},"\u002Fopenapi.yaml"," and import it into Postman, Swagger UI, or Insomnia for interactive testing and documentation.",[10,5917,4042],{"id":4041},[43,5919,5920,5926,5932,5939,5944],{},[46,5921,5922,5925],{},[50,5923,5924],{"href":4121},"API Integration Guide"," - getting started with the API",[46,5927,5928,5931],{},[50,5929,5930],{"href":90},"API Key Management"," - creating and managing API keys",[46,5933,5934,5938],{},[50,5935,5937],{"href":5936},"\u002Fguides\u002Fsearch-api-guide","Search API Guide"," - single-location lookups",[46,5940,5941,5943],{},[50,5942,4948],{"href":3543}," - bulk conversions",[46,5945,5946,5949],{},[50,5947,5948],{"href":5267},"Coverage & Limitations"," - what regions and resolutions are supported",[3626,5951,5952],{},"html pre.shiki code .soVBu, html code.shiki .soVBu{--shiki-light:#39ADB5;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .s4Jsk, html code.shiki .s4Jsk{--shiki-light:#39ADB5;--shiki-default:#99841877;--shiki-dark:#B8A96577}html pre.shiki code .sLorS, html code.shiki .sLorS{--shiki-light:#9C3EDA;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .sbYkP, html code.shiki .sbYkP{--shiki-light:#39ADB5;--shiki-default:#B5695977;--shiki-dark:#C98A7D77}html pre.shiki code .sTbE_, html code.shiki .sTbE_{--shiki-light:#91B859;--shiki-default:#B56959;--shiki-dark:#C98A7D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sYn-s, html code.shiki .sYn-s{--shiki-light:#E2931D;--shiki-default:#59873A;--shiki-dark:#80A665}html pre.shiki code .sz9Cv, html code.shiki .sz9Cv{--shiki-light:#91B859;--shiki-default:#A65E2B;--shiki-dark:#C99076}html pre.shiki code .se3Ec, html code.shiki .se3Ec{--shiki-light:#90A4AE;--shiki-default:#A65E2B;--shiki-dark:#C99076}html pre.shiki code .s9Tkl, html code.shiki .s9Tkl{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#A0ADA0;--shiki-default-font-style:inherit;--shiki-dark:#758575DD;--shiki-dark-font-style:inherit}html pre.shiki code .siDh9, html code.shiki .siDh9{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#1E754F;--shiki-default-font-style:inherit;--shiki-dark:#4D9375;--shiki-dark-font-style:inherit}html pre.shiki code .snCua, html code.shiki .snCua{--shiki-light:#90A4AE;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .s5Kfy, html code.shiki .s5Kfy{--shiki-light:#9C3EDA;--shiki-default:#AB5959;--shiki-dark:#CB7676}html pre.shiki code .sSC40, html code.shiki .sSC40{--shiki-light:#90A4AE;--shiki-default:#B07D48;--shiki-dark:#BD976A}html pre.shiki code .sVsLi, html code.shiki .sVsLi{--shiki-light:#39ADB5;--shiki-default:#AB5959;--shiki-dark:#CB7676}html pre.shiki code .sljsM, html code.shiki .sljsM{--shiki-light:#6182B8;--shiki-default:#59873A;--shiki-dark:#80A665}html pre.shiki code .sLdnO, html code.shiki .sLdnO{--shiki-light:#E53935;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .sa2tF, html code.shiki .sa2tF{--shiki-light:#E2931D;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .sqOPj, html code.shiki .sqOPj{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#B07D48;--shiki-default-font-style:inherit;--shiki-dark:#BD976A;--shiki-dark-font-style:inherit}html pre.shiki code .sIOqK, html code.shiki .sIOqK{--shiki-light:#9C3EDA;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .s7CZa, html code.shiki .s7CZa{--shiki-light:#F76D47;--shiki-default:#2F798A;--shiki-dark:#4C9A91}html pre.shiki code .sftqT, html code.shiki .sftqT{--shiki-light:#90A4AE;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .siWMO, html code.shiki .siWMO{--shiki-light:#6182B8;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}",{"title":114,"searchDepth":143,"depth":143,"links":5954},[5955,5962,5963,5968,5969,5974],{"id":5013,"depth":143,"text":5014,"children":5956},[5957,5958,5959,5960,5961],{"id":5017,"depth":592,"text":5018},{"id":5108,"depth":592,"text":5109},{"id":5180,"depth":592,"text":5181},{"id":5213,"depth":592,"text":5214},{"id":5272,"depth":592,"text":5273},{"id":5309,"depth":143,"text":5310},{"id":5355,"depth":143,"text":5356,"children":5964},[5965,5966,5967],{"id":5359,"depth":592,"text":5360},{"id":5551,"depth":592,"text":5552},{"id":5763,"depth":592,"text":5764},{"id":5776,"depth":143,"text":5777},{"id":5857,"depth":143,"text":5858,"children":5970},[5971,5972,5973],{"id":5861,"depth":592,"text":5862},{"id":5872,"depth":592,"text":5873},{"id":5907,"depth":592,"text":5908},{"id":4041,"depth":143,"text":4042},"Fix common Township Canada API errors including Forbidden responses, CORS issues, rate limiting, and empty results. Includes debugging tips and integration patterns.","i-lucide-bug",{},"\u002Fguides\u002Fapi-troubleshooting",{"title":4996,"description":5975},"guides\u002Fapi-troubleshooting","HdzUEDIe1GOVH69SlHwojqw9Bq_zAV_jZq3C1AZmnJQ"]