AcadmyAI Logo Level 2 Middleware
Console Portal | V2.0.1 (Production)

API Reference

Welcome to the Level 2 Financial Data Middleware API. This service abstracts the complexities of listed Indian market providers (Upstox, Paytm Money, Groww) to deliver clean, normalized financial statements, sentiment catalysts, EOD pricing logs, and competitor peer structures across the NSE and BSE.

Redistribution-Fee-Free Architecture

By utilizing a dynamic provider token exchange (BYOK/OAuth re-authentication), Level 2 operates without incurring high market-data redistribution fees, routing requests directly using credentials managed on the Admin Console.

Quickstart Guide

To begin querying listed stock data, make sure your provider tokens are configured and validated inside the Level 2 Admin Console dashboard. You can issue requests to the production API gateway base URL:

https://market.acadmyai.com/v2

Authentication Flow

For automated callbacks and re-authentication flows, listed providers route callbacks to the verified production custom domain. Ensure your redirect URI settings inside your broker portals (Upstox Developer, Paytm Money Developer) match:

https://market.acadmyai.com/index.html
GET /stocks/{ticker}/quote

Returns the daily closing price (EOD) or a 15-minute delayed market price during live trading hours.

Path Parameters

Field Type Description
ticker string The unique NSE/BSE stock symbol (e.g. 20MICRONS, TCS).
curl -X GET "https://market.acadmyai.com/v2/stocks/20MICRONS/quote"
import requests

url = "https://market.acadmyai.com/v2/stocks/20MICRONS/quote"
response = requests.get(url)
print(response.json())
{
  "ticker": "20MICRONS",
  "exchange": "NSE",
  "close_price": 124.50,
  "open": 122.00,
  "high": 126.80,
  "low": 121.20,
  "volume": 245000,
  "date": "2026-07-20"
}
GET /stocks/{ticker}/ohlcv

Fetches EOD and historical OHLCV candles list. If live provider fails, automatically falls back to local database logs.

Query Parameters

Field Type Description
interval string Time interval (30m, 1d, 1w, 1mo). Default is 1d.
days_back integer Number of calendar days back to fetch (Range: 1 to 365). Default is 30.
curl -X GET "https://market.acadmyai.com/v2/stocks/20MICRONS/ohlcv?days_back=5"
import requests

url = "https://market.acadmyai.com/v2/stocks/20MICRONS/ohlcv"
params = {"days_back": 5}
response = requests.get(url, params=params)
print(response.json())
{
  "ticker": "20MICRONS",
  "exchange": "NSE",
  "data": [
    {
      "date": "2026-07-20",
      "open": 122.00,
      "high": 126.80,
      "low": 121.20,
      "close": 124.50,
      "volume": 245000
    }
  ]
}
GET /stocks/{ticker}/financials

Returns quarterly or annual historical financial statement rows. Features a dynamic Yahoo Finance backup resolver with float cleaning to prevent JSON formatting errors.

curl -X GET "https://market.acadmyai.com/v2/stocks/20MICRONS/financials"
import requests

url = "https://market.acadmyai.com/v2/stocks/20MICRONS/financials"
response = requests.get(url)
print(response.json())
{
  "ticker": "20MICRONS",
  "type": "income_statement",
  "statements": [
    {
      "period": "2026-03-31",
      "revenue": 1850000000.0,
      "gross_profit": 380000000.0,
      "gross_margin": 0.2054,
      "ebitda": 285000000.0,
      "pat": 176000000.0,
      "eps": 4.99
    }
  ]
}
GET /stocks/{ticker}/shareholding

Returns promoter, institutional (FII, DII), and retail holding configurations.

curl -X GET "https://market.acadmyai.com/v2/stocks/20MICRONS/shareholding"
{
  "ticker": "20MICRONS",
  "quarter": "Q1 FY27",
  "promoters": 58.5,
  "fii": 18.2,
  "dii": 12.3,
  "public": 11.0
}
GET /stocks/{ticker}/peers

Benchmarks the stock against sector competitors, displaying compared valuation ratios.

curl -X GET "https://market.acadmyai.com/v2/stocks/20MICRONS/peers"
{
  "ticker": "20MICRONS",
  "industry": "Mining & Minerals",
  "peers": [
    {
      "ticker": "COMPETITOR_A",
      "pe_ratio": 24.5,
      "pb_ratio": 3.1
    }
  ]
}
GET /stocks/{ticker}/news

Returns aggregated news articles with NLP computed sentiment catalysts (Bullish, Bearish, Neutral).

curl -X GET "https://market.acadmyai.com/v2/stocks/20MICRONS/news"
{
  "ticker": "20MICRONS",
  "sentiment_score": 0.75,
  "sentiment_class": "Bullish",
  "news": [
    {
      "headline": "Company announces strong Q1 sales consolidations.",
      "sentiment_score": 0.82,
      "sentiment_class": "Bullish"
    }
  ]
}

Level 3 Advisory & Execution Consumption APIs

GET /v2/market/tickers

Returns all listed market tickers filtered by sector, exchange, and market capitalization class (LargeCap, MidCap, SmallCap).

curl -X GET "https://market.acadmyai.com/v2/market/tickers?sector=Information%20Technology&limit=5"
{
  "total": 3,
  "tickers": [
    { "ticker": "TCS", "name": "Tata Consultancy Services", "sector": "Information Technology", "cap_class": "LargeCap" },
    { "ticker": "INFY", "name": "Infosys Ltd", "sector": "Information Technology", "cap_class": "LargeCap" }
  ]
}
GET /v2/market/sectors

Returns distinct industry sectors/segments, company counts, and leading tickers for peer benchmarking.

GET /v2/market/signals/{ticker}

Quantitative Trade Advisory API. Calculates Buy/Sell Action, Confidence Score, ATR Volatility-Adjusted Stop Loss, Target 1 (1:2 R/R), Target 2 (1:4 R/R), and Risk-Managed Position Size %.

curl -X GET "https://market.acadmyai.com/v2/market/signals/RELIANCE"
{
  "ticker": "RELIANCE",
  "current_price": 2850.5,
  "recommendation": {
    "action": "STRONG_BUY",
    "confidence_score": 84.5,
    "entry_price": 2850.5,
    "stop_loss": 2793.5,
    "target_1": 2964.5,
    "target_2": 3078.5,
    "risk_reward_ratio": "1 : 2.0",
    "suggested_position_size_pct": 5.5
  },
  "technical_indicators": {
    "rsi_14": 58.4,
    "sma_20": 2810.0,
    "atr_14": 38.0
  },
  "reasoning": [
    "Price trading above 20-day and 50-day SMAs.",
    "RSI at 58.4 showing strong bullish momentum.",
    "Stop Loss set at ₹2,793.50 based on 1.5x ATR risk volatility."
  ]
}
POST /v2/market/signals/batch

Evaluates batch tickers or sector companies simultaneously, returning ranked trade signals sorted by confidence score.

GET /v2/market/recommendations

Returns top ranked market trade recommendations across all tracked equities for Level 3 execution agents.