All pages
Powered by GitBook
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

Authentication

Hydrosat's Discovery STAC API requires a bearer token for authentication and authorization.

This article covers the process of using a client ID and secret pair to generate a bearer token and then including that bearer token in requests to the STAC API.

For documentation on how to create an API client ID and secret, view the Managing API Clients article.

Using a Client ID and Secret to get a Token

When creating an API client in the Discovery Portal, you will be issued a client ID and client secret for that API client.

The client ID and secret are unique credentials that allow the client to generate a temporary bearer token which provides access to use the API with any permissions provided to that client.

The client can request a valid token by submitting its client ID and secret in a form POST payload to the following token url:

The response contains the values shown below, including the amount of time the token will live before expiring, in seconds. Because a token is only temporarily valid, the client must manage getting refreshed tokens regularly in order to have consistent access to the API.

'Get Token' Example

The example below assumes that the user has stored their API client ID and secret in a separate file called creds.json with the following structure:

For security, we suggest setting credential file permissions to 600 (chmod 600 creds.json) so that only the owner has read and write access. Consult with your organization's security team to ensure you are complying with preferred methods for storing and accessing API client credentials.

The Python example below covers using the credentials stored in creds.json to generate a new token for use with the Hydrosat Discovery STAC API and storing the resulting token in the access_token variable.

Using the Token to Make a STAC Request

Once the client has a valid token, it can make requests to the STAC API as normal.

In the below example, the token is stored in the access_token variable from the previous code example and is used to make a request to the /collections endpoint using the requests Python library.

Unauthenticated Requests

Unauthenticated requests to the STAC API will return an error (401 Unauthorized Error)


For lengthier examples and next steps, please see our code examples in Github.

Example Code Github Repo

Visit our example code Github repo for helpful tutorials for using our STAC API and imagery.

https://auth.hydrosat.com/oauth2/token
{
    "access_token": "<token_value>",
    "expires_in": 3600,
    "token_type": "Bearer"
}
{
"client_id":"<clientID>",
"client_secret":"<clientsecret>"
}
tokenUrl = "https://auth.hydrosat.com/oauth2/token"

with open('creds.json') as f:
    creds = json.loads(f.read())

client_id = creds["client_id"]
client_secret = creds["client_secret"]

payload = f'grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
}

token_response = requests.request("POST", tokenUrl, headers=headers, data=payload)
token_data = token_response.json()
access_token = token_data["access_token"]
STACheaders = {"Authorization":f"Bearer {access_token}"}
collection_response = requests.request("GET", 'https://stac.hydrosat.com/collections', headers=STACheaders)
collection_data = collection_response.json()
print(collection_data)

STAC API Reference & Specification

Hydrosat's Data Discovery STAC API is available at https://stac.hydrosat.com/. The STAC API requires authentication using a bearer token.

SpatioTemporal Asset Catalog (STAC) API

This page includes high-level information on the basic features of the API and provides examples for a few methods of working with it.

For more details, please review the STAC API specifications provided at https://github.com/radiantearth/stac-api-spec.

Through Hydrosat's STAC API, you can search for data that meets your needs. Data are stored as Cloud-Optimized GeoTIFFs (COGs), which means you can either download the full files or stream only the parts you need using standard web requests.

Once you’re authenticated, you can browse Hydrosat's STAC items and view thumbnail previews. However, only users who have ordered specific data can download the full COGs for their selected areas.

Learn more:

  • STAC (SpatioTemporal Asset Catalog): stacspec.org

  • Cloud-Optimized GeoTIFFs (COGs): cogeo.org


While you can use the STAC API directly, we recommend using one of the following tools to make it easier:

  • Python library: pystac-client documentation

STAC API Endpoints

Request
Description

GET /collections

Return list of available collections

GET /collections/{collection_id}

Return metadata for a single collection

GET /collections/{collection_id}/items

Return list of items in the specified collection

STAC Catalog Structure

Hydrosat's STAC catalog is organized into four collections.

Collection Name

Description

vz-viri-l1a

Level-1A radiance data from the visible and near-infrared sensor (VIRI)

vz-liri-l1a

Level-1A radiance data from the longwave infrared thermal sensor (LIRI)

vz-l1b

Level-1B data: top-of-atmosphere reflectance (VIRI) and brightness temperature (LIRI) aligned and resampled to same resolution

Each collection contains a series of items representing individual scenes. Within each item, you will find metadata and links to associated imagery.

Simplified structure of Hydrosat's STAC catalog.

STAC Query Examples

pystac-client

We recommend using the pystac-client Python library. This library is specifically designed to interact with STAC catalogs and APIs. Complete documentation for this library can be found here. More examples with pystac are included in our full Github examples.

import pystac
from pystac_client import Client

# Connect to the STAC catalog.
# See our page on authentication for how to set up your headers.
catalog = Client.open('https://stac.hydrosat.com/', headers=headers)

# Search for Level-2 data intersecting southern Australia from 19 April 2026
search = catalog.search(
        collections = ['vz-l2'],
        bbox = [140.173825, -37.63983, 149.28178, -34.929824],
        datetime = ["2026-01-19T00:00:00Z", "2026-04-19T00:00:00Z"]
    )

