/v1/demand-builder/seedsRetrieves the list of foundational .parquet files available for simulations.
- Response:
{"files": ["seed_1.parquet", "seed_2.parquet"]}
Welcome to the Variable API! This API allows you to programmatically run pricing simulations, interactively build demand profiles, and perform powerful Exploratory Data Analysis (EDA) on the resulting scenario datasets.
All endpoints in the Variable API (under the /v1/ prefix) are secured and require
tenant-isolated authentication.
You must pass your JSON Web Token (JWT) in the Authorization header of every request:
Authorization: Bearer <your_access_token>
willingness_to_pay.The Demand Builder allows you to run an active learning loop to iteratively determine the willingness-to-pay for various customer profiles.
/v1/demand-builder/seedsRetrieves the list of foundational .parquet files available for simulations.
{"files": ["seed_1.parquet", "seed_2.parquet"]}/v1/demand-builder/initBegins a new simulation by passing an Ideal Customer Profile (ICP) and the initial Willingness to Pay (WTP).
DemandBuilderInitRequest{
"offer": "Premium Subscription",
"price_point": 49.99,
"icp_attributes": {"IS_REGION": "1.0"},
"icp_wtp": 60.0,
"prioritized_questions": ["IS_REGION", "IS_AGE"],
"origin_parquet_file": "seed_1.parquet"
}
/v1/demand-builder/{scenario_id}/nextSubmits the user's evaluation of the previous profiles and returns the next batch of profiles to be evaluated by the active learning engine.
DemandBuilderNextRequestOnce a scenario is generated, you can query its structure and raw records.
/v1/scenarios/Returns all scenario files available in your workspace.
/v1/scenarios/{scenario_id}/schemaReturns the data types for all columns.
/v1/scenarios/{scenario_id}/questionsExtracts the human-readable question text and categorical options from the Parquet metadata.
{
"questions": [
{
"column": "IS_REGION",
"text": "What region are you currently in?",
"options": {"1.0": "North", "2.0": "South"}
}
]
}
/v1/scenarios/{scenario_id}/records?limit=50&cursor=0&sort=-willingness_to_pay
Retrieves paginated, filtered raw data rows from the scenario.
The EDA engine uses Pandas on the backend to perform lightning-fast aggregations on your scenario datasets. Responses are formatted perfectly for charting libraries (like Chart.js).
/v1/scenarios/{scenario_id}/functions/edaEdaQueryRequest{
"x_axis": "IS_REGION",
"y_axis": "IS_GENDER",
"z_axis": "willingness_to_pay",
"method": "mean"
}
Supported methods: mean, median, sum, count,
min, max.
EdaQueryResponseThe response automatically maps numerical categories back to their human-readable strings based on the Parquet metadata.
{
"labels": ["North", "South", "East", "West"],
"datasets": [
{
"label": "Male",
"data": [45.5, 50.0, null, 42.1]
},
{
"label": "Female",
"data": [48.0, 52.5, 41.0, 44.0]
}
]
}
If you prefer to interact with the API via a user interface, we provide two HTML playgrounds:
http://api.tryvariable.com/api/playground/http://api.tryvariable.com/api/playground/eda/The API adheres to the RFC 9457 standard for Problem Details. If a request fails, you will receive a structured JSON response:
{
"type": "https://api.variable.sh/errors/invalid-method",
"title": "Invalid Aggregation Method",
"status": 400,
"detail": "Method 'variance' is not supported.",
"instance": "/v1/scenarios/123/functions/eda"
}