Connect to the PredictFlow API from JavaScript, Python, or PHP. Get an API key, install an SDK, and make your first call in a few minutes. Every SDK is open source and verified against this same API - nothing here is aspirational.
From Settings → Security, create a personal access token. It authenticates as you, the same as your session login - the full key (pk_live_...) is shown once, so copy it immediately.
Pick JavaScript, Python, or PHP - see SDKs below. No SDK for your language? Call the REST API directly with any HTTP client.
List your connected stores, then forecast a product:
import { PredictFlow } from '@predictflow/sdk';
const client = new PredictFlow({
apiKey: process.env.PREDICTFLOW_API_KEY, // server-side only
});
const stores = await client.stores.list();
const forecast = await client.products.forecast(stores[0].id, {
horizonDays: 30,
});
console.log(forecast.forecast_data);Every request authenticates with a Bearer token in the Authorization header:
curl https://predictflow.co/api/v1/stores \
-H "Authorization: Bearer pk_live_..."Official, open-source, MIT-licensed. Each one is a thin, typed client verified directly against this API before every release.
npm install @predictflow/sdkimport { PredictFlow } from '@predictflow/sdk';
const client = new PredictFlow({
apiKey: process.env.PREDICTFLOW_API_KEY, // server-side only
});
const stores = await client.stores.list();
const forecast = await client.products.forecast(stores[0].id, {
horizonDays: 30,
});
console.log(forecast.forecast_data);pip install predictflowfrom predictflow import PredictFlow
client = PredictFlow(api_key="pk_live_...") # or PREDICTFLOW_API_KEY env var
stores = client.stores.list()
forecast = client.products.forecast(stores[0]["id"], horizon_days=30)
print(forecast["forecast_data"])composer require predictflow/sdkuse PredictFlow\Sdk\PredictFlow;
$client = new PredictFlow(apiKey: 'pk_live_...');
$stores = $client->stores->list();
$forecast = $client->products->forecast($stores[0]['id'], horizonDays: 30);
echo $forecast['forecast_data'];Base URL:
https://predictflow.co/api/v1Every SDK method wraps one of these endpoint groups - call them directly if there's no SDK for your language yet:
Connect Shopify/WooCommerce, trigger syncs, import CSV catalogs and orders.
Catalog, inventory health, ABC analysis, forecasting, cost/margin, competitor prices.
Monte Carlo simulation, stockout risk, and inventory policy for an existing forecast.
KPIs, revenue trends, day-of-week seasonality, product growth, projections.
Elasticity, optimization, simulation, cross-elasticity, batch repricing.
What-if scenario planning and side-by-side comparisons.
Alert rules, templates, and evaluation history.
CSV/XLSX/PDF exports of products, sales, inventory, forecasts, reorder, dead stock.
Every method, parameter, and response field across these 8 groups is documented in an interactive reference - filtered to only this public surface, nothing internal:
Open full API reference ↗300 requests per minute per API key. A 429 response includes a Retry-After header - every SDK reads it and backs off automatically on the retryable methods (GET/PUT/DELETE).
Non-2xx responses return JSON with a detail field. Validation errors (422) return an array of field-level messages rather than a single string - every SDK unwraps this into a readable error message automatically:
{
"detail": [
{ "loc": ["query", "horizon_days"], "msg": "Input should be greater than 0", "type": "greater_than" }
]
}Start your 14-day free trial, connect a store, and create your first API key from Settings.
Start free trial