Downloading sentinel products using API?

I received help from an application developer at JNCC. I will post their answer here to help others.

My problem was that I needed to escape the $ character before value. so the wget command should read (using the apihub, which you could replace with dhus):

wget --no-check-certificate --user=username --password=usrpass "https://scihub.copernicus.eu/apihub/odata/v1/Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')/\$value"

Or to use curl his suggested command was:

curl -u username:password -LkJO "https://scihub.copernicus.eu/dhus/odata/v1/Products('13e66985-7d1f-4a7c-be58-925e7ed7889d')/\$value"

Note the escaped $ at the end. Without this the URL being sent is https://scihub.copernicus.eu/dhus/odata/v1/Products('13e66985-7d1f-4a7c-be58-925e7ed7889d')/ If you try this url in a browser you will get an html description of the product.


A good alternative to the official Scihub is the mirrored Sentinel-2 data on Amazon Web Services.

Sentinel-2 on AWS

This has the advantage of better uptime and the products are already saved in their MGRS tiles, which makes downloading a lot faster.

The data is stored in a public bucket with the scheme tiles/[UTM code]/latitude band/square/[year]/[month]/[day]/[sequence]/DATA. This makes iterative, scripted downloading of all available scenes over an area very easy.

If you are interested in programmatic search and download of data from the Scihub you could also use the Python tool Sentinelsat.


I would suggest using the sentinelsat Python API for this. Especially if your goal is batch download.

Please see below for some example code for Sentinel- 2 download (Code run from Spyder)

#First, import this library (sentinelsat)
from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from datetime import date

api = SentinelAPI('user', 'password', 'https://scihub.copernicus.eu/dhus')

# search by polygon, time, and SciHub query keywords
footprint = geojson_to_wkt(read_geojson(r'/path/to/map.geojson'))
products = api.query(footprint,
                     date=('20151219', date(2015, 12, 29)),
                     platformname='Sentinel-2',
                     cloudcoverpercentage=(0, 30))

#Download all products 
api.download_all(products)

FYI, if you're looking for countrywide data, split the AOI up into smaller shapefiles as i had this issue where it returned no results when my AOI was too large.

Have a read of this for more info: https://buildmedia.readthedocs.org/media/pdf/sentinelsat/master/sentinelsat.pdf

There are also options for Sentinel-1 batch download too.