Command Line Interface¶
Sentinelsat’s CLI is divided into two commands:
sentinel search
to query and download a number of images over an areasentinel download
to download individual images by their unique identifier
Quickstart¶
A basic search query consists of a search polygon as well as the username and password to access the SciHub.
sentinel search [OPTIONS] <user> <password> <geojson>
Search areas are provided as GeoJSON polygons, which can be created with QGIS or geojson.io. If you do not specify a start and end date only products published in the last 24 hours will be queried.
Start and end dates refer to the acquisition date given by the beginPosition of the products, i.e. the start of the acquisition time.
Sentinel-1¶
Search and download all Sentinel-1 scenes of type SLC, in descending orbit for the year 2015.
sentinel search -s 20150101 -e 20151231 -d \
--producttype SLC -q "orbitdirection=Descending" \
-u "https://scihub.copernicus.eu/dhus" <user> <password> poly.geojson
Download a single Sentinel-1 GRDH scene covering Santa Claus Village in Finland on Christmas Eve 2015.
sentinel download --md5 -u "https://scihub.copernicus.eu/dhus/" <user> <password> a9048d1d-fea6-4df8-bedd-7bcb212be12e
Sentinel-2¶
Search and download Sentinel-2 scenes for January 2016 with a maximum cloud cover of 40%.
sentinel search -s 20160101 -e 20160131 --sentinel 2 --cloud 40 -d <user> <password> <poly.geojson>
Download all Sentinel-2 scenes published in the last 24 hours.
sentinel search --sentinel 2 -d <user> <password> <poly.geojson>
sentinel search¶
sentinel search [OPTIONS] <user> <password> <geojson>
Options:
-s |
--start |
TEXT | Start date of the query in the format YYYYMMDD. |
-e |
--end |
TEXT | End date of the query in the format YYYYMMDD. |
-d |
--download |
Download all results of the query. | |
-f |
--footprints |
Create geojson file search_footprints.geojson with footprints of the query result. | |
-p |
--path |
PATH | Set the path where the files will be saved. |
-q |
--query |
TEXT | Extra search keywords you want to use in the query. Separate keywords with comma. Example: ‘producttype=GRD,polarisationmode=HH’. |
-u |
--url |
TEXT | Define another API URL. Default URL is ‘https://scihub.copernicus.eu/apihub/‘. |
--md5 |
Verify the MD5 checksum and write corrupt product ids and filenames to corrupt_scenes.txt. | ||
--sentinel |
Limit search to a Sentinel satellite (constellation). | ||
--instrument |
Limit search to a specific instrument on a Sentinel satellite. | ||
--producttype |
Limit search to a Sentinel product type. | ||
-c |
--cloud |
INT | Maximum cloud cover in percent. (Automatically sets –sentinel2) |
--help |
Show help message and exit. | ||
--version |
Show version number and exit. |
ESA maintains a list of valid search keywords that can be used with --query
.
The options --sentinel
, --instrument
and --producttype
are mutually exclusive and follow a hierarchy from
most specific to least specific, i.e. --producttype
> --instrument
> --sentinel
. Only the most specific
option will be included in the search when multiple ones are given.
sentinel download¶
sentinel download [OPTIONS] <user> <password> <productid>
Options:
-p |
--path |
PATH | Set the path where the files will be saved. |
-u |
--url |
TEXT | Define another API URL. Default URL is ‘https://scihub.copernicus.eu/apihub/‘. |
--md5 |
Verify the MD5 checksum and write corrupt product ids and filenames to corrupt_scenes.txt. | ||
--version |
Show version number and exit. |