Getting Started
Learn how to integrate with the StockyFly API and start accessing market data
Welcome to the StockyFly API documentation. Our API provides programmatic access to real-time and historical market data, portfolio management, and order placement capabilities.
Base URL
All API requests must be made to our base URL:
https://stockyfly.com/api/
API Keys
To use the StockyFly API, you need an API key. You can obtain one by:
- Logging into your StockyFly account
- Navigating to Developer Settings
- Generating a new API key
Important: Keep your API keys secure and never expose them in client-side code.
Authentication
All API requests require authentication using your API key
The StockyFly API uses API keys to authenticate requests. You can include your API key in request headers:
curl -X GET https://stockyfly.com/api/NSE:RELIANCE \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Authentication Headers
Header | Description | Example |
---|---|---|
Authorization | Required. Your API key prefixed with "Bearer " | Bearer sk_test_1234567890 |
Accept | Specifies response format (JSON recommended) | application/json |
X-Kite-Version | API version to use (defaults to latest) | 3 |
Real-time Quotes
Get the latest market prices and trading information
Retrieve real-time quotes for stocks, indices, and derivatives. The response includes last traded price, volume, OHLC values, and market depth.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
instrument | string | Yes | Exchange:tradingsymbol (e.g., NSE:RELIANCE) |
Example Request
curl -X GET "https://stockyfly.com/api/market_quote/NSE:RELIANCE" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"status": "success",
"requested_instruments": [
"NSE:RELIANCE"
],
"data": {
"NSE:RELIANCE": {
"instrument_token": 738561,
"timestamp": "2025-04-24T15:30:00+05:30",
"last_price": 2850.75,
"last_quantity": 200,
"volume": 1520000,
"average_price": 2845.20,
"ohlc": {
"open": 2835.50,
"high": 2862.00,
"low": 2828.25,
"close": 2830.75
},
"depth": {
"buy": [
{"price": 2849.50, "quantity": 150, "orders": 3},
{"price": 2849.00, "quantity": 225, "orders": 5}
],
"sell": [
{"price": 2850.75, "quantity": 180, "orders": 2},
{"price": 2851.25, "quantity": 210, "orders": 4}
]
}
}
}
}
Historical Data
Access historical market data with various timeframes
Retrieve historical OHLC data for instruments with minute, hourly, or daily granularity.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
instrument | string | Yes | Exchange:tradingsymbol (e.g., NSE:RELIANCE) |
timeframe | string | Yes | minute | 5minute | 15minute | 30minute | 60minute | day |
from | string | Yes | Start datetime (YYYY-MM-DD HH:MM:SS) |
to | string | Yes | End datetime (YYYY-MM-DD HH:MM:SS) |
Example Request
curl -X GET "https://stockyfly.com/api/historical_data/NSE:RELIANCE/(minute/5minute/15minute/30minute/1day)/2025-04-01%2009:15:00/2025-04-15%2015:30:00" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"status": "success",
"data": {
"candles": [
["2025-04-01T09:15:00+05:30", 2835.50, 2862.00, 2828.25, 2850.75, 1520000],
["2025-04-02T09:15:00+05:30", 2852.00, 2875.50, 2845.25, 2868.00, 1480000],
["2025-04-03T09:15:00+05:30", 2869.75, 2882.25, 2858.50, 2875.00, 1350000]
]
}
}
Live OI Data
Fetch real-time Open Interest data for indices or stocks
Retrieve live Open Interest (OI) data for instruments like NIFTY, BANKNIFTY, or specific stocks.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
symbol | string | Yes | Instrument symbol (e.g., NIFTY, BANKNIFTY, RELIANCE) |
Example Request
curl -X GET "https://www.stockyfly.com/api/liveoi/NIFTY" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"status": true,
"data": {
"index": "NIFTY",
"current_price": 24414,
"expiry_data": [
{
"expiry_date": "2025-05-08",
"strike_chart": [
23900,
23950,
24000,
24050,
24100,
24150,
24200,
24250,
24300,
24350,
24400,
24450,
24500,
24550,
24600,
24650,
24700,
24750,
24800,
24850,
24900
],
"ce_oi": {
"23900": {
"oi": 84450
},
"23950": {
"oi": 43500
},
"24000": {
"oi": 1853700
},
"24050": {
"oi": 113325
},
"24100": {
"oi": 262050
},
"24150": {
"oi": 306975
},
"24200": {
"oi": 1236075
},
"24250": {
"oi": 985800
},
"24300": {
"oi": 4274925
},
"24350": {
"oi": 5277450
},
"24400": {
"oi": 15708375
},
"24450": {
"oi": 8687250
},
"24500": {
"oi": 18739125
},
"24550": {
"oi": 5864025
},
"24600": {
"oi": 9496350
},
"24650": {
"oi": 4705500
},
"24700": {
"oi": 7514025
},
"24750": {
"oi": 3899850
},
"24800": {
"oi": 7606950
},
"24850": {
"oi": 3414900
},
"24900": {
"oi": 5107875
}
},
"pe_oi": {
"23900": {
"oi": 1857075
},
"23950": {
"oi": 827325
},
"24000": {
"oi": 9564600
},
"24050": {
"oi": 1202025
},
"24100": {
"oi": 3437325
},
"24150": {
"oi": 1851900
},
"24200": {
"oi": 8174400
},
"24250": {
"oi": 4460250
},
"24300": {
"oi": 13381425
},
"24350": {
"oi": 7722150
},
"24400": {
"oi": 11549625
},
"24450": {
"oi": 2744325
},
"24500": {
"oi": 4151175
},
"24550": {
"oi": 681075
},
"24600": {
"oi": 809925
},
"24650": {
"oi": 137025
},
"24700": {
"oi": 233700
},
"24750": {
"oi": 50550
},
"24800": {
"oi": 119700
},
"24850": {
"oi": 20400
},
"24900": {
"oi": 91650
}
}
}
]
}
}
Last Traded Price (LTP) Data
Fetch the latest market price for a given instrument
Use this endpoint to retrieve the most recent price of instruments like NSE:TATASTEEL, NSE:INFY, etc.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
instruments | string | Yes | Instrument in format EXCHANGE:SYMBOL (e.g., NSE:TATASTEEL) |
Example Request
curl -X GET "https://www.stockyfly.com/api/market_ltp/NSE:TATASTEEL" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"status": "success",
"data": {
"NSE:TATASTEEL": {
"instrument_token": 345345,
"last_price": 128.60
}
}
}
Position Assistance API
Get comprehensive analysis for your stock positions including risk assessment, technical indicators, and trading recommendations
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
instrument | string | Yes | Stock symbol (e.g., "RELIANCE", "TATASTEEL") |
price | number | Yes | Your buying price for this position |
risk_type | string | Yes | Either "SMALLRISK" (10% risk) or "MIDRISK" (15% risk) |
Headers
Header | Required | Description |
---|---|---|
Yes | Your registered email address | |
api_key | Yes | Your personal API key |
Accept | Yes | Must be "application/json" |
Example Request
curl -X POST "https://www.stockyfly.com/api/position_assistance" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"instrument": "RELIANCE",
"price": 2500.50,
"risk_type": "SMALLRISK"
}'
Example Response
{
"success": true,
"data": {
"instrument": "RELIANCE",
"analysis_date": "2023-06-15 15:30:00",
"current_price": 2532.75,
"buying_price": 2500.50,
"risk_type": "SMALLRISK",
"risk_percentage": 10,
"risk_price": 2250.45,
"position_status": {
"status": "success",
"message": "Position looks safe. Can hold."
},
"technical_analysis": {
"moving_averages": {
"ma_50": 2450.25,
"ma_100": 2400.50,
"ma_200": 2350.75
},
"indicators": {
"volume_spike": true,
"price_hike": true,
"seven_day_breakout": true
},
"score": 8
},
"recommendations": {
"stoploss": 2425.80,
"target": 2639.70
}
}
}
One Page Analysis API
Get comprehensive single-page analysis for any stock including fundamental data, technical indicators, and investment insights
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
instrument | string | Yes | Stock symbol (e.g., "RELIANCE", "TATASTEEL") included in URL path |
Headers
Header | Required | Description |
---|---|---|
Yes | Your registered email address | |
api_key | Yes | Your personal API key |
Accept | Yes | Must be "application/json" |
Example Request
curl -X GET "https://www.stockyfly.com/api/onepage_analyse/RELIANCE" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"success": true,
"data": {
"date": "2025-05-07",
"company": {
"name": "Reliance Industries Ltd",
"bse_code": "500325",
"nse_code": "RELIANCE",
"about": "Reliance was founded by Dhirubhai Ambani and is now promoted and managed by his elder son, Mukesh Dhirubhai Ambani. Ambani's family has about 50% shareholding in the conglomerate."
},
"fundamentals": {
"sector": "Refineries",
"financial_score": 44
},
"pros": [
"N/A"
],
"cons": [
"Stock is trading at 3.57 times its book value",
"The company has delivered a poor sales growth of 9.01% over past five years.",
"Company has a low return on equity of 8.14% over last 3 years."
],
"technical_indicators": {
"open_low_high_close": false,
"seven_day_breakout": false,
"three_day_volume_spike": false,
"two_day_price_hike": false,
"moving_averages": {
"ma_20": {
"value": 1301.8474999999999,
"position": "above"
},
"ma_50": {
"value": 1263.3450000000003,
"position": "above"
},
"ma_100": {
"value": 1262.1164999999996,
"position": "above"
},
"ma_200": {
"value": 1942.3457500000006,
"position": "below"
}
},
"bullish_score": 30,
"bearish_score": 20
},
"bullish_score": 30,
"bearish_score": 20
}
}
52 Week High/Low API
Retrieve stocks that have reached their 52-week high or low for a specific date.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
date | string | No | Date in YYYY-MM-DD format (e.g., "2025-05-02"). Defaults to latest available date if not provided. |
Headers
Header | Required | Description |
---|---|---|
Yes | Your registered email address | |
api_key | Yes | Your personal API key |
Accept | Yes | Must be "application/json" |
Example Request
curl -X GET "https://www.stockyfly.com/api/52_week_high_low/2025-05-02" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"status": "success",
"message": "52-week high/low data for date 2025-05-02 retrieved successfully",
"date": "2025-05-02",
"data": [
{
"exchange": "BSE",
"type": "high",
"ticker": "GUJA.BO",
"company": "Gujarat Natural Resources",
"price": "46.88",
"week_value": "44.65",
"raw_data": {
"price": 46.88,
"ticker": "GUJA.BO",
"company": "Gujarat Natural Resources",
"52_week_high": 44.65
}
},
{
"exchange": "BSE",
"type": "high",
"ticker": "BODH.BO",
"company": "Bodhtree Consulting",
"price": "42.18",
"week_value": "40.18",
"raw_data": {
"price": 42.18,
"ticker": "BODH.BO",
"company": "Bodhtree Consulting",
"52_week_high": 40.18
}
}
],
"pagination": {
"total": 24,
"per_page": "8",
"current_page": 1,
"last_page": 3,
"from": 1,
"to": 8
}
}
Most Active Stocks API
Fetch data on the most actively traded stocks for a specific date.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
date | string | No | Date in YYYY-MM-DD format (e.g., "2025-05-02"). Defaults to latest available date if not provided. |
Headers
Header | Required | Description |
---|---|---|
Yes | Your registered email address||
api_key | Yes | Your personal API key |
Accept | Yes | Must be "application/json" |
Example Request
curl -X GET "https://www.stockyfly.com/api/most-active/2025-05-02" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"status": "success",
"message": "Most active stocks data for date 2025-05-02 retrieved successfully",
"date": "2025-05-02",
"data": [
{
"symbol": "ETEA.NS",
"company": "Eternal",
"price": "234.2600",
"percent_change": "0.7500",
"net_change": "1.7400",
"volume": 97522610,
"raw_payload": "{\"ask\": 234.26, \"bid\": 234.25, \"low\": 220.05, \"high\": 239.5, \"open\": 220.05, \"close\": 232.52, \"price\": 234.26, \"ticker\": \"ETEA.NS\", \"volume\": 97522610, \"company\": \"Eternal\", \"net_change\": 1.74, \"52_week_low\": 146.3, \"52_week_high\": 304.7, \"overall_rating\": \"Neutral\", \"percent_change\": 0.75, \"long_term_trend\": \"Bearish\", \"short_term_trend\": \"Bullish\", \"up_circuit_limit\": 255.77, \"low_circuit_limit\": 209.26}"
},
{
"symbol": "IOC.NS",
"company": "Indian Oil Corp",
"price": "143.2700",
"percent_change": "3.9200",
"net_change": "5.4100",
"volume": 48721457,
"raw_payload": "{\"ask\": 143.29, \"bid\": 143.27, \"low\": 138.11, \"high\": 144.09, \"open\": 139.79, \"close\": 137.86, \"price\": 143.27, \"ticker\": \"IOC.NS\", \"volume\": 48721457, \"company\": \"Indian Oil Corp\", \"net_change\": 5.41, \"52_week_low\": 110.72, \"52_week_high\": 185.97, \"overall_rating\": \"Moderately Bullish\", \"percent_change\": 3.92, \"long_term_trend\": \"Moderately Bullish\", \"short_term_trend\": \"Bullish\", \"up_circuit_limit\": 151.64, \"low_circuit_limit\": 124.07}"
},
"pagination": {
"total": 10,
"per_page": 100,
"current_page": 1,
"last_page": 1,
"from": 1,
"to": 10
}
}
Price Shockers API
Retrieve stocks experiencing significant price movements for a specific date.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
date | string | No | Date in YYYY-MM-DD format (e.g., "2025-05-02"). Defaults to latest available date if not provided. |
Headers
Header | Required | Description |
---|---|---|
Yes | Your registered email address | |
api_key | Yes | Your personal API key |
Accept | Yes | Must be "application/json" |
Example Request
curl -X GET "https://www.stockyfly.com/api/price_shockers/2025-05-02" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"status": "success",
"message": "Price shockers data for date 2025-05-02 retrieved successfully",
"date": "2025-05-02",
"data": [
{
"symbol": "JSWSTEEL",
"exchange": "NSE",
"company": "Jsw Steel",
"price": "973.2000",
"percent_change": "-5.5000",
"net_change": "-56.6000",
"high": "1037.0000",
"low": "948.3000",
"open_price": "1021.2000",
"volume": 7915918,
"raw_payload": {
"ask": "973.20",
"bid": "0.00",
"low": "948.30",
"ric": "JSTL.NS",
"sma": null,
"date": "2025-05-02",
"high": "1037.00",
"open": "1021.20",
"tick": "0.10",
"time": "10:25:25",
"ylow": "823.80",
"close": "1029.80",
"price": "973.20",
"yhigh": "1074.90",
"volume": "7915918",
"askSize": "2087",
"bidSize": "0.00",
"lotSize": "1.00",
"nseCode": "JSWSTEEL",
"tickerId": "S0003097",
"deviation": "5.25",
"marketCap": "237507.44",
"netChange": "-56.60",
"priceArrow": "⇧",
"description": "The stock's continued downtrend suggests a bearish trend is underway.",
"displayName": "Jsw Steel",
"yearLowDate": "2024-06-04",
"averagePrice": "1027.08",
"exchangeType": "NSI",
"yearHighDate": "2025-03-25",
"averageVolume": null,
"overallRating": "Moderately Bearish",
"percentChange": "-5.50",
"longTermTrends": "Moderately Bearish",
"upCircuitLimit": "1132.70",
"actualDeviation": "-5.25",
"lowCircuitLimit": "926.90",
"shortTermTrends": "Bearish",
"noOfDaysForAverage": "12",
"totalShareOutstanding": "244.05"
}
},
Trending Stocks API
Fetch data on stocks currently trending based on market activity and sentiment.
Headers
Header | Required | Description |
---|---|---|
Yes | Your registered email address | |
api_key | Yes | Your personal API key |
Accept | Yes | Must be "application/json" |
Example Request
curl -X GET "https://www.stockyfly.com/api/trending_stocks" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"status": "success",
"message": "Today's trending stocks retrieved successfully",
"date": "2025-05-09",
"data": [
{
"ticker_id": "S0003022",
"company_name": "Tata Motors",
"price": "680.3000",
"percent_change": "4.9500",
"net_change": "32.1000",
"volume": 30390272,
"date": "2025-05-09",
"time": "10:25:30",
"raw_data": {
"ask": "0.00",
"bid": "680.30",
"low": "641.15",
"ric": "TAMO.NS",
"date": "2025-05-07",
"high": "682.50",
"open": "642.00",
"time": "10:25:30",
"close": "648.20",
"price": "680.30",
"volume": "30390272",
"ask_size": "0.00",
"bid_size": "1228",
"lot_size": "1.00",
"year_low": "535.75",
"ticker_id": "S0003022",
"year_high": "1179.00",
"net_change": "32.10",
"company_name": "Tata Motors",
"exchange_type": "NSI",
"overall_rating": "Neutral",
"percent_change": "4.95",
"long_term_trends": "Bearish",
"up_circuit_limit": "713.00",
"low_circuit_limit": "583.40",
"short_term_trends": "Bullish"
}
}
]
}
IPOs API
Retrieve data on recent and upcoming Initial Public Offerings (IPOs).
Headers
Header | Required | Description |
---|---|---|
Yes | Your registered email address | |
api_key | Yes | Your personal API key |
Accept | Yes | Must be "application/json" |
Example Request
curl -X GET "https://www.stockyfly.com/api/ipos" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"status": "success",
"message": "IPO data retrieved successfully",
"data": [
{
"ipo_id": "SRIGEEDLM",
"company_name": "Srigee DLM",
"open_date": "2025-05-05",
"close_date": null,
"listing_date": "2025-05-12",
"issue_price_low": "94.0000",
"issue_price_high": "99.0000",
"issue_size": null,
"raw_data": {
"name": "Srigee DLM",
"is_sme": true,
"status": "upcoming",
"symbol": "SRIGEEDLM",
"lot_size": null,
"max_price": 99,
"min_price": 94,
"issue_price": null,
"document_url": "https://gyrcapitaladvisors.com/wp-content/uploads/2025/04/RHP_Srigee_Final.pdf",
"listing_date": "2025-05-12",
"listing_gains": null,
"listing_price": null,
"additional_text": "Bid starts on 05 May at 10 AM",
"bidding_end_date": null,
"bidding_start_date": "2025-05-05"
}
},
}
Financial Score API
Retrieve the financial score for a specific stock, providing insights into its financial health.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
instrument | string | Yes | Stock symbol (e.g., "RELIANCE", "TATASTEEL") included in URL path |
Headers
Header | Required | Description |
---|---|---|
Yes | Your registered email address | |
api_key | Yes | Your personal API key |
Accept | Yes | Must be "application/json" |
Example Request
curl -X GET "https://www.stockyfly.com/api/financial_score/RELIANCE" \
-H "email: your_email@example.com" \
-H "api_key: YOUR_API_KEY" \
-H "Accept: application/json"
Example Response
{
"status": "success",
"data": {
"symbol": "RELIANCE",
"company_name": "RELIANCE INDUSTRIES",
"financial_score": 44
}
}
Error Codes
Understand and handle API errors effectively
The StockyFly API uses standard HTTP status codes along with custom error codes for specific scenarios.
Common Error Codes
HTTP Code | Error Code | Description | Solution |
---|---|---|---|
400 | X000 | Missing required parameters | Check that all required parameters are included |
401 | X001 | Invalid or expired API key | Verify your API key or generate a new one |
403 | X002 | API key not authorized for this domain | Update your API key settings or use a universal key |
404 | X003 | Instrument not found | Verify the instrument identifier |
429 | X004 | Rate limit exceeded | Reduce request frequency or upgrade your plan |
Example Error Response
{
"status": "error",
"error_code": "X001",
"message": "Invalid or expired API key",
"documentation_url": "https://docs.stockyfly.com/errors/X001"
}