Skip to main content

List & Filter Forecasted Data

This endpoint allows you to view all the forecasted data in the system, and apply various required and optional filters.

The time range is from present time to +8 days. This cannot be changed.

Endpoint

GET: https://api.smart-mfg.net/forecasted-data

Query Parameters

ParameterRequiredTypeDescription
meter_numbersNoarrayAn array of meter numbers. Each meter number must be a string with a maximum length of 255 chars. Defaults to null, which will show all meters in the given company.
perpageNointegerNumber of results per page. Must be between 1 and 100. Defaults to 10.
pageNointegerPage number for pagination. Must be 1 or higher. Defaults to 1.
timezoneNostringThe timezone for the data. Must be a valid timezone identifier. Defaults to America/Denver.
company_idNo **integer** Recommended (only if the user has multiple companies) to explicitly set what company you're getting data for.

Example Request

import requests

token = "YOUR_GENERATED_TOKEN"

headers = {
"Authorization": f"Bearer {token}",
"Accept": "application/json"
}

params = {
"meter_numbers[]": ["123456", "789012"],
"perpage": 10,
"page": 1,
"timezone": "America/New_York",
"company_id": 1
}

response = requests.get("https://api.smart-mfg.net/forecasted-data", headers=headers, params=params)
print(response.json())

if 200 <= response.status_code < 300:
print("Request successful!")
else:
print("Failed to retrieve forecasted data.")

The API will return a JSON response with either the correct data, or a list of errors.

Example Response

The response data has two parts: data and meta.

  • data contains the forecasted data for the requested meters. Index 0 in the nomination array is tomorrow, and the last index is +8 days from now.
  • meta contains pagination information required to move forward or backward between pages.
{
"data": [
{
"meter_number": "1",
"nominations": [
1,
2,
3,
4,
5,
6,
7
]
},
{
"meter_number": "2",
"nominations": [
1,
2,
3,
4,
5,
6,
7
]
},
{
"meter_number": "3",
"nominations": [
1,
2,
3,
4,
5,
6,
7
]
},
{
"meter_number": "4",
"nominations": [
1,
2,
3,
4,
5,
6,
7
]
},
{
"meter_number": "5",
"nominations": [
1,
2,
3,
4,
5,
6,
7
]
},
{
"meter_number": "6",
"nominations": [
1,
2,
3,
4,
5,
6,
7
]
},
{
"meter_number": "7",
"nominations": [
1,
2,
3,
4,
5,
6,
7
]
},
{
"meter_number": "8",
"nominations": [
1,
2,
3,
4,
5,
6,
7
]
},
{
"meter_number": "9",
"nominations": [
1,
2,
3,
4,
5,
6,
7
]
},
{
"meter_number": "10",
"nominations": [
1,
2,
3,
4,
5,
6,
7
]
}
],
"links": {
"first": "https://api.smart-mfg.net/forecasted-data?page=1",
"last": "https://api.smart-mfg.net/forecasted-data?page=65",
"prev": null,
"next": "https://api.smart-mfg.net/forecasted-data?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 65,
"links": [
{
"url": null,
"label": "&laquo; Previous",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=1",
"label": "1",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=2",
"label": "2",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=3",
"label": "3",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=4",
"label": "4",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=5",
"label": "5",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=6",
"label": "6",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=7",
"label": "7",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=8",
"label": "8",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=9",
"label": "9",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=64",
"label": "64",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=65",
"label": "65",
"active": false
},
{
"url": "https://api.smart-mfg.net/forecasted-data?page=2",
"label": "Next &raquo;",
"active": false
}
],
"path": "https://api.smart-mfg.net/forecasted-data",
"per_page": 10,
"to": 10,
"total": 1250
}
}