POST /apiv2/prices
Get current energy rental prices for different time periods.
Endpoint URL
POST https://netts.io/apiv2/prices
Request Headers
Header | Required | Description |
---|---|---|
Content-Type | Yes | application/json |
X-API-KEY | Yes | Your API key |
X-Real-IP | Yes | IP 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
Parameter | Type | Description |
---|---|---|
1h | string | Price for 1 hour energy rental in TRX |
24h | string | Price for 24 hours energy rental in TRX |
weekly | string | Price for weekly energy rental in TRX |
monthly | string | Price for monthly energy rental in TRX |
current_period | string | Current period (peak/off_peak/normal) |
peak_hours | object | Peak hours information |
peak_hours.start | string | Peak hours start time (UTC) |
peak_hours.end | string | Peak hours end time (UTC) |
peak_hours.price_multiplier | float | Price multiplier during peak hours |
off_peak_hours | object | Off-peak hours information |
off_peak_hours.start | string | Off-peak hours start time (UTC) |
off_peak_hours.end | string | Off-peak hours end time (UTC) |
off_peak_hours.price_multiplier | float | Price 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