RESTful Sensor: Howto import the data into an sensor attribute `data`

I have the following API output:

[
  {
    "start": "2024-12-01T00:00:00.000+01:00",
    "end": "2024-12-01T01:00:00.000+01:00",
    "price": 0.3183,
    "price_origin": "market"
  },
  {
    "start": "2024-12-01T01:00:00.000+01:00",
    "end": "2024-12-01T02:00:00.000+01:00",
    "price": 0.3067,
    "price_origin": "market"
  },
  {
    "start": "2024-12-01T02:00:00.000+01:00",
    "end": "2024-12-01T03:00:00.000+01:00",
    "price": 0.3044,
    "price_origin": "market"
  }
]

Howto import the data into an sensor attribute data?
Below is not working.
Please point me in the right direction.

rest:
  #
  # https://www.energyforecast.de/
  #
  #
  # curl -X 'GET' \
  #  'https://www.energyforecast.de/api/v1/predictions/next_96_hours?fixed_cost_cent=16.774&vat=19&token=api-token' \
  #  -H 'accept: application/json'
  #
  - resource: https://www.energyforecast.de/api/v1/predictions/next_96_hours?fixed_cost_cent=16.774&vat=19&token=api-token
    method: GET
    scan_interval: 60
    sensor:
      - unique_id: energyforecast
        name: "Energyforecast Electricity spot price"
        value_template: "{{ 1.0 }}"
        json_attributes_path: "$"
        json_attributes:
          - data
        unit_of_measurement: EUR
        device_class: monetary
        state_class: total
        icon: mdi:cash

The way json_attributes works is by looking in the JSON (at the path defined by json_attributes_path for an key of that name (in this case "data") and creating an attribute on the entity of the same name. There is no key named "data" in your JSON, so this won’t work. I don’t know if there is a way to capture the whole object as an attribute. You could try $ as your json_attribute, but that probably won’t work.

It’s kind of a hack, but perhaps you could use a command line sensor instead to modify the JSON returned. Something like

command_line:
  - sensor:
      name: Energyforecast Electricity spot price
      command: "echo '{ "data" : '`curl -X 'GET' 'https://www.energyforecast.de/api/v1/predictions/next_96_hours?fixed_cost_cent=16.774&vat=19&token=api-token' -H 'accept: application/json'`' }'"