Embed Pakistan's most advanced AI stock analyzer into any website or mobile app. 12-agent pipeline, real-time PSX data, sector intelligence, and smart money tracking.

🚀 Quick Start

1. iframe Embed (Simplest)

Add this single line to embed anywhere on your site:

<iframe
  src="https://psx.trendandbrands.com/embed.html?ticker=ENGRO&token=YOUR_API_KEY"
  width="100%"
  height="700px"
  frameborder="0"
  allow="clipboard-write">
</iframe>

2. JavaScript SDK (Recommended)

Programmatic control with the SDK:

<script src="https://psx.trendandbrands.com/sdk.js"></script>
<div id="psx-widget"></div>
<script>
  TrendBrandsPSX.init({
    apiKey: 'YOUR_API_KEY',
    container: '#psx-widget',
    ticker: 'ENGRO',
    theme: 'dark',
    width: '100%',
    height: '700px',
    onReady: () => console.log('Widget ready'),
    onError: (err) => console.error(err)
  });
</script>

3. Dynamic Ticker Change

const widget = TrendBrandsPSX.init({...});

// Later, navigate to different stock
widget.navigate('HBL');
widget.navigate('LUCK');

// Cleanup
widget.destroy();

📡 REST API

For headless integrations (mobile apps, server-side rendering), use direct API access:

GET /api/stock/:ticker Auth required

Full analysis data for a stock. Returns price, fundamentals, technicals, news, sector intelligence, and smart money signals.

curl -X GET "https://psx.trendandbrands.com/api/stock/ENGRO" \
  -H "X-API-Key: YOUR_API_KEY"

Response:

{
  "success": true,
  "ticker": "ENGRO",
  "data": {
    "price": {
      "current": 285.50,
      "change": 4.20,
      "changePercent": 1.49,
      "volume": 1250000,
      "marketCap": 165.4,
      "week52High": 320.00,
      "week52Low": 180.00,
      "dataDate": "2026-05-19",
      "source": "Sarmaaya",
      "dataQuality": "CROSS-VERIFIED"
    },
    "fundamentals": { "pe": 8.5, "eps": 33.6, "roe_pct": 18.4, ... },
    "technicals": { "rsi14": 58, "macd": 1.2, ... },
    "news": [...],
    "macro": { "sbpRate_pct": 11, "pkrUsd": 280, ... },
    "sector": { "sectorTrend": "BULLISH", "stockRanking": {...}, ... },
    "smartMoney": { "smartMoneySignal": "BUY", ... }
  },
  "metadata": {
    "timestamp": "2026-05-19T15:30:00Z",
    "agentsRun": 12,
    "agentsSuccessful": 11,
    "elapsedMs": 18500
  }
}
GET /api/market/overview

KSE-100 index, macro indicators, trading status. No auth required for basic data.

POST /api/embed/token

Generate an embed token for restricted-domain use.

curl -X POST "https://psx.trendandbrands.com/api/embed/token" \
  -H "Content-Type: application/json" \
  -d '{"apiKey":"YOUR_KEY","domain":"yoursite.com","expiry":86400}'

⚙ Configuration Options

OptionTypeDefaultDescription
apiKeystringrequiredYour Trend & Brands API key
containerstring|ElementrequiredCSS selector or DOM element
tickerstring'ENGRO'Initial PSX ticker to load
theme'dark'|'light''dark'Color theme (dark recommended)
widthstring'100%'iframe width (CSS units)
heightstring'700px'iframe height (recommended 700px+)
onReadyfunctionCalled when widget loaded
onErrorfunctionCalled on initialization errors

🔐 Authentication

API keys can be obtained from the Trend & Brands API portal. Plans:

PlanRequests/dayPrice
Free100PKR 0
Starter1,000PKR 1,500/mo
Pro10,000PKR 8,000/mo
EnterpriseUnlimitedContact sales

📱 Mobile App Integration

React Native (WebView)

import { WebView } from 'react-native-webview';

<WebView
  source={{ uri: 'https://psx.trendandbrands.com/embed.html?ticker=ENGRO&token=YOUR_KEY' }}
  style={{ flex: 1 }}
/>

Flutter (webview_flutter)

WebView(
  initialUrl: 'https://psx.trendandbrands.com/embed.html?ticker=ENGRO&token=YOUR_KEY',
  javascriptMode: JavascriptMode.unrestricted,
)

🎯 Available Tickers

49 top PSX stocks across all major sectors. Examples:

ENGRO · LUCK · HBL · UBL · MCB · NBP · OGDC · PSO · PPL · POL · MARI · FFC · EFERT · FATIMA · FFBL · HUBC · KAPCO · KEL · DGKC · MLCF · KOHC · CHCC · PIOC · BAFL · BAHL · ABL · MEBL · AKBL · FABL · NESTLE · UNILEVER · NATF · COLG · EFOODS · SYS · TRG · NETSOL · SEARL · GLAXO · HINOON · ABOT · FEROZ · INDU · HCAR · PSMC · MTL · ICI · LOTCHEM · EPCL

📊 Multi-Agent AI Engine

Every analysis runs through a 12-agent pipeline in 3 phases:

Phase 1 — Data Scraping (parallel ~5-8s):
PSX Official, Sarmaaya Deep (4 endpoints), Investkar (4 endpoints), Khistocks backup

Phase 2 — Validation + News + Macro (parallel ~8-12s):
AI Cross-Validator (Claude), SBP Macro, Business Recorder, Mettis Global, KSE-100, Historical OHLCV

Phase 3 — Deep AI Analysis (parallel ~12-20s):
AI Sector Intelligence (peer comparison), AI Smart Money Tracker (insider/bulk/FIPI)

⚠ Disclaimer: Data freshness depends on source availability. All AI recommendations include confidence scores and reasoning. This is NOT financial advice — for educational purposes only. Always verify on psx.com.pk and consult a SECP-registered advisor.

🆘 Support

Email: api@trendandbrands.com
Documentation: docs.trendandbrands.com
Status page: status.trendandbrands.com

Powered by Trend & Brands AI Engine · trendandbrands.com