aws-samples / experimental-programmatic-access-ccft

Experimental Programmatic Access to the AWS Customer Carbon Footprint Tool data
MIT No Attribution
28 stars 8 forks source link

paceProductCode and regionCode missing in carbonEmissionEntries #11

Closed martenpoferl closed 3 months ago

martenpoferl commented 3 months ago

Hello, when I fetch the API, paceProductCode and regionCode are missing in the response.

This is what I receive:

carbonEmissionEntries: [
    { mbmCarbon: '0', startDate: '2024-03-01' },
    { .... }
  ]

This is the url and my request:

    url = 'https://us-east-1.console.aws.amazon.com/billing/rest/api-proxy/carbonfootprint';

    const cftRequest = {
      "headers": {
        "Content-Type": "application/json"
      },
      "path": "/get-carbon-footprint-summary",
      "method": "GET",
      "region": "us-east-1",
      "params": {
        "startDate": params.startDate,
        "endDate": params.endDate
      }
    };

What do I have to do to get paceProductCode and regionCode in the request?

ktj-ph commented 3 months ago

Hi @martenpoferl - this is expected behaviour. Please refer to this FAQ entry: https://github.com/aws-samples/experimental-programmatic-access-ccft?tab=readme-ov-file#q-how-does-the-data-relate-to-what-i-see-in-the-aws-customer-carbon-footprint-tool - "If your AWS Customer Carbon Footprint Tool emissions are zero, the script will also return 0.0. Please note, that you will not see the product split or region split in this case (paceProductCode and regionCode under carbonEmissionEntries will not be returned)."