Skip to content

POST /apiv2/prices

Get current energy rental prices for different time periods.

Endpoint URL

POST https://netts.io/apiv2/prices

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-API-KEYYesYour API key
X-Real-IPYesIP address from whitelist

Request Body

json
{}

Request does not require parameters in the body.

Example Requests

cURL

bash
curl -X POST https://netts.io/apiv2/prices \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -H "X-Real-IP: your_whitelisted_ip" \
  -d '{}'

Python

python
import requests
import json

url = "https://netts.io/apiv2/prices"
headers = {
    "Content-Type": "application/json",
    "X-API-KEY": "your_api_key",
    "X-Real-IP": "your_whitelisted_ip"
}

response = requests.post(url, headers=headers, json={})
data = response.json()

if response.status_code == 200:
    print("Current energy prices:")
    prices = data.get('data', {})
    for period, price in prices.items():
        print(f"{period}: {price} TRX")
else:
    print(f"Error: {data.get('msg')}")

Response

Success Response (200 OK)

json
{
    "code": 0,
    "msg": "Success",
    "data": {
        "1h": "0.50",
        "24h": "10.00",
        "weekly": "65.00",
        "monthly": "250.00",
        "current_period": "peak",
        "peak_hours": {
            "start": "11:00",
            "end": "21:00",
            "price_multiplier": 1.2
        },
        "off_peak_hours": {
            "start": "23:00",
            "end": "07:00",
            "price_multiplier": 0.8
        }
    }
}

Response Parameters

ParameterTypeDescription
1hstringPrice for 1 hour energy rental in TRX
24hstringPrice for 24 hours energy rental in TRX
weeklystringPrice for weekly energy rental in TRX
monthlystringPrice for monthly energy rental in TRX
current_periodstringCurrent period (peak/off_peak/normal)
peak_hoursobjectPeak hours information
peak_hours.startstringPeak hours start time (UTC)
peak_hours.endstringPeak hours end time (UTC)
peak_hours.price_multiplierfloatPrice multiplier during peak hours
off_peak_hoursobjectOff-peak hours information
off_peak_hours.startstringOff-peak hours start time (UTC)
off_peak_hours.endstringOff-peak hours end time (UTC)
off_peak_hours.price_multiplierfloatPrice multiplier during off-peak hours

Errors

Authentication Error (401)

json
{
    "code": -1,
    "msg": "Invalid API key or IP not in whitelist",
    "data": null
}

Rate Limit Exceeded (429)

json
{
    "code": -5,
    "msg": "Rate limit exceeded",
    "data": null
}

Notes

  • All prices are specified in TRX
  • Prices may vary depending on time of day (UTC)
  • Peak hours are typically from 11:00 to 21:00 UTC
  • Off-peak hours offer discounts up to 20%
  • Prices are updated every 5 minutes