# Print a list of STAC items returned from the search    
items = list(search.items())
print(items)

curl

The STAC server can also be queried directly from your terminal using curl. For example, you can use a POST request to perform a query, specifying the search parameters as JSON-formatted raw data. For more information, please see the curl docs.

curl -X POST \
--header 'Content-Type: application/json' \
--data '{
    "collections": ["vz-l2"],
    "bbox": [140.173825, -37.63983, 149.28178, -34.929824],
    "datetime": "2026-04-01T00:00:00Z/2025-05-01T00:00:00Z"
}' \
https://stac.hydrosat.com/

GET /collections/{collection_id}/items/{item_id}

Retrieve a specific item in a specific collection

POST /search

Search for items using filters (e.g., date, location)

vz-l2

Level-2 data: surface reflectance and surface temperature

Locating Downloadable Data

If your Discovery Platform account is configured to allow data downloads, your download entitlements are based on areas of interest and/or specific scene IDs. If you already know what your entitlement areas of interest (Download Access Areas) or scene IDs are, you can use that information to query data via the STAC API.

For help locating downloadable data in the Discovery Portal, check out this separate article.

If you don't know what your download entitlements are, you can look them up using Hydrosat's Accounts API.

If you would like to get access to downloadable data, contact our sales team.

Using Accounts API

Accounts API uses the same bearer token Authentication and API credentials as the STAC API.

Use the following endpoint to GET the active access policy for your account, which includes information about your download entitlements.

https://accounts.hydrosat.com/v2/me/access-policies

The polygons for area of interest-based download entitlements are listed within product_entitlements and scene ID-based entitlements are listed within scene_entitlements. The product_entitlements and scene_entitlements also include information about which STAC collections are you entitled to download from.

A product_entitlements example with a single polygon areas_of_interest is shown below.

A scene_entitlements example containing 2 scene_ids is shown below.

API Status

Visit our status page and sign up for notifications to get the latest information on our STAC API availability.

Response Examples

meResponse = requests.request("GET",'https://accounts.hydrosat.com/v2/me/access-policies', headers=myheaders)
meContent = meResponse.json()
access_policy = meContent.get("access_policies", [])[0]
scene_entitlements = access_policy.get("scene_entitlements", [])
product_entitlements = access_policy.get("product_entitlements", [])
[
   {
      "id":"d1ab374b-7623-416d-9dc9-b62df7866625",
      "access_policy_id":"98ab1aa0-02a2-4a75-b5bf-19e95f5eb08e",
      "product_name":"archive",
      "configuration":{
         "product_name":"archive",
         "collections":[
            "vz-liri-l1a",
            "vz-viri-l1a",
            "vz-l1b",
            "vz-l2"
         ],
         "restrict_search":false,
         "restrict_items":true,
         "restrict_properties":true
      },
      "areas_of_interest":[
         {
            "id":"448e8a88-0c56-4406-b9ba-a64b2c946584",
            "product_entitlement_id":"d1ab374b-7623-416d-9dc9-b62df7866625",
            "name":"Lake",
            "geometry":{
               "type":"Polygon",
               "coordinates":[
                  [
                     [
                        -94.0733085212435,
                        31.98981826138629
                     ],
                     [
                        -93.82521380712805,
                        31.113313105933432
                     ],
                     [
                        -93.41658721917305,
                        31.01958485756203
                     ],
                     [
                        -93.38010270239135,
                        31.275556307422413
                     ],
                     [
                        -93.5260407695181,
                        31.704771952854895
                     ],
                     [
                        -93.82521380712805,
                        31.97125515504588
                     ],
                     [
                        -94.0733085212435,
                        31.98981826138629
                     ]
                  ]
               ]
            },
            "created":"2026-07-10T23:12:25.815575Z",
            "updated":"2026-07-10T23:12:25.815575Z"
         }
      ],
      "created":"2026-07-10T23:12:25.587717Z",
      "updated":"2026-07-10T23:12:25.587717Z"
   }
]
[
   {
      "id":"5d756296-38d0-4c61-a256-1cfc4eeee411",
      "access_policy_id":"ffdf58c5-c527-4c32-98cf-933a2114f0c5",
      "collections":[
         "vz-liri-l1a",
         "vz-viri-l1a",
         "vz-l1b",
         "vz-l2"
      ],
      "scene_id":"VZ01_20260306_050940",
      "created":"2026-07-10T21:54:04.501632Z",
      "updated":"2026-07-10T21:54:04.501632Z"
   },
   {
      "id":"e9377d49-6342-4530-ad87-325cd3a04989",
      "access_policy_id":"ffdf58c5-c527-4c32-98cf-933a2114f0c5",
      "collections":[
         "vz-liri-l1a",
         "vz-viri-l1a",
         "vz-l1b",
         "vz-l2"
      ],
      "scene_id":"VZ02_20260514_073333",
      "created":"2026-07-10T21:54:04.391214Z",
      "updated":"2026-07-10T21:54:04.391214Z"
   }
]