FYERS API v3
FYERS API v3: auth-code login with SHA-256 hash, profile, funds, holdings, orders, quotes, depth and candles.
Finance & bankingGuided#broker#trading#india#stocks#market-data#orders
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
What this is
FYERS is an Indian discount broker. Its API v3 lets you log in, read your profile, funds, holdings, positions, orders and trades, stream-free market data (quotes, depth, candles) and place, modify or cancel orders on NSE, BSE and MCX. This collection walks the individual-app flow for your own account.
> Real money warning. The order requests in folder 5 act on your live FYERS account. Use a tiny quantity, an after-market order (offlineOrder: true) or a limit price far from the market, and cancel afterwards. There is no sandbox.
Get credentials
- Open the API dashboard at https://fyers.in/web/api-dashboard/user-apps and sign in with your FYERS account.
- Create a non-trading app (data only) or activate your one trading app (needs a static primary IP address). Enter a Redirect URL you control; FYERS suggests https://trade.fyers.in/api-login/redirect-uri/index.html for testing.
- Copy the App ID (looks like
XXXXXXXX-100) and the App Secret intoappIdandappSecret. Official guide: https://fyers.in/api-docs/v3/getting-started/create-an-app/individual-app/
Authentication
- Open the generate-authcode URL (folder 1, request 1) in a browser, log in, and FYERS redirects to your redirect URL with
auth_code=...in the address. Copy it intoauthCode. - Run Validate auth code. The pre-request script computes
appIdHash = SHA-256("appId:appSecret")and the response returns anaccess_token, saved automatically. - Every later request sends the header
Authorization: <app_id>:<access_token>(the collection builds it fromappIdandaccessToken).
Tokens expire daily at 6:30 AM; repeat the login after that.
Base URLs
- Trading and account REST:
https://api-t1.fyers.in/api/v3 - Market data REST:
https://api-t1.fyers.in/data - Symbol master files:
https://public.fyers.in/sym_details/
All use HTTPS. WebSockets use separate hosts and are not part of this collection.
Run order
Set appId and appSecret, do folder 1, then folders 2 to 4 in any order. Folder 5 comes last and needs a symbol, quantity and price you choose.
Limits
Rate limits depend on your plan (Standard or Prime) and differ per API category; placing, modifying and cancelling orders together are capped at 10 per second, and exceeding the per-minute limit more than three times in a day blocks you until the next day. See https://fyers.in/api-docs/v3/getting-started/plans-and-limits/.
Common errors
| Code / status | Meaning |
|---|---|
| s = error, code -8, -15, -16, -17 | Expired or invalid token: log in again |
| HTTP 429 | Rate limit hit; wait for the Retry-After header |
| code 201 on an order | Sent but not acknowledged; check the order book before retrying |
| HTTP 401 / 403 | Bad Authorization format or missing app permission |
Docs: https://fyers.in/api-docs/v3/ (API standards and error codes under API Reference and Appendix).
Endpoints 16
1. Log in
- GETGenerate auth code (open in browser)
{{authBase}}/generate-authcodeBuilds the login URL. Send this GET from a browser rather than the app: the user signs in to FYERS and is redirected to your redirect URI with an auth_code… - POSTValidate auth code (get access token)
{{authBase}}/validate-authcodeExchanges the auth code for an access token. The pre-request script hashes appId:appSecret with SHA-256 into appIdHash. The body needs grant_type…
2. Account
- GETGet profile
{{authBase}}/profileReturns basic details of the account holder and confirms the token works. No parameters. The data object has fy_id, name, display_name, masked email and… - GETGet funds
{{authBase}}/fundsShows your balances for the capital and commodity ledgers as a fund_limit list. Each row has id, title, equityAmount and commodityAmount; find Available… - GETGet holdings
{{authBase}}/holdingsLists your long-term demat holdings with an overall summary (count_total, total_investment, total_current_value, total_pl, pnl_perc) and a holdings array, one… - GETGet positions
{{authBase}}/positionsReturns today's open and closed positions in netPositions (quantity, average price, realized and unrealized profit, ltp, buy and sell totals) plus an overall…
3. Orders and trades (read)
- GETGet order book
{{authBase}}/ordersFetches every order placed today across all FYERS platforms in orderBook. Useful fields: id, symbol, qty, filledQty, remainingQuantity, status (1 cancelled, 2… - GETGet trade book
{{authBase}}/tradebookReturns today's executed trades in tradeBook, with order number, exchange order number, side, price, quantity and time. Use it to reconcile fills against the…
4. Market data
- GETGet market status
{{dataBase}}/marketStatusShows whether each exchange segment is open: one row per exchange code, segment code and market_type with a status such as PREOPEN, OPEN or CLOSE. Call it… - GETGet quotes
{{dataBase}}/quotesLatest price, change, volume and best bid and ask for up to 50 comma separated symbols in EXCHANGE:SYMBOL-SERIES form. Each symbol returns its own entry with… - GETGet market depth
{{dataBase}}/depthReturns the order book depth for exactly one symbol: bids and ask arrays with price, volume and order count per level, total buy and sell quantity, circuit… - GETGet historical candles
{{dataBase}}/historyFetches candles for one symbol. resolution can be 1, 2, 3, 5, 10, 15, 20, 30, 60, 120, 240 (minutes), D or 1D. With date_format 1, range_from and range_to are… - GETDownload symbol master (NSE cash)
https://public.fyers.in/sym_details/NSE_CM.csvDownloads the CSV of all NSE capital market symbols. Columns include the Fytoken, symbol details, instrument type, lot size, tick size, ISIN, expiry and the…
5. Place, modify, cancel (real trades)
- POSTPlace order (REAL TRADE)
{{authBase}}/orders/syncPlaces an order on your live account. This example is an after-market limit buy of 1 share: offlineOrder true queues it for the next session. Fields: type 1… - PATCHModify order (REAL TRADE)
{{authBase}}/orders/syncChanges a pending order. Send the order id and its type, plus the fields you want to change, such as limitPrice, stopPrice or qty; anything omitted keeps its… - DELETECancel order (REAL TRADE)
{{authBase}}/orders/syncCancels a pending order by sending a DELETE with a JSON body holding the order id. The docs also allow DELETE /orders/{orderId}/sync with the id in the path.…
API details
- Base URL
https://api-t1.fyers.in/api/v3https://api-t1.fyers.in/datahttps://public.fyers.in/sym_details- Authentication
- An API key in the Authorization header
- Operations
- 16 operations on 16 pathsGET 12POST 2PATCH 1DELETE 1
- Main resources
- 1. Log in 22. Account 43. Orders and trades (read) 24. Market data 55. Place, modify, cancel (real trades) 3
- Description format
- Swastik Codes guided collection, API version
checked against the docs on 2026-11-18 - Links
- Documentation
How to test the FYERS API v3 in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the FYERS API v3 collection, without the publisher's secrets.
- Add your credentialsThis API uses an API key in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Generate auth code (open in browser)” (GET {{authBase}}/generate-authcode), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the FYERS API v3?
FYERS API v3: auth-code login with SHA-256 hash, profile, funds, holdings, orders, quotes, depth and candles. It is listed under Finance & banking and has 16 endpoints.
Who publishes the FYERS API v3?
It is listed from FYERS's public API description (an OpenAPI document), not published by FYERS on Swastik Codes. Anyone who controls fyers.in can claim the profile by adding a DNS TXT record.
What is the base URL of the FYERS API v3?
Its description lists 3 base URLs: https://api-t1.fyers.in/api/v3, https://api-t1.fyers.in/data, https://public.fyers.in/sym_details. The first is the usual one; the others are typically sandbox or regional servers.
How do I authenticate with the FYERS API v3?
With an API key in the Authorization header.
How many endpoints does the FYERS API v3 have?
16 operations on 16 paths (12 GET, 2 POST, 1 PATCH, 1 DELETE). The largest groups are 1. Log in, 2. Account, 3. Orders and trades (read), 4. Market data.
Is forking the FYERS API v3 free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.