Skip to main content
POST
/
v1
/
homes
/
{id}
/
price_signal
get price signal
curl --request POST \
  --url https://api.example.com/v1/homes/{id}/price_signal \
  --header 'Content-Type: application/json' \
  --header 'x-ws-api-key: <api-key>' \
  --data '
{
  "startTime": "2025-02-25T16:13:37.902Z",
  "endTime": "2025-02-26T16:13:37.902Z"
}
'
import requests

url = "https://api.example.com/v1/homes/{id}/price_signal"

payload = {
    "startTime": "2025-02-25T16:13:37.902Z",
    "endTime": "2025-02-26T16:13:37.902Z"
}
headers = {
    "x-ws-api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'x-ws-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({startTime: '2025-02-25T16:13:37.902Z', endTime: '2025-02-26T16:13:37.902Z'})
};

fetch('https://api.example.com/v1/homes/{id}/price_signal', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.example.com/v1/homes/{id}/price_signal",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'startTime' => '2025-02-25T16:13:37.902Z',
    'endTime' => '2025-02-26T16:13:37.902Z'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-ws-api-key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/homes/{id}/price_signal"

	payload := strings.NewReader("{\n  \"startTime\": \"2025-02-25T16:13:37.902Z\",\n  \"endTime\": \"2025-02-26T16:13:37.902Z\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-ws-api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/v1/homes/{id}/price_signal")
  .header("x-ws-api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"startTime\": \"2025-02-25T16:13:37.902Z\",\n  \"endTime\": \"2025-02-26T16:13:37.902Z\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/homes/{id}/price_signal")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-ws-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"startTime\": \"2025-02-25T16:13:37.902Z\",\n  \"endTime\": \"2025-02-26T16:13:37.902Z\"\n}"

response = http.request(request)
puts response.read_body
{
  "homeId": "ws_home_123456789",
  "startTime": "2025-02-25T16:13:37.902Z",
  "endTime": "2025-02-26T16:13:37.902Z",
  "data": [
    {
      "startTime": "2025-02-25T16:13:37.902Z",
      "endTime": "2025-02-26T01:13:37.902Z",
      "price": 0.42625,
      "import": 0.42625,
      "export": 0,
      "confidence": 0.95
    },
    {
      "startTime": "2025-02-26T01:13:37.902Z",
      "endTime": "2025-02-26T04:13:37.902Z",
      "price": 0.46486,
      "import": 0.46486,
      "export": 0,
      "confidence": 0.95
    },
    {
      "startTime": "2025-02-26T04:13:37.902Z",
      "endTime": "2025-02-26T16:13:37.902Z",
      "price": 0.42625,
      "import": 0.42625,
      "export": 0,
      "confidence": 0.95
    }
  ],
  "prices": [
    0.42625,
    0.46486,
    0.42625
  ],
  "export": [
    0,
    0,
    0
  ],
  "import": [
    0.42625,
    0.46486,
    0.42625
  ]
}
{
  "request_id": "req_123",
  "error_code": "VALIDATION_FAILED",
  "message": "Request validation failed.",
  "field_errors": [
    {
      "field": "zipcode",
      "message": "zipcode is invalid"
    }
  ]
}
{
  "request_id": "req_123",
  "error_code": "AUTH_MISSING_API_KEY",
  "message": "Missing x-ws-api-key header.",
  "recovery_action": "Provide the x-ws-api-key header. If this contradicts the public docs or OpenAPI contract, submit structured feedback through /v1/feedback."
}

Authorizations

x-ws-api-key
string
header
required

WattShift API key

Headers

x-ws-api-key
string

WattShift API Key

Path Parameters

id
string
required

Body

application/json

Optional home-context signal window. If either startTime or endTime is provided, provide both.

startTime
string | null
endTime
string | null

Response

startTime
any
required
endTime
any
required
data
object[]
required
prices
number[]
required

expected price in $/kWh in 15min intervals

export
number[]
required

export rate in $/kWh in 15min intervals

import
number[]
required

import rate in $/kWh in 15min intervals

homeId
string
required
exportCompensation
object

metadata for the export compensation source used to populate export prices