Scripts and example files for Tibber
Find your API token at Tibber Developer
Place it in a file, as shown here: demo-token-header
$ ./curlfile -h demo-token-header example-queries/01-logged-in-user.gql | jq
{
"data": {
"viewer": {
"name": "Arya Stark"
}
}
}
$ ./curlfile -h demo-token-header example-queries/02-homes.gql
{"data":{"viewer":{"homes":[{"address":{"address1":"Winterfell Castle 1",
"address2":null,"address3":null,"postalCode":null,"city":null,
"country":null,"latitude":null,"longitude":null}}]}}}
$ ./curlfile -h demo-token-header example-queries/03-current-energy-price.gql | head -c79
{"data":{"viewer":{"homes":[{"currentSubscription":{"priceInfo":{"current":{"to
graphqurl not supported at the moment:
$ gq https://api.tibber.com/v1-beta/gql -q '{ viewer { name } }' -H 'Authorization: Bearer 476c477d8a039529478ebd690d35ddd80e3308ffc49b59c65b142321aee963a4'
Executing query... error
Error: { errors: [ { message: 'failed to fetch' } ] }
$ gq https://api.tibber.com/v1-beta/gql --queryFile example-queries/01-logged-in-user.gql -H demo-token-header
› Error: cannot parse header 'demo-token-header' (multiple ':')