Skip to main content

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 = responseo0].headersd“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:




Hi,
I wonder what is the pricing for Catalog requests. I can’t find it anywhere.
It seems that our number-of-requests limit apply to them the same way as to the other (e.g. OGC) requests, despite there is no data processing involved? Am I correct?
Also, how processing units are calculated for Catalog requests?
Thanks a lot!

Thanks in advance.

Hi,

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


 

Requests Builder

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,

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.


Reply