How to Get XYZ URL for a Specific Scene/Item?

To get the XYZ URL, request it using API Tile Services.

The API Tile Service and Basemap Tile Service make it easy to visualize Planet imagery in desktop or web mapping applications that support either the XYZ or WMTS protocol. These services offer a low-friction way for web developers and GIS analysts to interact with, and derive value from Planet imagery without the need for further image processing.

More information is available in the Tile Services Overview.


An Example Request in Python

API Tile Service Request Structure{api-key}


API Tile Service Request in Python with Basic HTTP Authentication

import os
# import os module to access enviornmental modules

import requests
from requests.auth import HTTPBasicAuth
# import helper functions to make Basic request to Planet API

PLANET_API_KEY = os.getenv('PL_API_KEY')
# Setup the API Key from the `PL_API_KEY` environment variable

BASE_URL = 'https://tiles{0-3}{item_type}/{item_id}/{z}/{x}/{y}.png'

if PLANET_API_KEY is None:
    PLANET_API_KEY = '12345'
# pass in your API key

auth = HTTPBasicAuth(PLANET_API_KEY, '')
# HTTPBasicAuth() wants a username & password; you can pass an empty string for the password

res = requests.get(url=BASE_URL, auth=auth)

# make a request to Tile Services API and test the response
Parameter Value
item_type Item type of the item to view.
item_id Item id of the item to view.
z Tile zoom level.
x Tile row in the grid.
y Tile column in the grid
Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.