Graniot API
  • Welcome!
  • Quick Start
  • Embedded Maps
  • Reference
    • API Reference
      • Accounts
      • Farms
        • Farm Managers
      • Parcels
        • Satellite Data
        • Plants
        • Crops
        • Weather Forecast
        • Historical weather data
      • Crops Families
      • Notes
  • Satellite Sources
    • Satellite Data Overview
    • Available Data Sources
      • Sentinel-2
      • PlanetScope
      • SkySat
      • Pleiades
      • PlĂ©iades Neo
      • Maxar
Powered by GitBook
On this page

Embedded Maps

PreviousQuick StartNextAPI Reference

Last updated 1 year ago

With embedded maps we provide the satellite images to the partners application with the minimum UI development effort.

A few line of code on the backend will offer the possibility to create a link for the embedded map to show directly in your frontend UI.

In order to get started with the Graniot API you need to create an account in the .

This step is essential in order to obtain the bearer token, that will allow you to generate the link to the embeddable maps.

curl https://app.graniot.com/api/accounts/ 
-X 'POST'
-H 'accept: application/json'
-H 'x-api-key: JqUhiQYb.fg6UFvPifAbZkuiKrpQ5VluWhSIXwlvcyUE06d4P7AWZEMqJp9AWQk2TXVsxDXWxqCt' 
-d '{ "account_email": "test@example.com" }'

# Response
# {
#   "id": "acc-52a220de-73e9-11ee-8cc3-0242ac130002",
#   "account_email": "test@example.com",
#   "embedded_url": "https://embed.graniot.com/?auth_id=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzA1NDk3NDIwLCJpYXQiOjE3MDU0ODY2MjAsImp0aSI6ImRiYzRhNmZjNDI3MTRhZGE5NWM4Y2YwMDMyMjM1ZjNjIiwiaWQiOjc0Nn0.ZKpAG0sVAbibxJEKPSS0hbYmH--lahQKJhEtPO7Jau4",
#   "account_access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzA1NDk3NDIwLCJpYXQiOjE3MDU0ODY2MjAsImp0aSI6IjIzOWQzZGM2MDRmYzRmODNhNGNmNDQyMDQ3NDI3N2ZmIiwiaWQiOjc0Nn0.PbUJGOTQaL2Z6dZZ0DcwDW8BM_rp2saRqDz7MLAlHWY"
#  }
import json
import requests

GRANIOT_API_ENDPOINT = 'https://app.graniot.com/api/'
HEADERS = {
  'Content-Type': "application/json", 
  'x-api-key': 'JqUhiQYb.fg6UFvPifAbZkuiKrpQ5VluWhSIXwlvcyUE06d4P7AWZEMqJp9AWQk2TXVsxDXWxqCt'
}

path = 'accounts/'

data = { 'account_email': 'test@example.com' }

res = requests.post(f"{GRANIOT_API_ENDPOINT}{path}", headers=HEADERS, json=data)
account = res.json()

# Response
# {
#   "id": "acc-52a220de-73e9-11ee-8cc3-0242ac130002",
#   "account_email": "test@example.com",
#   "embedded_url": "https://embed.graniot.com/?auth_id=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzA1NDk3NDIwLCJpYXQiOjE3MDU0ODY2MjAsImp0aSI6ImRiYzRhNmZjNDI3MTRhZGE5NWM4Y2YwMDMyMjM1ZjNjIiwiaWQiOjc0Nn0.ZKpAG0sVAbibxJEKPSS0hbYmH--lahQKJhEtPO7Jau4",
#   "account_access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzA1NDk3NDIwLCJpYXQiOjE3MDU0ODY2MjAsImp0aSI6IjIzOWQzZGM2MDRmYzRmODNhNGNmNDQyMDQ3NDI3N2ZmIiwiaWQiOjc0Nn0.PbUJGOTQaL2Z6dZZ0DcwDW8BM_rp2saRqDz7MLAlHWY"
#  }

Just pick the "embedded_url" and you can show the embedded map with satellite images to your users or see it directly in the browser.

The embedded map also provides some useful filtering capabilities, here a complete list of the accepted ulr params:

key
Description

auth_id

JWT token to view authenticated embedded map

resolution

Choose the resolution of the images to show to your account. Deafult the 10x10 meters resolution will be displayed.

parcels

Filter parcels that can be viewed in the map. Multiple parameters with this key can be provieded. Default all the parcels will be displayed.

farms

Filter farms that can be viewed in the map. Multiple parameters with this key can be provieded. Default all the farms will be displayed.

metadata[foo_key]

Filter parcels that can be viewed in the map. Multiple parameters with this key can be provieded. Default all the farms will be displayed.

Examples Embedded Maps

Choose between multiple satellite indexes

Clear view without drawer

Multiple base maps with DTM level curves

Mobile view

Graniot APP