NAV Navigation
Shell HTTP JavaScript Node.js Ruby Python Java Go PHP

Price Manager v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

A simple representation of a module proving price information for various other modules.

Base URLs:

License: MIT

Authentication

Default

get__info

Code samples

# You can also use wget
curl -X GET https://price:8080/info \
  -H 'Accept: application/json'

GET https://price:8080/info HTTP/1.1
Host: price:8080
Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('https://price:8080/info',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('https://price:8080/info',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://price:8080/info',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://price:8080/info', headers = headers)

print(r.json())

URL obj = new URL("https://price:8080/info");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://price:8080/info", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://price:8080/info', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

GET /info

Get operation for interface 'Information'

Provides price information.

Example responses

200 Response

{
  "gridSelling": 3,
  "gridBuying": 15,
  "p2pSelling": 3.9,
  "p2pBuying": 3.9,
  "cBatterySelling": 3.9,
  "cBatteryBuying": 45,
  "cPVBuying": 3.9
}

Responses

Status Meaning Description Schema
200 OK Provides price information. Prices

Schemas

Prices

{
  "gridSelling": 3,
  "gridBuying": 15,
  "p2pSelling": 3.9,
  "p2pBuying": 3.9,
  "cBatterySelling": 3.9,
  "cBatteryBuying": 45,
  "cPVBuying": 3.9
}

Properties

Name Type Required Restrictions Description
gridSelling number(double) true none Price for selling to grid.
gridBuying number(double) true none Price for using from grid.
p2pSelling number(double) true none Price for selling in a P2P energy trade.
p2pBuying number(double) true none Price for buying during a P2P energy trade.
cBatterySelling number(double) true none Price for charing a community battery.
cBatteryBuying number(double) true none Price for using a community battery.
cPVBuying number(double) true none Price for using a community PV.