Measure MapAPI

Quickstart

Create a sandbox key, make your first request, and read a project's measurements, in five minutes.

This walk-through uses a sandbox key, so nothing you do touches your real projects. You need an account on the Enterprise or Open Guest plan.

1. Create a sandbox key#

  1. Open the Developer page in the app (Developer, under Advanced in the dashboard menu).
  2. At the top of the key card, switch to Sandbox.
  3. Under Access for the new key, set Projects to Read and write.
  4. Press Generate new key, then copy the key with the copy button.

Keep the key out of your code: put it in an environment variable.

macOS and Linux
export MMO_API_KEY="paste-your-sandbox-key-here"

2. Check the API#

The status endpoint needs no key. If this answers, you can reach the API:

Shell
curl https://api.measuremaponline.com/api/v1/
JSON
{"name": "Measure Map Online Public API", "version": "0.5.0"}

3. Create a project#

Shell
curl -X POST https://api.measuremaponline.com/api/v1/projects/new \
  -H "Authorization: $MMO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "My first API project", "description": "Made with the quickstart"}'

The answer is the new project. Note its id and its creatorUid, which is your account's ID:

JSON
{
  "type": "project",
  "id": "Xr7Lp2Qm9KdT4wZs",
  "creatorUid": "m3K8qZxLpV4NrT2w",
  "name": "My first API project",
  "description": "Made with the quickstart",
  "createdOn": 1791980000000,
  "totalPolygons": 0,
  "totalSpots": 0,
  "members": ["m3K8qZxLpV4NrT2w"],
  "commentsEnabled": false
}

4. List your projects#

Use your account's ID (the creatorUid above) to list your projects, a page at a time:

Shell
curl "https://api.measuremaponline.com/api/v1/users/YOUR_ACCOUNT_ID/projects?page=1&limit=20" \
  -H "Authorization: $MMO_API_KEY"

5. Read the measurements#

Ask for everything drawn on the project:

Shell
curl https://api.measuremaponline.com/api/v1/projects/PROJECT_ID/data \
  -H "Authorization: $MMO_API_KEY"

A project made through the API starts empty, so this answers []. Sandbox projects live apart from your real ones and are not shown in the app; to see real measurements, create a live key with Projects: Read only and ask for one of your own projects. Each area comes with its totalArea in square metres, its totalPerimeter in metres and its corners. See Get a project's measurements.

6. Clean up#

Shell
curl -X DELETE https://api.measuremaponline.com/api/v1/projects/PROJECT_ID \
  -H "Authorization: $MMO_API_KEY"

Next steps#