Problem retrieving sentinel data

I’m working on a project to get NDVI-data from Sentinelhub. I have an API of it’s own for handling connection to SentinelHub and processing it. The problem is that it seems to be working like a charm on everything else than on my laravel api, which it should be used on. I’ve tried to make the posts on plain curl and Guzzlehttp and it keeps failing… untill it doesn’t fail anymore. Then it start’s working.

The data is always similar which goes to the ndvi-API and for some reason it works sometimes and sometimes it does not. And when it starts working, it works for hours. I do no changes to the code and it starts working. It also works very well and always with other API’s. Even when it fails on Laravel API. Any one had similar issue of any kind? There’s a lot of stuff going on on the Laravel API, but it’s a simple curl post and should be no problem with it, since the data arrives to the NDVI-API on the right form. Always.

Thank you in advance.

Hi @Geezter ,

Could you please describe your issue more explicit? With limited information it is difficult to pin down the exact issue.

Thank you for the answer. It seems that the problem was with Date formatting. If used a Date for the present moment, like in javascript new Date(); and it was like (2023-07-31T08:39:23.451Z), when setting the date which i should start to get the NDVI-data from. And it didn’t return anything. I had to format the date that it doesn’t include milliseconds, like this: 2023-07-31T00:00:00.000Z and it works like a charm.

The problem was that I got bad replys from SentinelHub. Min and max stats were all NaN.

Hi @Geezter ,

I guess you’re using the Statistical API. Please correct me if I’m wrong. If you could share your area of interest, time range and Evalscript of your statistical request, I can have a look and try to figure out why NaN is returned for min and max.

Yes, Statistical Api.

Time range from: 2022-08-07T05:08:45.000Z
to: 2023-08-07T05:08:45.000Z

this is the evalscript:

const evalscript = `
function setup() {
return {
input: [{
bands: [
output: [
id: “data”,
bands: 1
id: “dataMask”,
bands: 1

function evaluatePixel(samples) {
    let index = (samples.B08 - samples.B04) / (samples.B08+samples.B04);
    return {
        data: [index, samples.B08, samples.B04],
        dataMask: [samples.dataMask]        

Hi @Geezter ,

Could you provide your area of interest as well? Thank you!

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