Skip to content

Command line tools


Install the command line tools:

python3 -m pip install stac-asset 'stac-asset[cli]'

Request an Access Token

ACCESS_TOKEN=$(curl --location --request POST '' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'audience=' \
--data-urlencode 'client_id=<API_CREDENTIAL_ID>' \
--data-urlencode 'client_secret=<API_CREDENTIAL_SECRET>' -s | jq -r '.access_token')

Download all the assets for a specific outcome_id

stac-client search \
    --filter '{"op": "=","args": [ { "property": "satl:outcome_id" }, "c44cb3c7-9328-4215-9be4-5386e01edafd--175631" ]}' \
    --collection 'quickview-visual' \
    --headers 'authorizationToken=Bearer '"${ACCESS_TOKEN}" \
    | stac-asset download -i analytic

Here the first command, using stac-client will fetch all the matching tiles for the outcome_id that we are interested in. We will then pipe the result to stac asset and tell the tool to just download the analytic asset for each of the tiles.

More examples can be found on the stac-asset documentation page.

Last update: 2024-04-17