Data API Service - Market Regime & Swing Signals Guide
0. What is the Data API?
The Data API is a REST API that exposes the same market regime, crypto indicators, and swing signals used inside ai Swing X™. You can call it from your own apps, scripts, or dashboards without building data pipelines.
All endpoints return JSON. You need an API key to call them — keys are issued only to registered users (free sign-up). The API is intended for asset allocation, position sizing, algorithmic trading logic, and real-time dashboards.
Base URL: https://aiswingx.com/api/v1/ (or your deployment domain). All requests are GET.
1. Why use this API?
The Data API gives you the same logic that powers ai Swing X™ — without maintaining your own data or calculations.
- Asset allocation: Adjust stock vs cash vs crypto by market cycle (Kostolany phase, crypto phase).
- Position sizing: In risk_off, reduce size; in risk_on, you can lean in.
- Algos & bots: Use swing signals (BUY/SELL/HOLD) and confidence for entries and exits.
- Dashboards & alerts: One call per day or per session to drive UI or notifications.
All 12 endpoints return JSON. The meaning of each field is explained in section 3.
2. When to use it
| Use case | Suggested endpoints | Typical frequency |
|---|---|---|
| Asset allocation by cycle | kostolany-phase, crypto-phase | Once per day |
| Risk-on / risk-off (position size) | risk-regime, market/risk-regime | Daily or per session |
| Trend strength (slope, volatility) | market-slope, volatility-regime | Daily |
| Liquidity / stress | liquidity-pressure, market/volume-flow | Daily |
| Swing entry/exit (algo or alert) | signal/swing, btc-swing, eth-swing | Daily or on bar close |
3. What the numbers mean
Understanding the response fields helps you use the API correctly.
Each indicator answers a specific question: Where are we in the cycle? Should I size up or down? Is now a good time to enter or exit? Below we explain what each value means, why it matters, and how to use it in practice — with example scenarios.
Regime — Kostolany phase
kostolany_phase: A1, A2, A3, B1, B2, B3. Six phases of the market cycle (based on André Kostolany).
- A1 — Bottom forming: low volatility, sideways.
- A2 — Uptrend: prices rising.
- A3 — Overheating: strong rise, high RSI or rising VIX.
- B1 — Top: uptrend + fear (high VIX) or overbought.
- B2 — Downtrend: peak-to-drop or clear decline.
- B3 — Bottom: selloff + high fear (VIX ≥28–30) or oversold.
source: snapshot (stored daily) or computed. date: as-of date.
Why you need it: To adjust asset allocation (stocks, cash, crypto) by where the market is in its cycle. A1/A2 = early to mid bull; A3/B1 = caution; B2/B3 = reduce risk or look for re-entry later.
Example scenario: If kostolany_phase is B2 (downtrend), you might reduce equity exposure and wait for B3 (bottom) or A1 before adding risk again. In A2, you could lean into growth.
Regime — Market slope
slope_5d, slope_20d: Linear regression slope of closing prices over 5 and 20 days. Positive = uptrend; negative = downtrend.
trend: uptrend, downtrend, or sideways.
Why you need it: To gauge trend strength and direction without building your own charts. Use it to confirm a favorable environment (uptrend) or to avoid fighting the trend (downtrend).
Example scenario: When slope_20d is positive and trend is uptrend, you can use it to confirm a long bias or trend-following entry. When downtrend, reduce size or wait.
Regime — Liquidity pressure
liquidity_score: 0.0–1.0. Higher = more liquidity; lower = stress.
pressure: positive / negative / neutral. market_condition: risk_on / risk_off.
Why you need it: In stress (low liquidity_score), markets tend to gap and whipsaw; in good liquidity, execution and sizing are more predictable.
Example scenario: If liquidity_score drops below 0.4 (stress), consider reducing position size or delaying new entries. Above 0.6, you can size normally within your plan.
Regime — Risk regime
regime: risk_on (favorable) or risk_off (caution). confidence: 0.0–1.0.
Why you need it: A single flag that combines major indices and crypto view. Use it for position sizing: in risk_off, reduce leverage and size; in risk_on, you can lean in.
Example scenario: When regime is risk_off and confidence is high, cut exposure or stay flat. When risk_on, you can add or hold positions according to your strategy.
Market — Crypto phase
phase: Accumulation, Markup, Distribution, Downtrend. cycle_position: 0.0–1.0.
Why you need it: Same idea as Kostolany but for crypto only. Tells you where crypto sits in its own cycle — useful when you separate crypto allocation from stocks.
Example scenario: In Markup phase with cycle_position around 0.5, you might increase crypto allocation; in Downtrend or Distribution, reduce or hedge.
Market — Volatility regime
regime: low / medium / high. score: 0.0–1.0 (higher = more volatile).
Why you need it: High volatility means wider swings — you may want smaller size, wider stops, or to wait. Low volatility allows more stable entries and tighter risk.
Example scenario: If regime is high, use smaller position size or wider stop-loss; in low, normal sizing may apply.
Market — Volume flow
volume_flow_score: 0.0–1.0. Proxy for buying vs selling pressure. pressure: positive / negative / neutral.
Why you need it: Shows whether buying or selling is dominating. Use it to confirm direction before entering or to avoid fading strong pressure.
Example scenario: When volume_flow_score is above 0.6 (positive pressure), it supports a bullish view; below 0.4 suggests selling pressure — use with other signals.
Signal — Swing
signal: BUY, HOLD, or SELL. confidence: 0.0–1.0. holding_period: e.g. 5–20 days.
Why you need it: Direct entry/exit suggestion based on slope and RSI. Use in algos (e.g. only take BUY when confidence > 0.6) or for daily alerts.
Example scenario: If signal is BUY and confidence > 0.7, you might open or add; if SELL with high confidence, consider taking profit or exiting. HOLD means wait.
4. API endpoints reference
All endpoints: GET, JSON response. Send your API key in Authorization: Bearer <key> or X-API-Key: <key> or ?api_key=<key>.
Regime (market cycle & risk)
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/regime/kostolany-phase | Kostolany 6-phase (A1–B3) |
| GET | /api/v1/regime/market-slope | Market slope 5d/20d, trend |
| GET | /api/v1/regime/liquidity-pressure | Liquidity pressure (VIX, rates) |
| GET | /api/v1/regime/risk-regime | Risk-on / Risk-off |
Market (crypto indicators)
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/market/crypto-phase | Crypto market phase |
| GET | /api/v1/market/risk-regime | Crypto risk-on/off |
| GET | /api/v1/market/liquidity-pressure | Crypto liquidity |
| GET | /api/v1/market/volatility-regime | Crypto volatility |
| GET | /api/v1/market/volume-flow | Crypto volume flow proxy |
Signal (swing trading)
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/signal/swing | Major index swing signal |
| GET | /api/v1/signal/btc-swing | BTC-USD swing signal |
| GET | /api/v1/signal/eth-swing | ETH-USD swing signal |
5. How to get started
Only registered users can call the API. Follow these steps:
- Sign up: Create an account on ai Swing X™ (Sign up in the top menu).
- Get your API key: After logging in, go to My API Key (under Data API in the sidebar). Click "Generate API key" and copy the key. Keep it secret.
- Call an endpoint: Send a GET request with your key in the header. Example:
curl -H "Authorization: Bearer YOUR_API_KEY" \ https://aiswingx.com/api/v1/regime/kostolany-phase
Or use X-API-Key: YOUR_API_KEY or ?api_key=YOUR_API_KEY.
Example response:
{"kostolany_phase": "A2", "date": "2026-03-05", "source": "snapshot"} Daily call limits apply per plan (see Pricing). Exceeding the limit returns 429.
6. Pricing & limits
Plans differ by daily API call limit (all 12 endpoints combined):
- Free: 50 calls per day — trial and development.
- Trader: 1,000 calls per day — $29/month.
- Quant: 10,000 calls per day — $99/month.
- Fund: Unlimited — $499/month.
You can subscribe from the API Pricing page or from Billing & Invoices after login.
7. Support & contact
For API issues or questions:
- Email: aiswingx.com@gmail.com
- Telegram: @aiSwingXbot
Disclaimer: The Data API is for informational use. It does not constitute financial advice. Use at your own risk.