Catalog API Processing Unit

Hello,

When I do a call to the process API, I can get the number of processing units using the following method:

request = SentinelHubRequest()
response = request[“request”].get_data(decode_data=False,save_data=True)
processing_units = response[0].headers[“x-processingunits-spent”]

Can I do something similar for the catalog API? Currently, I am assuming that each processing unit is 0.01 PUs per the following forum topic:

Thanks in advance.

Hi @sentinel_hub_user ,

The sentinelhub-py package immediately extracts JSONs returned by Catalog API, so the x-processingunits-spent, which is stored in response headers, can’t be access through the package.

The workaround would be making the Catalog request with requests to have full access to the response. Then you can retrieve the x-processingunits-spent by accessing response headers with response.headers. Requests Builder is a user friendly GUI that help you build your request and you can select “search - python requests” from the “Request Preview” window (Fig 1) to get the script using requests library.


Fig 1

I was able to get this working, but this will not work for my use case. I want to query the catalog API for a given year which could have more than 100 dates returned. However, the limit argument only allows me to return 100 dates at a time. Alternatively, the sentinelhub-py package does allow more than 100 dates.

If I were to use the requests library, I would need to send multiple requests in order to get all the dates which I don’t want to do. Instead, I will assume that the processing units are 0.01 for each request sent through the sentinelhub-py package.

Hi @sentinel_hub_user ,

The limitation of the number of items that are presented in the response document is set from the API side (see API reference). The sentinelhub-py package is a wrapper which help you iterate through pagination and return all items in a list.

Regarding the cost, it depends on the area of interest and the time period. Please refer to our documentation for more details.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.