Note: Access is limited to valid access tokens only.
The API is available at https://api.unplu.gg/. With Unplugg’s API you can request a forecast based on a provided timeseries. To do this you have to make a POST to endpoint /forecast
with headers and JSON payloads that will be described in the following sections.
To authorize your requests, add the following headers:
x-access-token: <YOUR-ACCESS-TOKEN>
Content-Type: application/json
Payloads sent to the API will be a Json structure with three objects:
Time Series data (
data
):Time series data will be a list of values with associated timestamps.
Parameter Example Description timestamp
1466640000
Timestamps in Unix time format (seconds) value
0.27589941523037853
Integer or float value for specified timestamp Link for webhook callback (
callback
)The link will be used to return forecasting result to the webhook once job is finished.
Parameter Example Description callback
http://your.domain/yourcallback
Link to which the job payload will be sent [Optional] Forecasting end date (
forecast_to
)The time series will be forecasted up to this date.
Parameter Example Description forecast_to
1458136800
Timestamps in Unix time format (seconds)
Payload example:
{
"data": [
{"timestamp":1466640000,"value":0.27589941523037853},
{"timestamp":1466640900,"value":0.4059699097648263},
{...} ,
{"timestamp":1466641800,"value":0.8376112426631153}
],
"forecast_to":1458136800,
"callback": "http://your.domain/yourcallback"
}
If the payload is well-behaved and sent for processing you’ll receive a job_id
in the body that uniquely identifies the processing job for your data. If the time series in the payload is not equally spaced, a resampling will be applied in order to have each value separated from the next by the same amount as the first two values in the given time series. Malformed payloads will return a 422: UNPROCESSABLE ENTITY
status as well as a message that should help in locating the error.
Once the job finishes your webhook will be sent a Json structure with:
Forecasting data will be will a list of values with associated timestamps inside an object called
forecast
, similarly to the historic data (see Payload). The forecasted time series will be executed until the given date in parameterforecast_to
or, in case it is not provided, the forecasted array will have the length of 1/8 of the number of points in the time series provided in the payload.Object
job_id
containing the job ID you’ve received earlier, associated with this specific forecasting request.
Webhook content example:
{
"forecast": [
{"timestamp":1466640000,"value":0.27589941523037853},
{"timestamp":1466640900,"value":0.4059699097648263},
{...} ,
{"timestamp":1466641800,"value":0.8376112426631153}
],
"job_id": "y0urJ0b1d"
}
Request (application/json)
Body
{ "data": [ {"timestamp":1458000000,"value":63.422235}, {"timestamp":1458003600,"value":72.012848}, {"timestamp":1458007200,"value":90.228838}, {"timestamp":1458010800,"value":63.096583}, {"timestamp":1458014400,"value":47.667261}, {"timestamp":1458018000,"value":69.652997}, {"timestamp":1458021600,"value":64.702911}, {"timestamp":1458025200,"value":62.883492}, {"timestamp":1458028800,"value":275.134977}, {"timestamp":1458032400,"value":204.245920}, {"timestamp":1458036000,"value":30.437638}, {"timestamp":1458039600,"value":65.915515}, {"timestamp":1458043200,"value":60.647731}, {"timestamp":1458046800,"value":30.737815}, {"timestamp":1458050400,"value":36.813539}, {"timestamp":1458054000,"value":48.769409}, {"timestamp":1458057600,"value":51.612869}, {"timestamp":1458061200,"value":52.513910}, {"timestamp":1458064800,"value":55.178538}, {"timestamp":1458068400,"value":108.105356}, {"timestamp":1458072000,"value":305.601636}, {"timestamp":1458075600,"value":270.042778}, {"timestamp":1458079200,"value":170.784059}, {"timestamp":1458082800,"value":57.512270}, {"timestamp":1458086400,"value":60.109329}, {"timestamp":1458090000,"value":32.578249}, {"timestamp":1458093600,"value":0.000000}, {"timestamp":1458097200,"value":36.821582}, {"timestamp":1458100800,"value":68.563145}, {"timestamp":1458104400,"value":54.661686}, {"timestamp":1458108000,"value":40.885125}, {"timestamp":1458111600,"value":53.869406}, {"timestamp":1458115200,"value":245.772560}, {"timestamp":1458118800,"value":165.604498}, {"timestamp":1458122400,"value":116.439820}, {"timestamp":1458126000,"value":46.957329} ], "forecast_to": 1458136800, "callback": "http://your.domain/yourcallback" }
Headers
x-access-token: [YOUR-ACCESS-TOKEN]
Response 200 (application/json)
[ { "forecast": [ {"timestamp":1458129600,"value":58.6912515906}, {"timestamp":1458133200,"value":30.5359068808}, {"timestamp":1458136800,"value":36.7927021395}, {"timestamp":1458140400,"value":48.7672586419} ], "job_id": "y0urJ0b1d" } ]
Let’s say we have the historic data on the daily mean temperature (this dataset was obtained from Wunderground) of the previous two months (November and December) and that we want to know what will the temperature be like in the first days of January.
Our payload would be:
{ "data": [ {"timestamp":1477958400,"value":19}, {"timestamp":1478044800,"value":18}, {"timestamp":1478131200,"value":18}, {"timestamp":1478217600,"value":17}, {"timestamp":1478304000,"value":14}, {"timestamp":1478390400,"value":13}, {"timestamp":1478476800,"value":12}, {"timestamp":1478563200,"value":12}, {"timestamp":1478649600,"value":16}, {"timestamp":1478736000,"value":14}, {"timestamp":1478822400,"value":13}, {"timestamp":1478908800,"value":16}, {"timestamp":1478995200,"value":17}, {"timestamp":1479081600,"value":16}, {"timestamp":1479168000,"value":14}, {"timestamp":1479254400,"value":15}, {"timestamp":1479340800,"value":14}, {"timestamp":1479427200,"value":14}, {"timestamp":1479513600,"value":13}, {"timestamp":1479600000,"value":16}, {"timestamp":1479686400,"value":12}, {"timestamp":1479772800,"value":10}, {"timestamp":1479859200,"value":11}, {"timestamp":1479945600,"value":11}, {"timestamp":1480032000,"value":12}, {"timestamp":1480118400,"value":11}, {"timestamp":1480204800,"value":12}, {"timestamp":1480291200,"value":13}, {"timestamp":1480377600,"value":11}, {"timestamp":1480464000,"value":13}, {"timestamp":1480550400,"value":13}, {"timestamp":1480636800,"value":12}, {"timestamp":1480723200,"value":14}, {"timestamp":1480809600,"value":14}, {"timestamp":1480896000,"value":16}, {"timestamp":1480982400,"value":14}, {"timestamp":1481068800,"value":13}, {"timestamp":1481155200,"value":13}, {"timestamp":1481241600,"value":13}, {"timestamp":1481328000,"value":14}, {"timestamp":1481414400,"value":14}, {"timestamp":1481500800,"value":12}, {"timestamp":1481587200,"value":10}, {"timestamp":1481673600,"value":13}, {"timestamp":1481760000,"value":11}, {"timestamp":1481846400,"value":10}, {"timestamp":1481932800,"value":13}, {"timestamp":1482019200,"value":13}, {"timestamp":1482105600,"value":11}, {"timestamp":1482192000,"value":8}, {"timestamp":1482278400,"value":11}, {"timestamp":1482364800,"value":11}, {"timestamp":1482451200,"value":11}, {"timestamp":1482537600,"value":11}, {"timestamp":1482624000,"value":11}, {"timestamp":1482710400,"value":9}, {"timestamp":1482796800,"value":9}, {"timestamp":1482883200,"value":10}, {"timestamp":1482969600,"value":11}, {"timestamp":1483056000,"value":11}, {"timestamp":1483142400,"value":9} ], "callback": "http://your.domain/yourcallback" }
And the forecast would be:
{
"job_id": "job_id": "y0urJ0b1d",,
"forecast": [
{"value": 10.0097924206,"timestamp": 1483228800},
{"value": 8.7188950629,"timestamp": 1483315200},
{"value": 8.2332303868,"timestamp": 1483401600},
{"value": 10.5328056937,"timestamp": 1483488000},
{"value": 10.420930709,"timestamp": 1483574400},
{"value": 10.152125241,"timestamp": 1483660800},
{"value": 10.5468242705,"timestamp": 1483747200}
]
}
With power consumption measured hourly with a smartmeter, we may gather hourly instant consumption data to forecast the next hours. Here we have a dataset with a day and a half of hourly instant consumption data.
Our payload would be:
{
"data": [
{"timestamp": 1458000000,"value": 63.422235},
{"timestamp": 1458003600,"value": 72.012848},
{"timestamp": 1458007200,"value": 90.228838},
{"timestamp": 1458010800,"value": 63.096583},
{"timestamp": 1458014400,"value": 47.667261},
{"timestamp": 1458018000,"value": 69.652997},
{"timestamp": 1458021600,"value": 64.702911},
{"timestamp": 1458025200,"value": 62.883492},
{"timestamp": 1458028800,"value": 275.134977},
{"timestamp": 1458032400,"value": 204.24592},
{"timestamp": 1458036000,"value": 30.437638},
{"timestamp": 1458039600,"value": 65.915515},
{"timestamp": 1458043200,"value": 60.647731},
{"timestamp": 1458046800,"value": 30.737815},
{"timestamp": 1458050400,"value": 36.813539},
{"timestamp": 1458054000,"value": 48.769409},
{"timestamp": 1458057600,"value": 51.612869},
{"timestamp": 1458061200,"value": 52.51391},
{"timestamp": 1458064800,"value": 55.178538},
{"timestamp": 1458068400,"value": 108.105356},
{"timestamp": 1458072000,"value": 305.601636},
{"timestamp": 1458075600,"value": 270.042778},
{"timestamp": 1458079200,"value": 170.784059},
{"timestamp": 1458082800,"value": 57.51227},
{"timestamp": 1458086400,"value": 60.109329},
{"timestamp": 1458090000,"value": 32.578249},
{"timestamp": 1458093600,"value": 0},
{"timestamp": 1458097200,"value": 36.821582},
{"timestamp": 1458100800,"value": 68.563145},
{"timestamp": 1458104400,"value": 54.661686},
{"timestamp": 1458108000,"value": 40.885125},
{"timestamp": 1458111600,"value": 53.869406},
{"timestamp": 1458115200,"value": 245.77256},
{"timestamp": 1458118800,"value": 165.604498},
{"timestamp": 1458122400,"value": 116.43982},
{"timestamp": 1458126000,"value": 46.957329}
],
"callback": "http://your.domain/yourcallback"
}
And the forecast would be:
{
"job_id": "y0urJ0b1d",
"forecast": [
{"value": 58.6912515906,"timestamp": 1458129600},
{"value": 30.5359068808,"timestamp": 1458133200},
{"value": 36.7927021395,"timestamp": 1458136800},
{"value": 48.7672586419,"timestamp": 1458140400 }
]
}
For this example we have a dataset with internet traffic data (in bits) from an ISP (Origin: DataMarket). The original timeseries was resampled to show values in 10 minute intervals instead of the original 5 minutes.
{
"data": [
{"timestamp":1106611200,"value":8107.408},
{"timestamp":1106611800,"value":8209.601},
{"timestamp":1106612400,"value":7937.571},
{"timestamp":1106613000,"value":7689.271},
{"timestamp":1106613600,"value":7526.043},
{"timestamp":1106614200,"value":7372.678},
{"timestamp":1106614800,"value":7150.378},
{"timestamp":1106615400,"value":7089.06},
{"timestamp":1106616000,"value":6873.817},
{"timestamp":1106616600,"value":6772.992},
{"timestamp":1106617200,"value":6816.904},
{"timestamp":1106617800,"value":6722.664},
{"timestamp":1106618400,"value":6469.711},
{"timestamp":1106619000,"value":6264.355},
{"timestamp":1106619600,"value":6196.218},
{"timestamp":1106620200,"value":6062.247},
{"timestamp":1106620800,"value":5916.407},
{"timestamp":1106621400,"value":5704.878},
{"timestamp":1106622000,"value":5242.053},
{"timestamp":1106622600,"value":5451.085},
{"timestamp":1106623200,"value":5312.689},
{"timestamp":1106623800,"value":5220.949},
{"timestamp":1106624400,"value":5205.151},
{"timestamp":1106625000,"value":5298.019},
{"timestamp":1106625600,"value":5145.965},
{"timestamp":1106626200,"value":5023.141},
{"timestamp":1106626800,"value":4964.645},
{"timestamp":1106627400,"value":4757.558},
{"timestamp":1106628000,"value":4756.57},
{"timestamp":1106628600,"value":4678.889},
{"timestamp":1106629200,"value":4575.638},
{"timestamp":1106629800,"value":4686.702},
{"timestamp":1106630400,"value":4564.314},
{"timestamp":1106631000,"value":4505.453},
{"timestamp":1106631600,"value":4507.566},
{"timestamp":1106632200,"value":4646.429},
{"timestamp":1106632800,"value":4646.037},
{"timestamp":1106633400,"value":4820.343},
{"timestamp":1106634000,"value":4685.576},
{"timestamp":1106634600,"value":4601.129},
{"timestamp":1106635200,"value":4491.136},
{"timestamp":1106635800,"value":4268.148},
{"timestamp":1106636400,"value":4090.351},
{"timestamp":1106637000,"value":4053.235},
{"timestamp":1106637600,"value":4173.459},
{"timestamp":1106638200,"value":4239.283},
{"timestamp":1106638800,"value":4490.997},
{"timestamp":1106639400,"value":4778.426},
{"timestamp":1106640000,"value":5434.566},
{"timestamp":1106640600,"value":6055.502},
{"timestamp":1106641200,"value":6654.071},
{"timestamp":1106641800,"value":7409.795},
{"timestamp":1106642400,"value":7977.455},
{"timestamp":1106643000,"value":8946.896},
{"timestamp":1106643600,"value":9709.644},
{"timestamp":1106644200,"value":10539.775},
{"timestamp":1106644800,"value":11302.889},
{"timestamp":1106645400,"value":11488.216},
{"timestamp":1106646000,"value":11960.045},
{"timestamp":1106646600,"value":12461.127},
{"timestamp":1106647200,"value":12893.495},
{"timestamp":1106647800,"value":13387.929},
{"timestamp":1106648400,"value":13771.031},
{"timestamp":1106649000,"value":13834.701},
{"timestamp":1106649600,"value":13891.073},
{"timestamp":1106650200,"value":14167.309},
{"timestamp":1106650800,"value":14337.101},
{"timestamp":1106651400,"value":14995.522},
{"timestamp":1106652000,"value":15525.293},
{"timestamp":1106652600,"value":15925.552},
{"timestamp":1106653200,"value":15193.543},
{"timestamp":1106653800,"value":15135.222},
{"timestamp":1106654400,"value":15042.735},
{"timestamp":1106655000,"value":15127.803},
{"timestamp":1106655600,"value":14994.395},
{"timestamp":1106656200,"value":15065.839},
{"timestamp":1106656800,"value":15024.696},
{"timestamp":1106657400,"value":14798.301},
{"timestamp":1106658000,"value":14999.41},
{"timestamp":1106658600,"value":15503.281},
{"timestamp":1106659200,"value":16013.825},
{"timestamp":1106659800,"value":15316.408},
{"timestamp":1106660400,"value":15631.47},
{"timestamp":1106661000,"value":15574.243},
{"timestamp":1106661600,"value":15597.085},
{"timestamp":1106662200,"value":15753.752},
{"timestamp":1106662800,"value":15738.075},
{"timestamp":1106663400,"value":15708.503},
{"timestamp":1106664000,"value":15491.965},
{"timestamp":1106664600,"value":15509.957},
{"timestamp":1106665200,"value":15613.379},
{"timestamp":1106665800,"value":15030.162},
{"timestamp":1106666400,"value":14755.666},
{"timestamp":1106667000,"value":14797.376},
{"timestamp":1106667600,"value":14687.445},
{"timestamp":1106668200,"value":14236.885},
{"timestamp":1106668800,"value":14194.547},
{"timestamp":1106669400,"value":14037.574},
{"timestamp":1106670000,"value":13847.23},
{"timestamp":1106670600,"value":13351.627},
{"timestamp":1106671200,"value":12663.657},
{"timestamp":1106671800,"value":12330.463},
{"timestamp":1106672400,"value":11925.478},
{"timestamp":1106673000,"value":11872.891},
{"timestamp":1106673600,"value":11442.715},
{"timestamp":1106674200,"value":11387.098},
{"timestamp":1106674800,"value":11309.763},
{"timestamp":1106675400,"value":10948.791},
{"timestamp":1106676000,"value":11007.03},
{"timestamp":1106676600,"value":10945.856},
{"timestamp":1106677200,"value":10881.008},
{"timestamp":1106677800,"value":10907.165},
{"timestamp":1106678400,"value":11019.45},
{"timestamp":1106679000,"value":10791.899},
{"timestamp":1106679600,"value":10681.057},
{"timestamp":1106680200,"value":10512.118},
{"timestamp":1106680800,"value":10310.438},
{"timestamp":1106681400,"value":10125.948},
{"timestamp":1106682000,"value":10057.216},
{"timestamp":1106682600,"value":9877.144},
{"timestamp":1106683200,"value":10028.777},
{"timestamp":1106683800,"value":9941.772},
{"timestamp":1106684400,"value":9852.004},
{"timestamp":1106685000,"value":9924.974},
{"timestamp":1106685600,"value":9804.722},
{"timestamp":1106686200,"value":9776.616},
{"timestamp":1106686800,"value":9827.639},
{"timestamp":1106687400,"value":9820.9},
{"timestamp":1106688000,"value":9604.573},
{"timestamp":1106688600,"value":9508.54},
{"timestamp":1106689200,"value":9394.983},
{"timestamp":1106689800,"value":9298.869},
{"timestamp":1106690400,"value":9124.898},
{"timestamp":1106691000,"value":9210.239},
{"timestamp":1106691600,"value":9038.741},
{"timestamp":1106692200,"value":9048.664},
{"timestamp":1106692800,"value":8776.879},
{"timestamp":1106693400,"value":8611.373},
{"timestamp":1106694000,"value":8645.388},
{"timestamp":1106694600,"value":8617.778},
{"timestamp":1106695200,"value":8767.359},
{"timestamp":1106695800,"value":8836.251},
{"timestamp":1106696400,"value":9081.559},
{"timestamp":1106697000,"value":8830.571},
{"timestamp":1106697600,"value":8653.171},
{"timestamp":1106698200,"value":8391.445},
{"timestamp":1106698800,"value":8113.908},
{"timestamp":1106699400,"value":8192.223},
{"timestamp":1106700000,"value":8012.92},
{"timestamp":1106700600,"value":7677.459},
{"timestamp":1106701200,"value":7446.613},
{"timestamp":1106701800,"value":7369.918},
{"timestamp":1106702400,"value":7099.711},
{"timestamp":1106703000,"value":7004.307},
{"timestamp":1106703600,"value":6924.836},
{"timestamp":1106704200,"value":6779.333},
{"timestamp":1106704800,"value":6513.493},
{"timestamp":1106705400,"value":6395.383},
{"timestamp":1106706000,"value":6242.622},
{"timestamp":1106706600,"value":6223.166},
{"timestamp":1106707200,"value":6253.526},
{"timestamp":1106707800,"value":6083.68},
{"timestamp":1106708400,"value":5981.38},
{"timestamp":1106709000,"value":5868.281},
{"timestamp":1106709600,"value":5674.258},
{"timestamp":1106710200,"value":5608.194},
{"timestamp":1106710800,"value":5755.903},
{"timestamp":1106711400,"value":5809.925},
{"timestamp":1106712000,"value":5656.045},
{"timestamp":1106712600,"value":5506.501},
{"timestamp":1106713200,"value":5402.315},
{"timestamp":1106713800,"value":5284.349},
{"timestamp":1106714400,"value":5333.075},
{"timestamp":1106715000,"value":5178.655},
{"timestamp":1106715600,"value":5090.369},
{"timestamp":1106716200,"value":5049.777},
{"timestamp":1106716800,"value":5075.784},
{"timestamp":1106717400,"value":4958.486},
{"timestamp":1106718000,"value":5038.486},
{"timestamp":1106718600,"value":5049.498},
{"timestamp":1106719200,"value":5039.949},
{"timestamp":1106719800,"value":4970.78},
{"timestamp":1106720400,"value":4828.042},
{"timestamp":1106721000,"value":4756.332},
{"timestamp":1106721600,"value":4941.178},
{"timestamp":1106722200,"value":4881.199},
{"timestamp":1106722800,"value":4895.214},
{"timestamp":1106723400,"value":5054.014},
{"timestamp":1106724000,"value":5129.938},
{"timestamp":1106724600,"value":5217.673},
{"timestamp":1106725200,"value":5601.359},
{"timestamp":1106725800,"value":5867.055},
{"timestamp":1106726400,"value":6143.59},
{"timestamp":1106727000,"value":6854.615},
{"timestamp":1106727600,"value":7446.764},
{"timestamp":1106728200,"value":7858.133},
{"timestamp":1106728800,"value":8349.901},
{"timestamp":1106729400,"value":9164.811},
{"timestamp":1106730000,"value":10309.436},
{"timestamp":1106730600,"value":11248.214},
{"timestamp":1106731200,"value":11525.925},
{"timestamp":1106731800,"value":11724.549},
{"timestamp":1106732400,"value":12189.63},
{"timestamp":1106733000,"value":12207.343},
{"timestamp":1106733600,"value":12610.584},
{"timestamp":1106734200,"value":12907.487},
{"timestamp":1106734800,"value":13037.799},
{"timestamp":1106735400,"value":13022.168},
{"timestamp":1106736000,"value":12948.532},
{"timestamp":1106736600,"value":13339.465},
{"timestamp":1106737200,"value":14174.284},
{"timestamp":1106737800,"value":14614.495},
{"timestamp":1106738400,"value":14608.339},
{"timestamp":1106739000,"value":15095.475},
{"timestamp":1106739600,"value":14920.899},
{"timestamp":1106740200,"value":14648.763},
{"timestamp":1106740800,"value":14768.581},
{"timestamp":1106741400,"value":14658.514},
{"timestamp":1106742000,"value":15184.749},
{"timestamp":1106742600,"value":14947.452},
{"timestamp":1106743200,"value":14607.728},
{"timestamp":1106743800,"value":14707.732},
{"timestamp":1106744400,"value":15011.532}
],
"callback": "http://your.domain/yourcallback"
}
And the forecast would be:
{
"job_id": "y0urJ0b1d",
"forecast": [
{"value": 15371.6842555261,"timestamp": 1106745000},
{"value": 15726.3631779531,"timestamp": 1106745600},
{"value": 15165.7664597133,"timestamp": 1106746200},
{"value": 15628.302260064,"timestamp": 1106746800},
{"value": 15440.82502282,"timestamp": 1106747400},
{"value": 15324.1351076836,"timestamp": 1106748000},
{"value": 15604.7952319017,"timestamp": 1106748600},
{"value": 15721.1337025797,"timestamp": 1106749200},
{"value": 15573.5275245318,"timestamp": 1106749800},
{"value": 15232.0877379701,"timestamp": 1106750400},
{"value": 15362.4390609337,"timestamp": 1106751000},
{"value": 15584.0304469962,"timestamp": 1106751600},
{"value": 14893.8583066437,"timestamp": 1106752200},
{"value": 14507.5643741134,"timestamp": 1106752800},
{"value": 14651.0832126006,"timestamp": 1106753400},
{"value": 14646.9203817242,"timestamp": 1106754000},
{"value": 14099.4521580997,"timestamp": 1106754600},
{"value": 13957.0522963823,"timestamp": 1106755200},
{"value": 13892.3209687985,"timestamp": 1106755800},
{"value": 13796.6387136149,"timestamp": 1106756400},
{"value": 13213.2376080443,"timestamp": 1106757000},
{"value": 12435.7161377259,"timestamp": 1106757600},
{"value": 12186.0891004378,"timestamp": 1106758200},
{"value": 11865.8196594147,"timestamp": 1106758800},
{"value": 11733.6944810312,"timestamp": 1106759400},
{"value": 11223.3791266108,"timestamp": 1106760000},
{"value": 11243.4642857528,"timestamp": 1106760600}
]
}