sentinelhub.api.catalog

A client interface for Sentinel Hub Catalog API.

class sentinelhub.api.catalog.SentinelHubCatalog(config=None)[source]

Bases: SentinelHubService

The main class for interacting with Sentinel Hub Catalog API

For more details about certain endpoints and parameters check Catalog API documentation.

Parameters

config (Optional[SHConfig]) – A configuration object with required parameters sh_client_id, sh_client_secret, and sh_auth_base_url which is used for authentication and sh_base_url which defines the service deployment that will be used.

get_info()[source]

Provides the main information that define Sentinel Hub Catalog API

Catalog API reference

Returns

A service payload with information

Return type

Dict[str, Any]

get_conformance()[source]

Get information about specifications that this API conforms to

Catalog API reference

Returns

A service payload with information

Return type

Dict[str, Any]

get_collections()[source]

Provides a list of collections that are available to a user

Catalog API reference

Returns

A list of collections with information

Return type

List[Dict[str, Any]]

get_collection(collection)[source]

Provides information about given collection

Catalog API reference

Parameters

collection (Union[DataCollection, str]) – A data collection object or a collection ID

Returns

Information about a collection

Return type

Dict[str, Any]

get_feature(collection, feature_id)[source]

Provides information about a single feature in a collection

Catalog API reference

Parameters
  • collection (DataCollection) – A data collection object or a collection ID

  • feature_id (str) – A feature ID

Returns

Information about a feature in a collection

Return type

Dict[str, Any]

search(collection, *, time=None, bbox=None, geometry=None, ids=None, query=None, fields=None, distinct=None, limit=100, **kwargs)[source]

Catalog STAC search

Catalog API reference

Parameters
  • collection (Union[DataCollection, str]) – A data collection object or a collection ID

  • time (Union[None, str, date, Tuple[Union[None, str, date], Union[None, str, date]]]) – A time interval or a single time. It can either be a string in form YYYY-MM-DDThh:mm:ss or YYYY-MM-DD or a datetime object

  • bbox (Optional[BBox]) – A search bounding box, it will always be reprojected to WGS 84 before being sent to the service. Re-projection will be done with BBox.transform_bounds method which can produce a slightly larger bounding box. If that is a problem then transform a BBox object into a Geometry object and search with geometry parameter instead.

  • geometry (Optional[Geometry]) – A search geometry, it will always reprojected to WGS 84 before being sent to the service. This parameter is defined with parameter intersects at the service.

  • ids (Optional[List[str]]) – A list of feature ids as defined in service documentation

  • query (Optional[Dict[str, Any]]) – A STAC query described in Catalog API documentation

  • fields (Optional[Dict[str, Any]]) – A dictionary of fields to include or exclude described in Catalog API documentation

  • distinct (Optional[str]) – A special query attribute described in Catalog API documentation

  • limit (int) – A number of results to return per each request. At the end iterator will always provide all results the difference is only in how many requests it will have to make in the background.

  • kwargs (Any) – Any other parameters that will be passed directly to the service

Return type

CatalogSearchIterator

class sentinelhub.api.catalog.CatalogSearchIterator(*args, **kwargs)[source]

Bases: FeatureIterator[Dict[str, Any]]

Searches a catalog with a given query and provides results

Parameters
  • client – An instance of a download client object

  • url – A URL where requests will be made

  • params – Parameters to be sent with each request

get_timestamps()[source]

Provides features timestamps

Returns

A list of sensing times

Return type

List[date]

get_geometries()[source]

Provides features geometries

Returns

A list of geometry objects with CRS

Return type

List[Geometry]

get_ids()[source]

Provides features IDs

Returns

A list of IDs

Return type

List[str]