Authentication Flow
This guide explains the steps that turn a FYERS login into an access token for your individual app.
USE CASE
Follow the login steps that give your own script or app an access_token for your FYERS account.
Note
Due to SEBI’s retail algo trading regulations, changes to its usage may take effect on April 1, 2026. Please refer to the link for further details.
Details
- The login flow is as follows:
- Navigate to the Login API endpoint
- After successful login, user is redirected to the redirect uri with the auth_code
- POST the auth_code and appIdHash (SHA-256 of api_id + app_secret) to Validate Authcode API endpoint
- Obtain the access_token use that for all the subsequent requests
- Individual apps work only for the person who created them; no other FYERS client can log in with your app.
- Step 1: send the user to the login URL with
client_id(your app ID),redirect_uri,response_type=codeand a randomstate. See Generate Auth Code. redirect_urimust match the URL given when the app was created. Keep it under your control, because theauth_codesent to it is sensitive.- After login, check that the returned
stateequals the value you sent, then use the returnedauth_codein step 2. - Send
app_id:access_tokenin the HTTPAuthorizationheader on every later request; the token expires daily at 6:30 AM.
Last updated on