API Reference (1.0.0)

Download OpenAPI specification:Download

This page contains the documentation on how to use sentinel hub services through API calls.

Note: This documentation is not complete

Authentication

OAuth2

Authentication

More about the authentication here.

To get an access token using curl:

curl --request POST \
  --url https://services.sentinel-hub.com/oauth/token \
  --header "content-type: application/x-www-form-urlencoded" \
  --data "grant_type=client_credentials&client_id=<your client id>&client_secret=<your client secret>"
Security Scheme Type OAuth2
clientCredentials OAuth Flow
Token URL: https://services.sentinel-hub.com/oauth/token
Scopes:
  • SH -

    Sentinel Hub

implicit OAuth Flow
Authorization URL: https://services.sentinel-hub.com/oauth/auth
Scopes:
  • SH -

    Sentinel Hub

Process

Make sure to use the appropriate end-point for each of the datasets, e.g. for Landsat, Sentinel-3, etc.

Process

Authorizations:
Request Body schema:
input
required
object (Input)
output
object (ProcessRequestOutput)
evalscript
required
string

Your evalscript. For details, click here.

Responses

200

Successful response

400

Bad request

500

Server error

post /api/v1/process
https://services.sentinel-hub.com/api/v1/process

Request samples

Content type
Copy
Expand all Collapse all
{
  • "input":
    {
    },
  • "output":
    {
    },
  • "evalscript": "string"
}

Response samples

Content type
No sample

Convert evalscript to v3

Authorizations:
query Parameters
datasetType
required
string (DatasetType)
Enum: "S2L1C" "S2L2A" "L8L1C" "PLANET_L1C" "DEM" "MODIS" "S1GRD" "S2GM" "S3OLCI" "S3SLSTR" "S5PL2" "PLEIADES" "CUSTOM"

The dataset type used by the script

byocCollectionId
string <uuid>

Collection ID in case of datasetType=CUSTOM; must not be used otherwise

temporal
boolean

Only for v1 evalscripts - set to true to produce a temporal v3 evalscript

Request Body schema:
string <application/ecmascript> (Evalscript to convert (JavaScript code))

Responses

200

Successful response

400

Bad request

500

Server error

post /api/v1/process/convertscript
https://services.sentinel-hub.com/api/v1/process/convertscript

Request samples

Copy
import requests

response = requests.post('https://services.sentinel-hub.com/api/v1/process/convertscript?datasetType=S2L2A',
  headers={"Authorization" : "Bearer <your_access_token>"},
  data="""
function evaluatePixel(samples) {
  return [samples[0].B02];
}

function setup(ds) {
  setInputComponents([ds.B02]);
  setOutputComponentCount(1);
}
  """)

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "error":
    {
    }
}

Process

Submit new batch processing request

Authorizations:
Request Body schema:
processRequest
required
object (ProcessRequestForBatch)

Batch processing equivalent of the Process request.

tilingGridId
required
integer <int64>

One of the supported tiling grids

resolution
required
number <double>

Output resolution in units of the tiling grid

output
object (BatchProcessOutput)

Specifies the tile output paths where the results shall be written. Required unless bucketName is specified.

bucketName
string

Simplified alternative for specifying where the results shall be written, where only the bucket name is specified. Required unless output is specified.

description
string

Optional description that can be used to keep track of requests

Responses

201

Request submitted

400

Bad request

401

Unauthorized

403

Insufficient permissions

post /api/v1/batch/process
https://services.sentinel-hub.com/api/v1/batch/process

Request samples