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

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:
id
string <uuid>

Identifier

processRequest
required
object (ProcessRequest)
tilingGridId
integer <int64>

One of the supported tiling grids

userId
required
string <uuid>

User that submitted the request. Must NOT be specified when creating new requests.

status
string
Enum: "CREATED" "ANALYSING" "ANALYSIS_DONE" "PROCESSING" "DONE" "FAILED"

Current processing status of the request. Must NOT be specified when creating new requests.

userAction
string
Enum: "NONE" "ANALYSE" "START" "CANCEL"

Last user action on the request. Must NOT be specified when creating new requests.

bucketName
required
string

Bucket name in AWS S3 where the results shall be written

resolution
number <double>

Output resolution in units of the tiling grid

description
string

Optional description that can be used to keep track of requests

created
integer <int64>

Creation time of the request

valueEstimate
number <double>

Estimated processing value (cost) of the request in PUs. Must NOT be specified when creating new requests.

tileCount
integer <int32>

Number of output tiles

tileWidthPx
integer <int32>

Tile width in pixels

tileHeightPx
integer <int32>

Tile height in pixels

Responses

201

Request submitted

400

Bad request

401

Unauthorized

403

Insufficient permissions

500

Server error

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

Request samples

Content type
Copy
Expand all Collapse all
{
  • "id": "string",
  • "processRequest":
    {
    },
  • "tilingGridId": 0,
  • "userId": "string",
  • "status": "CREATED",
  • "userAction": "NONE",
  • "bucketName": "string",
  • "resolution": 0,
  • "description": "string",
  • "created": 0,
  • "valueEstimate": 0,
  • "tileCount": 0,
  • "tileWidthPx": 0,
  • "tileHeightPx": 0
}

Response samples

Content type
application/json
Copy
Expand all