Request Parameters
Body
The dataset to make predictions on. This is an array of objects with keys
date and value. See example below for more information. The date parameter must be in YYYY-MM-DD format (e.g., “2023-01-01”).
Minimum: 5 data points
Maximum: 1000 data points
Note: The larger the dataset provided, the more accurate the predictions become.
For best results, provide at least 20-30 data points with consistent intervals. Show Dataset Object Properties
The numeric value for the data point.
The date for the data point in YYYY-MM-DD format (e.g., “2023-01-01”).
The number of predictions to make. - Minimum: 1 - Maximum: 500
Sample Dataset
A dataset must be an array of object containing keys date and value.
type Dataset = {
date : string ,
value : number | string ,
};
const dataset : Array < Dataset > = [
{ date: "2023-01-01" , value: 353459 },
{ date: "2023-01-02" , value: 313734 },
{ date: "2023-01-03" , value: 333774 },
{ date: "2023-01-04" , value: 348636 },
{ date: "2023-01-05" , value: 278903 },
];
Response Structure
Indicates whether the call was successful.
Usage information for the API call. Number of input tokens processed.
Number of output tokens generated.
Number of tokens processed during inference time.
Total number of tokens used (input + output).
Array of predicted data points with the same structure as the input dataset. Show Prediction Object Properties
The date for the predicted data point in YYYY-MM-DD format.
The predicted numeric value for this data point.
The number of prediction steps.
Javascript
Python
Curl
PHP
Ruby
Go
Java
Swift
Dart
Kotlin
C#
import { JigsawStack } from "jigsawstack" ;
const jigsaw = JigsawStack ({ apiKey: "your-api-key" });
const response = await jigsaw . prediction ({
"dataset" : [
{
"date" : "2023-01-01" ,
"value" : 353459
},
{
"date" : "2023-01-02" ,
"value" : 313734
},
{
"date" : "2023-01-03" ,
"value" : 333774
},
{
"date" : "2023-01-04" ,
"value" : 348636
},
{
"date" : "2023-01-05" ,
"value" : 278903
}
],
"steps" : 3
})
{
"success" : true ,
"prediction" : [
{
"date" : "2023-01-08 00:00:00" ,
"value" : 315214.5625
},
{
"date" : "2023-01-07 00:00:00" ,
"value" : 320094.71875
},
{
"date" : "2023-01-06 00:00:00" ,
"value" : 316329.9375
}
],
"steps" : 3 ,
"_usage" : {
"input_tokens" : 53 ,
"output_tokens" : 49 ,
"inference_time_tokens" : 1992 ,
"total_tokens" : 2094
}
}