Native Land Digital has provided an open, relatively easy API since the early days — ever since Canadian Encyclopedia asked us to develop an embed that they could use across their website. Since then, as the site’s data has grown, the API has also grown and it’s been used in many fantastic projects. A couple of these include:

We still get a ton of questions and requests for help when it comes to the API — or a lot of times, people don’t even know it’s there!

In this post, we’ll take you through a few typical use cases that we run into, and how to work through using the Native Land API to tackle these issues.

A Precaution

You should be totally aware of what we state in the Disclaimer on our front page. Our map is NOT a legal resource, and is not meant to be an academic-level representation of Indigenous lands. Our goal is, most of all, to represent Indigenous territories according to Indigenous nations they represent. We are not primarily after extremely precise geographic fidelity, textbook accuracy, or sources that correspond with government data.

You should inform users that this data is often changing, that it may be inaccurate, and that they should take the time to get in touch with local nations or peoples in order to learn more than our map could ever represent. If you don’t do this, people might just take it for granted that this information is totally correct — when it’s not!

Please be careful with how you use the data. If you’re at all concerned, email us at [email protected].

The Simple Embed

We provide a direct embed, so that you can load up a version of our map with specific nations you want to make visible. This doesn’t embed our entire map — to do that, you’re best off downloading the coordinates and making your own map — but this allows you to quickly show a nation or a few languages without having to learn how to work with geographic data in the browser.

EXAMPLE EMBED URL: https://native-land.ca/api/embed/embed.html?maps=languages&name=witsuwiten,nakota

Parameters

The request you give to the embed URL is passed straight through to the API. So position requests and nation requests should work equally well. See Nation requests and Querying A Position below.

Example

<iframe height="400" width="400" src="https://native-land.ca/api/embed/embed.html?maps=languages&name=witsuwiten,nakota"></iframe>

Querying Territories / Languages / Treaties

This allows you to fetch a specific territory, treaty, or language, based on its “slug” registered in Native Land’s database. These slugs don’t always correspond to the nation’s name, because we might make changes to the name over time, but the slug was created when the geographic shape was first added to our map. These should be stable. We do have a problem with some slugs, particularly in South America, being duplicated, but we are working on getting that problem fixed very soon.

You can find a list of slugs alongside the names on the API docs page. Click the right-hand side to expand the territories, languages, or treaties dataset. It may take a while to load, and then use Ctrl+F to find the nation name you’re looking for, and you’ll find the slug beside it.

GET REQUEST: https://native-land.ca/api/

Parameters

name = (string): <slug> (can be multiple, comma separated)
type = (string): territories,treaties,languages

Example

fetch('https://native-land.ca/api/?maps=territories&name=achagua,tumbalala')
   .then(resp => resp.json())
   .then(response => {
       console.log(response) // Gives back a geoJSON
   })

Querying a Position

This functionality allows you to provide a latitude and longitude, and get back a list of territories, languages, and/or treaties that contain that point. This does a point-in-polygon analysis on our geoJSON dataset and returns any matching results as a geoJSON.

You may select multiple types (territories, languages, treaties) at once, but can only submit a single lat/lng at a time.

GET REQUEST: https://native-land.ca/api/

Parameters

position = (string): lat,lng
type = (string): territories,treaties,languages

Example

fetch('https://native-land.ca/api/?maps=languages&position=42.553080,-86.473389')
   .then(resp => resp.json())
   .then(response => {
       console.log(response) // Gives back a geoJSON
   })

Spatial Analysis & Project Integration

If you want to run more complex spatial analysis than the API provides — for instance, finding how many territories are in the United States, or square footage of land — you’ll have to download the raw geoJSONs yourself and do some analysis on them using a tool like QGIS or ArcGIS.

You can find the coordinate files at the top of the API docs page.

These are the files we generate and use ourselves for the site — so do whatever you need with them! They are updated daily from our Mapbox dataset.

Thanks for using the API responsibly!

We are open to more suggestions, too, if you have a basic API functionality that you need that we don’t provide.

Posted by Victor Temprano
Friday, July 30th, 2021

Comments are closed.