Issue with Evalscript when Fetching PlanetScope Imagery

Hello Sentinel Forum Community,

I am currently working on fetching PlanetScope imagery using the Sentinel API, and I’ve encountered an issue with the structure of my evalscript in the response. I’m hoping to get some guidance on how to properly structure the evalscript for my use case.

Here’s the evalscript I’m using:

function setup() {
   return {
     input: [{ bands: ['B04', 'B08'] }],
     output: [{ id: 'default', bands: 1, sampleType: 'FLOAT32' }],

function evaluatePixel(sample) {
   let ndvi = (sample.B08 - sample.B04) / (sample.B08 + sample.B04);
   return { default: [ndvi] };
(the idea of doing this is to be able to categorize the color indexes based on certain ranges between -1 and 1, like we do with sentinel 2 imagery)

However, when I make the request, I'm encountering the following error:

    "error": {
        "status": 400,
        "reason": "Bad Request",
        "message": "Collection 'byoc-???????' has no band 'B04'.",
        "code": "RENDERER_EXCEPTION"

Here's the relevant part of my fetch request:

const requestData = new FormData();
evalscript = `//VERSION=3
// ... (the evalscript remains the same)

    input: {
      bounds: {
        properties: { crs: '' },
        geometry: {
          type: 'Polygon',
          coordinates: [polygonCoordinates],
      data: [
          type: 'byoc-xxxx2dfe',
          dataFilter: {
            timeRange: {
              from: "2020-04-21T00:00:00Z",
              to: "2021-04-21T23:59:59Z"
    output: { responses: [{ identifier: 'default', format: { type: 'image/tiff' } }] },

Could someone please guide me on how to structure the evalscript correctly to avoid this error? I’m looking to compute NDVI from bands ‘B04’ and ‘B08’.

Thank you in advance for your assistance!

Hi @agrogis ,

The error message actually pointed out the issue: PlanetScope collection does not have band “B04”. Available bands of PlanetScope data are documented here. You can also find out some Evalscript examples for PlanetScope in our Custom Scripts Repository.

Note that the BYOC collection ID is confidential and with the ID anyone can access your data. Do not disclose it on the forum, please.

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