Trading 212 API

I hope someone can help.

I’m trying to get information from Trading 212 using the following:

# Trading 212 Pies
  - platform: command_line  
    command: "curl -i -X GET \ https://demo.trading212.com/api/v0/equity/pies \ -H 'Authorization: my_api_key'"
    name: trading_212_pies
    value_template: "{{ value_json[0].cash }}"
    scan_interval: 60

The API docs are here

Is a command line sensor the correct way to do this?
I’m getting an error in the log and no sesnor. Please help?