{"docs":"# Pazieh Financial Intelligence API  Agent Guide\n\n## Data Quality\n- **Support/Resistance levels**: Production-grade. Consolidated from pivot clustering, reliable across all timeframes.\n- **Pattern detection**: Experimental. Chart patterns (H&S, flags, etc.) are algorithmically detected and may produce false positives. Always validate with other indicators.\n\n## Base URL\n`https://pazieh.com`\n\n## Authentication\nNone required for free endpoints. Rate limit: 30 requests/minute.\n\n## x402 Micropayments\nPremium endpoints require payment via the [x402 protocol](https://x402.org). Send a payment header with your request.\n\n**Paid endpoints:**\n| Endpoint | Price |\n|----------|-------|\n| `/ta/{symbol}` | $0.005 USDC |\n| `/ta/batch/{symbols}` | $0.02 USDC |\n| `/analysis/{symbol}` | $0.01 USDC |\n\n**Payment details:**\n- Network: Polygon (eip155:137)\n- Currency: USDC\n- Recipient: `0x3a9928bC92beBA99E20cFb7AfA1d5A85AD83560E`\n- Facilitator: Self-hosted (auto-negotiated via 402 headers)\n\nWithout payment, these endpoints return HTTP 402 with payment requirements in the `payment-required` header.\n\n**Free endpoints** (no payment needed): `/`, `/health`, `/price/{symbol}`, `/report/{symbol}`, `/chart-data/{symbol}`, `/docs`, `/docs/agent`, `/pricing`\n\n## Endpoints\n\n### `GET /analysis/{symbol}?interval=1d&multi_tf=false`\n**Primary endpoint for AI agents.** Returns structured, actionable analysis.\n\n**Parameters:**\n- `symbol` (path)  Ticker symbol (e.g., `ETH-USD`, `AAPL`, `BTC-USD`)\n- `interval` (query)  Timeframe: `1s|5s|15s|30s|1m|5m|15m|30m|1h|4h|1d|1wk` (sub-minute only for crypto via Binance) (default: `1d`)\n- `multi_tf` (query)  Set `true` for multi-timeframe analysis (Weekly + Daily + 4H)\n\n**Response structure:**\n```json\n{\n  \"symbol\": \"ETH-USD\",\n  \"timestamp\": \"2026-02-21T17:00:00Z\",\n  \"overall_bias\": \"bearish\",          // Only with multi_tf=true\n  \"all_active_setups\": [...],         // Only with multi_tf=true\n  \"timeframes\": {\n    \"1d\": {\n      \"price\": 1987.05,\n      \"trend\": \"BEARISH (STRONG)\",\n      \"rating\": \"SELL\",\n      \"suggested_bias\": \"bearish\",\n      \"indicators\": {\n        \"rsi\": 42.3,                  // <30 oversold, >70 overbought\n        \"macd_histogram\": -12.5,      // >0 bullish, <0 bearish\n        \"adx\": 28.5,                  // >25 strong trend\n        \"atr\": 85.2,                  // Average True Range (volatility)\n        \"ema_alignment\": \"all_bearish\" // all_bullish|mostly_bullish|mixed|mostly_bearish|all_bearish\n      },\n      \"support_resistance\": [\n        {\"price\": 1900, \"type\": \"support\", \"touches\": 3, \"distance_pct\": -4.38}\n      ],\n      \"active_setups\": [\n        {\n          \"type\": \"bear_pennant\",\n          \"direction\": \"bearish\",\n          \"confidence\": 0.6,\n          \"outcome\": \"active\",\n          \"setup\": {\n            \"side\": \"short\",\n            \"entry\": 1906.82,\n            \"stop_loss\": 2037.16,\n            \"take_profit\": 1776.48,\n            \"risk_reward\": 1.0,\n            \"trigger\": \"Break below lower trendline\"\n          }\n        }\n      ],\n      \"completed_patterns\": [...],\n      \"candlestick_signals\": [\n        {\"type\": \"doji\", \"direction\": \"neutral\", \"label\": \"✚ Doji\"}\n      ],\n      \"signals\": [\"MACD_BEARISH_CROSS\"]\n    }\n  }\n}\n```\n\n### How to use this data\n\n**For trade decisions:**\n1. Check `suggested_bias` (or `overall_bias` for multi-TF) for direction\n2. Look at `active_setups` for specific trade entries with stop loss and targets\n3. Validate with `indicators` (RSI extremes, ADX trend strength, EMA alignment)\n4. Check `support_resistance` for nearby levels and `distance_pct` to gauge proximity\n5. Use `candlestick_signals` as confirmation\n\n**Setup fields explained:**\n- `side`: \"long\", \"short\", or \"range\"\n- `entry`: Price level to enter the trade\n- `stop_loss`: Price to exit if trade goes wrong\n- `take_profit`: Price target\n- `risk_reward`: Reward / Risk ratio (higher is better, >2.0 is good)\n- `trigger`: Human-readable condition for entry\n\n**For range setups (rectangles):**\n- Contains both `long_entry/stop_loss/take_profit` and `short_entry/stop_loss/take_profit`\n- `current_position`: tells you if price is `near_support` or `near_resistance`\n\n**Confidence scores:** 0.0 to 1.0. Volume-confirmed patterns get a boost. >0.7 = high confidence.\n\n**Outcome values:**\n- `active`  Pattern is forming or just completed, setup is live\n- `hit`  Target was reached (historical)\n- `failed`  Pattern failed (historical)\n\n### Other endpoints\n- `GET /ta/{symbol}?interval=1d`  Raw indicators only (lighter)\n- `GET /ta/batch/{symbols}?interval=1d`  Batch analysis (up to 10 symbols, comma-separated)\n- `GET /price/{symbol}`  Current price + OHLCV\n- `GET /report/{symbol}`  Human-readable HTML report with interactive charts\n- `GET /health`  API health check\n\n### Rate Limits\n30 requests/minute per IP. Data cached for 5 minutes.\n\n### Tips for agents\n- Use `multi_tf=true` for comprehensive analysis before major decisions\n- Single timeframe is faster and cheaper  use for quick checks\n- Check `distance_pct` on S/R levels to find nearby levels (within ±2% = imminent)\n- Combine `active_setups` with `ema_alignment` for higher conviction trades\n- `signals` array contains key technical events (crosses, squeezes, extremes)\n"}