Skip to main content
POST
/
api
/
text2sql
/
predict
Predict Data
curl --request POST \
  --url https://api.example.com/api/text2sql/predict \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "chartType": "<string>",
  "data": {
    "columns": [
      "<string>"
    ],
    "rows": [
      {}
    ]
  },
  "mapping": {
    "xAxis": "<string>",
    "yAxis": "<string>",
    "valueAxis": "<string>"
  },
  "predictPeriods": 5
}
'
{
  "success": true,
  "predictedData": [
    {
      "period": "<string>",
      "predictedValue": 123,
      "confidenceLower": 123,
      "confidenceUpper": 123
    }
  ],
  "chartType": "<string>",
  "confidence": "<string>",
  "trendAnalysis": "<string>",
  "error": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request schema for data prediction

chartType
string
required

Chart type: bar, pie, line

data
ChartData · object
required

Chart data

mapping
DataMapping · object

Data mapping for axes

predictPeriods
integer
default:5

Number of periods to predict

Response

Successful Response

Response schema for data prediction

success
boolean
required
predictedData
PredictionPoint · object[]
required
chartType
string
required
confidence
string | null
trendAnalysis
string | null
error
string | null