- Go 100%
- New C `readTIFFBandRect` reads one band’s sub-rect from a planar/tiled TIFF (8- and 16-bit). - New `ReadTIFFBandRect` + `BandRect` API; added `SPP` to `GeoMeta`. |
||
|---|---|---|
| cmd/planet | ||
| example/items-and-assets | ||
| .air.toml | ||
| .gitignore | ||
| assets.go | ||
| basemaps.go | ||
| basemaps_test.go | ||
| bbox.go | ||
| catalog.go | ||
| client.go | ||
| errors.go | ||
| go.mod | ||
| go.sum | ||
| io.go | ||
| item_type.go | ||
| lefthook.yml | ||
| order.go | ||
| png.go | ||
| README.md | ||
| search.go | ||
| stac.go | ||
| tiff_cgo.go | ||
| tiff_stub.go | ||
go-planet
This is an API client for the Planet API in go. It aims to support all operations of the API. It's okay.
CLI
A planet command-line tool is included for working with downloaded Planet data.
Build
CGO_ENABLED=1 go build ./cmd/planet/
Troubleshooting TLS / Proxy
If you use a debugging proxy like mitmproxy (set via HTTPS_PROXY, http_proxy, or
ALL_PROXY), TLS certificate verification will fail with an error like:
Error: Get "https://api.planet.com/...": tls: failed to verify certificate: x509: certificate signed by unknown authority
Set INSECURE_HTTPS=1 to skip TLS certificate verification:
INSECURE_HTTPS=1 HTTPS_PROXY=http://localhost:8080 planet order list
import-download
Import Planet order zip archives into the local cache. Each archive is extracted into a
subdirectory named by the item ID found in the archive's manifest.json.
planet import-download ./download/*.zip
The destination directory is controlled by the PLANET_IMPORT_DIR environment variable.
If unset, files go to the XDG cache directory (~/.cache/planet/imports).
PLANET_IMPORT_DIR=/data/planet planet import-download order1.zip order2.zip
import-list
List imported items and their data-bearing assets (imagery and analytic metadata):
planet import-list
Output shows each item's ID, item type, bundle type, order name, and the data files it contains with their asset types:
20260617_191956_25_252d PSScene analytic_sr_udm2 Visalia Medium Test 1
PSScene/20260617_191956_25_252d_3B_AnalyticMS_SR_clip.tif (ortho_analytic_4b_sr)
PSScene/20260617_191956_25_252d_3B_udm2_clip.tif (ortho_udm2)
PSScene/20260617_191956_25_252d_3B_AnalyticMS_metadata_clip.xml (ortho_analytic_4b_xml)
export
Export GeoTIFF imagery as PNG images clipped to a GPS bounding box. The bounding box
is specified in WGS84 (EPSG:4326) as west,south,east,north.
# Export a specific item
planet export --bbox "-119.32,36.31,-119.29,36.34" 20260617_191956_25_252d
# Export all imported items
planet export --bbox "-119.32,36.31,-119.29,36.34" --all
# Custom output directory
planet export --bbox "-119.3,36.3,-119.28,36.34" --all -o /tmp/exports
# Apply contrast stretch for surface reflectance imagery
planet export --bbox "-119.3,36.3,-119.28,36.34" --all --normalize
Only imagery with 1 to 4 bands is exported. Multi-band files (e.g., 8-band UDM2 masks) are skipped with a warning. For 4-band imagery (e.g., RGB+NIR), only the first three bands (RGB) are written to the PNG.
The --normalize flag applies a per-band min-max contrast stretch to the clipped
region. This is essential for surface reflectance products (analytic_sr,
analytic_8b_sr) whose 16-bit data would otherwise appear washed out when
truncated to 8-bit. For products already in a visual color space (e.g., ortho_visual),
normalization can also improve contrast in shadowed or low-light areas.
order
Create, list, get, cancel, wait for, download, and view results of orders via the Planet Orders API.
Requires PLANET_API_TOKEN to be set. All subcommands print JSON to stdout.
# Stats (no order creation needed)
planet order stats
# List recent orders
planet order list
# List with filters
planet order list --state success --sort-by "created_on DESC" --page-size 5
# Create a simple scenes order (direct download)
planet order create \
--name "my-order" \
--item-ids 20220304_093300_37_2430 \
--item-type PSScene \
--bundle analytic_udm2
# Create with clip tool (GeoJSON geometry file)
planet order create \
--name "clipped-order" \
--item-ids 20220304_093300_37_2430 \
--item-type PSScene \
--bundle analytic_sr_udm2 \
--clip aoi.geojson
# Create from a full JSON request file
planet order create --from-json request.json
# Get order details
planet order get <order-id>
# Wait for an order to complete (poll every 10 seconds)
planet order wait <order-id> --poll 10
# Download all results from a completed order
planet order download <order-id> -o ./data/
# Wait then download
planet order download <order-id> -o ./data/ --wait
# Cancel a queued order
planet order cancel <order-id>
# Bulk cancel multiple orders
planet order cancel <id1> <id2> <id3>
# Cancel all queued orders
planet order cancel --all
# View downloadable results for a completed order
planet order results <order-id>
catalog
Query the STAC-based Planet Catalog API on
services.sentinel-hub.com. All subcommands print JSON to stdout.
Authentication: The Catalog API uses OAuth2 Bearer tokens. Set credentials via environment variables and the library manages token acquisition, caching, and refresh:
| Variable | Description |
|---|---|
PLANET_CATALOG_CLIENT_ID |
Sentinel Hub OAuth2 client ID (required) |
PLANET_CATALOG_CLIENT_SECRET |
Sentinel Hub OAuth2 client secret (required) |
The token is automatically obtained via the client credentials grant on first use
and cached to $XDG_CACHE_HOME/planet/catalog-token.json (default ~/.cache/planet/).
When the token expires, the library refreshes it transparently before the next API call.
If client credentials fail and stdin is a terminal, the library falls back to the authorization code flow: it prints a URL and starts a local callback server so you can authorize in your browser.
See the Sentinel Hub auth docs to register a client ID and secret.
# List all available collections
planet catalog collections
# Get a single collection
planet catalog collections sentinel-2-l1c
# Get filter parameters (queryables) for a collection
planet catalog queryables sentinel-1-grd
# Simple POST search with bbox, datetime, and collections
planet catalog search \
--bbox 13,45,14,46 \
--datetime "2019-12-10T00:00:00Z/2019-12-11T00:00:00Z" \
--collections sentinel-1-grd \
--limit 5
# Search with GeoJSON intersection (Point, Polygon, etc.)
planet catalog search \
--intersects aoi.geojson \
--collections sentinel-2-l1c \
--limit 10
# Search with CQL2 text filter
planet catalog search \
--bbox 13,45,14,46 \
--datetime "2019-12-10T00:00:00Z/2019-12-11T00:00:00Z" \
--collections sentinel-1-grd \
--limit 5 \
--filter "sat:orbit_state='ascending'"
# Field selection: include only specific properties
planet catalog search \
--bbox 13,45,14,46 \
--datetime "2019-12-10T00:00:00Z/2019-12-11T00:00:00Z" \
--collections sentinel-2-l1c \
--limit 1 \
--fields-include "properties.gsd,properties.datetime"
# Field selection: exclude default fields
planet catalog search \
--bbox 13,45,14,46 \
--datetime "2019-12-10T00:00:00Z/2019-12-11T00:00:00Z" \
--collections sentinel-2-l1c \
--limit 1 \
--fields-exclude "properties.datetime"
# Empty fields (only id, type, geometry, bbox, links, assets)
planet catalog search \
--bbox 13,45,14,46 \
--datetime "2019-12-10T00:00:00Z/2019-12-11T00:00:00Z" \
--collections sentinel-2-l1c \
--limit 1 \
--fields-include ""
# Distinct values: list dates with available data
planet catalog search \
--bbox 13,45,14,46 \
--datetime "2019-12-01T00:00:00Z/2020-01-01T00:00:00Z" \
--collections sentinel-1-grd \
--limit 100 \
--distinct date
# Distinct values: list instrument modes
planet catalog search \
--bbox 13,45,14,46 \
--datetime "2019-12-01T00:00:00Z/2020-01-01T00:00:00Z" \
--collections sentinel-1-grd \
--limit 100 \
--distinct "sar:instrument_mode"
# Search with pagination (use --next from response)
planet catalog search \
--bbox 13,45,14,46 \
--collections sentinel-1-grd \
--limit 5 \
--next "<token-from-previous-response>"
# Search on your own BYOC collection
planet catalog search \
--bbox 13,45,14,46 \
--datetime "2019-12-10T00:00:00Z/2019-12-10T23:59:59Z" \
--collections "byoc-<your-collection-id>" \
--limit 5
# Get a single STAC item
planet catalog get sentinel-2-l1c <item-id>
# Sort results by property
planet catalog search \
--bbox 13,45,14,46 \
--collections sentinel-2-l1c \
--limit 5 \
--sort-by "properties.datetime:desc"
Full workflow
# 1. Import downloaded Planet order zips
planet import-download ~/Downloads/planet-order-*.zip
# 2. List what was imported
planet import-list
# 3. Export a region of interest as PNG (with contrast stretch for SR data)
planet export --bbox "-119.32,36.31,-119.29,36.34" --all -o ./exports/ --normalize
Items
In my wrath I'm going to write what I can about what limitations I'm finding with Planet's demo account. Here is the list of "items" the demo account has access to:
| id | name | description |
|---|---|---|
| PelicanScene | Pelican Scene | "One tile of a Pelican strip collection" |
| PSScene | PlanetScope Scene | "8-band PlanetScope imagery that is framed as captured." |
| REOrthoTile | RapidEye Ortho Tile | "RapidEye orthorectified 5-band imagery as 25km x 25km UTM tiles" |
| REScene | RapidEye Basic Scene | "RapidEye basic 5-band imagery with strip-based framing" |
| SkySatCollect | SkySat Collect | "SkySat imagery with strip-based framing" |
| SkySatScene | SkySat Scene | "SkySat imagery that is framed as captured" |
| SkySatVideo | SkySat Video | "SkySat video product" |
| TanagerScene | Tanager Scene | "Tanager Hyperspectral Imagery" |
| TanagerMethane | Tanager Methane | "Tanager Methane Derived Products" |
Assets
| id | name | description |
|---|---|---|
| basic_l1a_all_frames | Zip file containing all L1A frames, RPCs, and pinhole json files | Compressed folder with all basic l1a panchromatic frames and accompanying RPCs and pinhole json files that make up the collect |
| analytic | Analytic image (4 Band) | Radiometrically-calibrated analytic image stored as 16-bit scaled radiance |
| analytic_sr | Atmospherically corrected surface reflectance (4 Band) | PlanetScope atmospherically corrected surface reflectance product |
| analytic_xml | Analytic image metadata (4 Band) | Radiometrically-calibrated analytic image metadata |
| basic_analytic | Basic analytic image (4 Band) | Unorthorectified radiometrically-calibrated analytic image stored as 16-bit scaled radiance |
| basic_analytic_4b_rpc | Unprojected top of atmosphere radiance (4 Band) rational polynomial coefficients for rectification | Rational polynomial coefficients for unorthorectified analytic image |
| basic_analytic_4b | Unprojected top of atmosphere radiance (4 Band) | Unorthorectified radiometrically-calibrated analytic image stored as 16-bit scaled radiance. |
| basic_analytic_4b_xml | Unprojected top of atmosphere radiance (4 Band) metadata | Unorthorectified radiometrically-calibrated analytic image metadata. |
| basic_analytic_8b | Unprojected top of atmosphere radiance (8 Band) | Unorthorectified radiometrically-calibrated analytic image stored as 16-bit scaled radiance. |
| basic_analytic_8b_xml | Unprojected top of atmosphere radiance (8 Band) metadata | Unorthorectified radiometrically-calibrated analytic image metadata |
| basic_analytic_b1 | Blue Band (Band1) of the Analytic Basic scene | RapidEye band 1 (Blue) scaled Top of Atmosphere Radiance (at sensor) and Sensor corrected, Basic Scene product designed for users with advanced image processing and geometric correction capabilities. Scene based framing and not projected to a cartographic projection. |
| basic_analytic_b1_nitf | Blue Band (Band1) of the Analytic Basic scene in the NITF format | RapidEye band 1 (Blue) scaled Top of Atmosphere Radiance (at sensor) and Sensor corrected, Basic Scene product in the NITF format, designed for users with advanced image processing and geometric correction capabilities. Scene based framing and not projected to a cartographic projection. |
| basic_analytic_b2 | Green Band (Band2) of the Analytic Basic scene | RapidEye band 2 (Green) scaled Top of Atmosphere Radiance (at sensor) and Sensor corrected, Basic Scene product designed for users with advanced image processing and geometric correction capabilities. Scene based framing and not projected to a cartographic projection. |
| basic_analytic_b2_nitf | Green Band (Band2) of the Analytic Basic scene in the NITF format | RapidEye band 2 (Green) scaled Top of Atmosphere Radiance (at sensor) and Sensor corrected, Basic Scene product in the NITF format, designed for users with advanced image processing and geometric correction capabilities. Scene based framing and not projected to a cartographic projection . |
| basic_analytic_b3 | Red Band (Band3) of the Analytic Basic scene | RapidEye band 3 (Red) scaled Top of Atmosphere Radiance (at sensor) and Sensor corrected, Basic Scene product designed for users with advanced image processing and geometric correction capabilities. Scene based framing and not projected to a cartographic projection. |
| basic_analytic_b3_nitf | Red Band (Band3) of the Analytic Basic scene in the NITF format | RapidEye band 3 (Red) scaled Top of Atmosphere Radiance (at sensor) and Sensor corrected, Basic Scene product in the NITF format, designed for users with advanced image processing and geometric correction capabilities. Scene based framing and not projected to a cartographic projection. |
| basic_analytic_b4 | Red Edge Band (Band4) of the Analytic Basic scene | RapidEye band 4 (Red Edge) scaled Top of Atmosphere Radiance (at sensor) and Sensor corrected, Basic Scene product designed for users with advanced image processing and geometric correction capabilities. Scene based framing and not projected to a cartographic projection. |
| basic_analytic_b4_nitf | Red Edge Band (Band4) of the Analytic Basic scene in the NITF format | RapidEye band 4 (Red Edge) scaled Top of Atmosphere Radiance (at sensor) and Sensor corrected, Basic Scene product in the NITF format, designed for users with advanced image processing and geometric correction capabilities. Scene based framing and not projected to a cartographic projection. |
| basic_analytic_b5 | NearInfrared Band (Band5) of the Analytic Basic scene | RapidEye band 5 (Near-infrared) scaled Top of Atmosphere Radiance (at sensor) and Sensor corrected, Basic Scene product designed for users with advanced image processing and geometric correction capabilities. Scene based framing and not projected to a cartographic projection. |
| basic_analytic_b5_nitf | Near Infrared Band (Band5) of the Analytic Basic scene in the NITF format | RapidEye band 5 (Near Infrared) scaled Top of Atmosphere Radiance (at sensor) and Sensorcorrected, Basic Scene product in the NITF format, designed for users with advanced image processing and geometric correction capabilities. Scene based framing and not projected to a cartographic projection. |
| basic_analytic_dn | Basic analytic digital number image | Unorthorectified non-radiometrically-calibrated analytic image stored as 12-bit digital numbers |
| basic_analytic_dn_rpc | RPC for basic analytic digital number image | Rational polynomial coefficients for unorthorectified non-radiometrically-calibrated analytic image |
| basic_analytic_rpc | Unprojected top of atmosphere radiance (4 Band) rational polynomial coefficients for rectification | Rational polynomial coefficients for unorthorectified analytic image |
| basic_analytic_sci | Spacecraft Information XML Metadata file | The RapidEye Spacecraft Information XML Metadata file. |
| basic_analytic_udm | Basic Analytic UDM | Unorthorectified unusable data mask |
| basic_analytic_udm2 | Basic Analytic UDM2 | Unorthorectified usable data mask (Cloud 2.0) |
| basic_analytic_xml | Basic analytic image metadata (4 Band) | Unorthorectified radiometrically-calibrated analytic image metadata |
| basic_analytic_xml_nitf | Basic analytic image metadata in NITF format | Unorthorectified radiometrically-calibrated analytic image metadata in NITF format |
| basic_beta_udm | Basic UDM | Unorthorectified usable data mask (in beta), in GeoTIFF format. |
| basic_l1a_panchromatic | Basic level 1A panchromatic scaled radiance image | Unorthorectified Radiometrically-calibrated panchromatic image stored as 16-bit scaled radiance |
| basic_l1a_panchromatic_rpc | RPC for Basic level 1A panchromatic scaled radiance image | Rational polynomial coefficients for Unorthorectified Radiometrically-calibrated panchromatic image |
| basic_l1a_panchromatic_dn | Basic level 1A panchromatic digital number image | Unorthorectified non-radiometrically-calibrated panchromatic image stored as 12-bit digital numbers |
| basic_l1a_panchromatic_dn_rpc | RPC for basic level 1A panchromatic digital number image | Rational polynomial coefficients for unorthorectified non-radiometrically-calibrated panchromatic image |
| basic_panchromatic | Basic Scene Panchromatic scaled radiance Image | Unorthorectified Radiometrically-calibrated panchromatic image stored as 16-bit scaled radiance |
| basic_panchromatic_dn | Basic Scene Panchromatic | This is a Basic Scene Panchromatic DN Image |
| basic_panchromatic_dn_rpc | Basic Panchromatic RPC File | This is a Basic Panchromatic DN RPC File |
| basic_panchromatic_rpc | Basic Panchromatic RPC File | Rational polynomial coefficients for unorthorectified panchromatic image |
| basic_panchromatic_udm2 | Basic Panchromatic UDM2 | Unorthorectified usable data mask (Cloud 2.0) |
| basic_radiance_hdf5 | Basic Top of Atmosphere Radiance | Unorthorectified, Top of atmosphere radiance (at sensor) calibrated, in HDF5 format. Not projected to a cartographic projection. |
| basic_sr_hdf5 | Basic Surface Reflectance | Unorthorectified, atmospherically corrected surface reflectance product, in HDF5 format. Not projected to a cartographic projection. |
| basic_udm | Basic UDM | Unorthorectified usable data mask |
| basic_udm2 | Unprojected UDM2 | Unorthorectified usable data mask (Cloud 2.0) Read more about this new asset here. |
| browse | Basic Scene browse image | Visual browse image for the Basic Scene product. |
| ql_ch4_json | Preliminary Plume Metadata | Preliminary plume locations, length, size in kg/hr and confidence measure indicating the level of visual interpretation certainty, in GeoJSON form at. |
| geolocation_array | Geolocation Array | Longitudes and Latitudes in WGS84 of centers of pixels, in GeoTIFF format. |
| ortho_analytic | Orthorectified Analytic Image | Orthorectified 16-bit 4-Band radiometrically corrected Image |
| ortho_analytic_3b | Orthorectified top of atmosphere radiance (3 Band) | Radiometrically-calibrated 3-band analytic image stored as 16-bit scaled radiance. |
| ortho_analytic_3b_xml | Orthorectified top of atmosphere radiance (3 Band) metadata | Radiometrically-calibrated analytic image metadata. |
| ortho_analytic_4b | Orthorectified top of atmosphere radiance (4 Band) | Radiometrically-calibrated 4-band analytic image stored as 16-bit scaled radiance. |
| ortho_analytic_4b_sr | Orthorectified atmospherically corrected surface reflectance (4 Band) | PlanetScope atmospherically corrected surface reflectance product. |
| ortho_analytic_4b_xml | Orthorectified atmospherically corrected surface reflectance (4 Band) metadata | Radiometrically-calibrated analytic image metadata. |
| ortho_analytic_8b | Orthorectified top of atmosphere radiance (8 Band) | Radiometrically-calibrated 8-band analytic image stored as 16-bit scaled radiance. |
| ortho_analytic_8b_sr | Orthorectified atmospherically corrected surface reflectance (8 Band) | PlanetScope atmospherically corrected surface reflectance product. |
| ortho_analytic_8b_xml | Orthorectified atmospherically corrected surface reflectance (8 Band) metadata | Radiometrically-calibrated analytic image metadata. |
| ortho_analytic_dn | Orthorectified Analytic Image | Orthorectified 16-bit 4-Band DN Image |
| ortho_analytic_sr | Atmospherically corrected surface reflectance product | Orthorectified product, radiometrically calibrated and atmospherically corrected to surface reflectance |
| ortho_analytic_udm | Orthorectified Analytic UDM | Orthorectified 16-bit 4-Band DN Image Unuseable Data Mask |
| ortho_analytic_udm2 | Ortho Analytic UDM2 | Orthorectified usable data mask (Cloud 2.0) |
| ortho_beta_udm | Orthorectified UDM | Orthorectified usable data mask (in beta), in GeoTIFF format. |
| ortho_ql_ch4 | Preliminary Plume Intensity | Preliminary 8-bit scaled methane plume intensity in (ppm-m) parts-per-million-meter, in GeoTIFF format. The image will contain an alpha channel indicating pixels with no plume detections. |
| ortho_panchromatic | Orthorectified Panchromatic scaled radiance Image | Orthorectified Radiometrically-calibrated panchromatic image stored as 16-bit scaled radiance |
| ortho_panchromatic_dn | Orthorectified Panchromatic Image | Orthorectified 16-bit 1-band Image |
| ortho_panchromatic_udm | Orthorectified Panchromatic UDM | Orthorectified 16-bit 1-band Image Unuseable Data Mask |
| ortho_panchromatic_udm2 | Ortho Panchromatic UDM2 | Unorthorectified usable data mask (Cloud 2.0) |
| ortho_pansharpened | Orthorectified Pansharpened Image | Orthorectified 16-bit 4-band Pansharpened Image |
| ortho_pansharpened_udm | Orthorectified Pansharpened UDM | Orthorectified 16-bit 4-band Pansharpened Image Unuseable Data Mask |
| ortho_pansharpened_udm2 | Ortho Pansharpened UDM2 | Orthorectified usable data mask (Cloud 2.0) |
| ortho_radiance_hdf5 | Orthorectified Top of Atmosphere Radiance | Orthorectified, Top of atmosphere radiance (at sensor) calibrated, in HDF5 format. |
| ortho_sr_hdf5 | Orthorectified Surface Reflectance | Orthorectified, atmospherically corrected surface reflectance product, in HDF5 format. |
| ortho_udm2 | Orthorectified UDM2 | Usable data mask (Cloud 2.0) |
| ortho_visual | Orthorectified color corrected visual image product (3 Band) | Visual image with color-correction |
| recent_monthly_mosaic | Recent Monthly Mosaic | RGB contextual baselayer from the most recent PlanetScope Global Monthly Mosaic, in GeoTIFF format. |
| udm | UDM | Usable data mask |
| video_file | mp4 video file | Video mp4 file of all overlapping basic l1a panchromatic frames |
| video_frames | Zip file containing all video frames and RPCs | Compressed folder with all basic l1a panchromatic frames and accompanying RPCs that make up the video file |
| video_metadata | video metadata | JSON document describing the composite location of the video capture, as well as time, elevation angle, and azimuth angle at the start and end of the colle |
| ction | ||
| visual | Visual image (3 Band) | Visual image with color-correction |
| visual_xml | Visual image metadata | Visual image metadata |
Finding Assets
From a conversation with the Planet AI:
I'm working on a free trial. I'm trying to test the API for getting assets. I make a GET request to https://api.planet.com/data/v1/item-types/PSScene/items/20260609_022123_81_2562/assets/ HTTP/2.0. I get back a status 200 and an empty response. What does that mean?
A 200 response with an empty body from the /assets endpoint almost always means your account does not have download permissions for that item. Assets empty response
How to confirm
Make a GET request to the item itself (without /assets):
GET https://api.planet.com/data/v1/item-types/PSScene/items/20260609_022123_81_2562/
In the response, check the _permissions and assets fields:
If _permissions is empty ([]), your account does not have download access to this item.
If _permissions lists entries like "assets.ortho_analytic_4b:download", you do have access.
What to do on a free trial
On a free trial, your download permissions are limited. To find items you do have access to, use the Planet Python SDK with the permission filter, which ensures search results only include items you can download:
planet data filter | planet data search PSScene
Or in Python, use the permission_filter when searching. Assets empty response
In short: the empty response is not a bug — it reflects that your trial account lacks download permissions for that specific scene.
Answer based on the following sources:
Assets link returning empty content? Data API community.planet.com/data-access-and-management-apis-99
Items and Assets in the Data API docs.planet.com/develop
Is there somewhere I can see the list of valid permissions to use in the filter?
The knowledge sources do not contain enough information to provide a complete list of valid permission values for the PermissionFilter. However, based on what is shown in the knowledge sources, the documented permission values are:
assets:download — matches any downloadable asset [Permission Filters](https://docs.planet.com/develop/apis/data/item-search/#permission-filters)
assets.<asset_type>:download — matches a specific asset type, for example assets.analytic:download or assets.ortho_analytic_4b:download [Data API Introduction](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/api_guides/data_api/planet_data_api_introduction.ipynb)
For a full list of valid asset types (which can be used in the assets.<asset_type>:download pattern), the knowledge sources point to the Item Types pages in the Planet docs — for example, the PSScene asset types page lists all available assets for that item type. Filter by asset
For the most authoritative and complete reference, I'd recommend checking the Data API reference documentation directly, as the knowledge sources don't include an exhaustive enumeration of all valid permission strings.
Searching
Quick Search
The SearchRequest struct supports all the filter types below. Pass a filter as the Filter field—the JSON serialization matches the Planet Data API exactly.
client, _ := planet.NewClient()
ctx := context.Background()
req := planet.SearchRequest{
ItemTypes: []string{"PSScene"},
Filter: planet.AndFilter{
Type: "AndFilter",
Config: []any{
planet.DateRangeFilter{
Type: "DateRangeFilter", FieldName: "acquired",
Config: planet.DateRangeConfig{
GTE: "2024-01-01T00:00:00Z",
LTE: "2024-01-31T00:00:00Z",
},
},
planet.StringInFilter{
Type: "StringInFilter", FieldName: "quality_category",
Config: []string{"standard"},
},
planet.RangeFilter{
Type: "RangeFilter", FieldName: "cloud_cover",
Config: planet.RangeConfig{LTE: ptr(0.1)},
},
planet.AssetFilter{
Type: "AssetFilter", Config: []string{"ortho_analytic_8b"},
},
planet.PermissionFilter{
Type: "PermissionFilter", Config: []string{"assets:download"},
},
},
},
}
resp, err := doPost[planet.SearchRequest, planet.SearchResponse](ctx, *client, "data/v1/quick-search", req)
Filter Types
DateRangeFilter
Filter by timestamp properties (acquired, published, updated).
planet.DateRangeFilter{
Type: "DateRangeFilter",
FieldName: "acquired",
Config: planet.DateRangeConfig{
GT: "2023-12-31T00:00:00Z",
LTE: "2024-01-31T00:00:00Z",
},
}
GeometryFilter
Filter by geographic footprint. Config accepts any GeoJSON-serializable struct. Use the Relation field to control the spatial predicate (intersects, contains, within, disjoint).
// Point
planet.GeometryFilter{
Type: "GeometryFilter",
FieldName: "geometry",
Config: planet.PointGeo{Type: "Point", Coordinates: []float64{-122.4, 37.8}},
}
// Polygon
planet.GeometryFilter{
Type: "GeometryFilter",
FieldName: "geometry",
Relation: planet.RelationContains,
Config: planet.PolygonGeo{
Type: "Polygon",
Coordinates: [][][]float64{{{
{-120.27, 38.34},
{-120.27, 38.74},
{-119.76, 38.74},
{-119.76, 38.34},
{-120.27, 38.34},
}}},
},
}
// Features API reference (as the search geometry, not the filter)
planet.SearchRequest{
ItemTypes: []string{"PSScene"},
Filter: ...,
Geometry: planet.FeatureRef{Type: "ref", Content: "pl:features/my/collection-id/feature-id"},
}
RangeFilter
Filter by numeric properties (cloud_cover, view_angle, gsd, etc.). Pointers distinguish 0 from "not set".
func ptr(v float64) *float64 { return &v }
// cloud_cover <= 0.1
planet.RangeFilter{
Type: "RangeFilter", FieldName: "cloud_cover",
Config: planet.RangeConfig{LTE: ptr(0.1)},
}
// 0.5 <= gsd <= 3.0
planet.RangeFilter{
Type: "RangeFilter", FieldName: "gsd",
Config: planet.RangeConfig{GTE: ptr(0.5), LTE: ptr(3.0)},
}
NumberInFilter
Match exact numeric values.
planet.NumberInFilter{
Type: "NumberInFilter", FieldName: "gsd",
Config: []float64{0.5, 3.0},
}
StringInFilter
Match string or boolean properties. Multiple values are OR'd.
// quality_category is 'standard' or 'test'
planet.StringInFilter{
Type: "StringInFilter", FieldName: "quality_category",
Config: []string{"standard", "test"},
}
// Boolean property: ground_control is true
planet.StringInFilter{
Type: "StringInFilter", FieldName: "ground_control",
Config: []string{"true"},
}
UpdateFilter
Match items where a property changed on or after a date (republishing events).
planet.UpdateFilter{
Type: "UpdateFilter", FieldName: "ground_control",
Config: planet.DateRangeConfig{GT: "2020-04-15T00:00:00Z"},
}
AssetFilter
Match items that have published specific asset types.
planet.AssetFilter{
Type: "AssetFilter",
Config: []string{"ortho_analytic_8b", "ortho_analytic_4b_sr"},
}
// Require BOTH assets (use AndFilter)
planet.AndFilter{
Type: "AndFilter",
Config: []any{
planet.AssetFilter{Type: "AssetFilter", Config: []string{"analytic_sr"}},
planet.AssetFilter{Type: "AssetFilter", Config: []string{"udm2"}},
},
}
PermissionFilter
Limit results to items you can download. Must be combined with other filters.
planet.PermissionFilter{
Type: "PermissionFilter",
Config: []string{"assets:download"},
}
Logical Filters: AndFilter, OrFilter, NotFilter
Combine filters for complex criteria.
// All conditions must match (typical top-level filter)
planet.AndFilter{
Type: "AndFilter",
Config: []any{
planet.DateRangeFilter{...},
planet.RangeFilter{...},
planet.AssetFilter{...},
planet.PermissionFilter{...},
},
}
// At least one condition must match
planet.OrFilter{
Type: "OrFilter",
Config: []any{
planet.RangeFilter{Type: "RangeFilter", FieldName: "visible_percent", Config: planet.RangeConfig{GTE: ptr(90)}},
planet.RangeFilter{Type: "RangeFilter", FieldName: "usable_data", Config: planet.RangeConfig{GTE: ptr(0.9)}},
},
}
// Negate a single filter
planet.NotFilter{
Type: "NotFilter",
Config: planet.StringInFilter{
Type: "StringInFilter", FieldName: "quality_category",
Config: []string{"test"},
},
}
Orders
Create an Order
Orders request the Planet platform to produce assets (clipped, reprojected, etc.) for one or more items or mosaics.
client, _ := planet.NewClient()
ctx := context.Background()
order, err := client.CreateOrder(ctx, planet.OrderRequest{
Name: "my-scene-order",
SourceType: planet.SourceTypeScenes,
Products: []planet.OrderProduct{{
ItemIDs: []string{"20260609_022123_81_2562"},
ItemType: "PSScene",
ProductBundle: planet.BundleAnalyticUDM2,
}},
})
With clip tool
Clip the output to an AOI geometry:
order, err := client.CreateOrder(ctx, planet.OrderRequest{
Name: "clipped-scene",
SourceType: planet.SourceTypeScenes,
Products: []planet.OrderProduct{{
ItemIDs: []string{"20260609_022123_81_2562"},
ItemType: "PSScene",
ProductBundle: planet.BundleAnalyticUDM2,
}},
Tools: []any{
map[string]any{"clip": planet.ClipToolAOI(planet.PointGeo{
Type: "Point", Coordinates: []float64{-122.4, 37.8},
})},
},
})
With TOAR and reproject tools
order, err := client.CreateOrder(ctx, planet.OrderRequest{
Name: "reprojected-scene",
SourceType: planet.SourceTypeScenes,
Products: []planet.OrderProduct{{
ItemIDs: []string{"20260609_022123_81_2562"},
ItemType: "PSScene",
ProductBundle: planet.BundleAnalyticUDM2,
}},
Tools: []any{
map[string]any{"toar": planet.TOARToolConfig(10000)},
map[string]any{"reproject": planet.ReprojectToolConfig("EPSG:4326", "cubic")},
},
})
Cloud delivery (GCS)
order, err := client.CreateOrder(ctx, planet.OrderRequest{
Name: "gcs-order",
SourceType: planet.SourceTypeScenes,
Products: []planet.OrderProduct{{
ItemIDs: []string{"20260609_022123_81_2562"},
ItemType: "PSScene",
ProductBundle: planet.BundleAnalyticUDM2,
}},
Delivery: &planet.OrderDelivery{
GoogleCloudStorage: &planet.GCSDestination{
Bucket: "my-bucket",
Credentials: "{...service-account-json...}",
},
},
})
Hosting on Sentinel Hub
order, err := client.CreateOrder(ctx, planet.OrderRequest{
Name: "hosted-order",
SourceType: planet.SourceTypeScenes,
Products: []planet.OrderProduct{{
ItemIDs: []string{"20260609_022123_81_2562"},
ItemType: "PSScene",
ProductBundle: planet.BundleAnalyticSRUDM2,
}},
Hosting: &planet.OrderHosting{
SentinelHub: &planet.SentinelHubHosting{},
},
})
Basemaps order (by geometry)
order, err := client.CreateOrder(ctx, planet.OrderRequest{
Name: "mosaic-order",
SourceType: planet.SourceTypeBasemaps,
Products: []planet.OrderProduct{{
MosaicName: "global_monthly_2022_01_mosaic",
Geometry: planet.PolygonGeo{
Type: "Polygon",
Coordinates: [][][]float64{{{
{4.607406, 52.353994},
{4.680005, 52.353994},
{4.680005, 52.395523},
{4.607406, 52.395523},
{4.607406, 52.353994},
}}},
},
}},
})
Basemaps order (by quad IDs)
order, err := client.CreateOrder(ctx, planet.OrderRequest{
Name: "mosaic-by-quads",
SourceType: planet.SourceTypeBasemaps,
Products: []planet.OrderProduct{{
MosaicName: "global_monthly_2022_01_mosaic",
QuadIDs: []string{"1050-1374", "1050-1375"},
}},
})
Wait and Download
Orders process asynchronously. Use WaitForOrder to poll until completion, then download each result:
// Wait for the order to finish (polls every 10 seconds)
order, err = client.WaitForOrder(ctx, order.ID, 10*time.Second)
if err != nil {
log.Fatal(err)
}
// Download each output asset
for _, result := range order.Links.Results {
if result.Delivery != "success" {
continue
}
body, err := client.DownloadOrderResult(ctx, result.Location)
if err != nil {
log.Printf("download %s: %v", result.Name, err)
continue
}
defer body.Close()
f, err := os.Create(result.Name)
if err != nil {
log.Fatal(err)
}
defer f.Close()
io.Copy(f, body)
fmt.Printf("downloaded %s\n", result.Name)
}
Manage Orders
// Get a single order
order, err := client.GetOrder(ctx, "order-id-here")
// List all orders (last 3 months)
orders, err := client.ListOrders(ctx, planet.ListOrdersParams{
State: planet.OrderStateSuccess,
SortBy: "created_on DESC",
PageSize: 10,
})
// List all orders in a specific state
orders, err = client.ListOrders(ctx, planet.ListOrdersParams{
SourceType: planet.SourceTypeScenes,
State: planet.OrderStateQueued,
})
// Cancel a queued order
cancelled, err := client.CancelOrder(ctx, "order-id-here")
fmt.Printf("cancelled: %s\n", cancelled.State)
// Bulk cancel specific orders
result, err := client.BulkCancelOrders(ctx, []string{"order-1", "order-2"})
fmt.Printf("cancelled %d, failed %d\n", result.Result.Succeeded.Count, result.Result.Failed.Count)
// Bulk cancel all queued orders
result, err = client.BulkCancelAllQueued(ctx)
// Get aggregated order stats
stats, err := client.GetOrderStats(ctx)
fmt.Printf("queued: user=%d org=%d\n", stats.User.Queued, stats.Organization.Queued)