Raw metadata.xml extraction using Catalop API


I am looking to extract the metadata.xml for the Landsat 8-9 products as I need to extract the sun elevation angle and relative sun earth distance for for some calculations.

As per some reading, I read that it can be extracted via catalog API or WFS request, but sadly no help is available regarding it script. Can you please help in extracting that metadata.xml?


The sun elevation angle can be accessed as bands in your Evalscript, as shown in this documentation page. You can also fetch this information using Catalog API. Below is an example call:

curl -X POST https://services-uswest2.sentinel-hub.com/api/v1/catalog/1.0.0/search  -H 'Content-Type: application/json'  -H 'Authorization: Bearer <bearer>'  -d '{   "collections": [     "landsat-ot-l2"   ],   "datetime": "2023-03-24T00:00:00Z/2023-04-24T23:59:59Z",   "bbox": [     12.44693,     41.870072,     12.541001,     41.917096   ],   "limit": 2 }'

The sun elevation angle is returned as: view:sun_elevation.

You cannot access the metadata with the earth-sun distance using Sentinel Hub services, but you could simply use this table and interpolate it: Earth-Sun Distance in Astronomical Units for Days of the Year | U.S. Geological Survey.

Hi ,

I tried this call and it threw an error 500 (attached the screenshot)

is a placeholder. Please either generate your own token or for ease, you can use Request Builder by parsing in the command under the Catalog tab in the Request Preview at the bottom right.

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