How to fix API login error - 503 Service Temporarily Unavailable

If you encounter error 503 when trying to log in through the API, it means that you are using an outdated API URL.: https://api.fyers.in/vagator/v1/, which is no longer supported.

You need to replace it with the latest endpoint that is mentioned in the documentation and follow the steps, Link: https://myapi.fyers.in/docs#tag/Authentication-and-Login-Flow-User-Apps/paths/~1Authentication%20&%20Login%20Flow%20-%20User%20Apps/post

For more details, please refer to the documentation, Link: API - FYERS

Hi

Thanks for reply.

The link https://api-t1.fyers.in/api/v3/generate-authcode is giving message below

{"s": "error", "code": -96, "message": "An unexpected error occurred. Please contact support."}

Please follow the steps mentioned in the documentation, https://myapi.fyers.in/docs#tag/Authentication-and-Login-Flow-User-Apps/paths/~1Authentication%20&%20Login%20Flow%20-%20User%20Apps/post

Hi @naresh_janagama sample provided in the above links are not inline with the github repo. can you look into it

HI Naresh

I changed the url and authentiation code is generated. But the following line showing error

        session.set_token(fyers_auth_code)

        response = session.generate_token()

        print(response)

Erros message

{‘s’: ‘error’, ‘code’: -17, ‘message’: ‘Could not authenticate the user’}

OK it is working now. Mistake in my side. thanks all for your support

Hi @sushovan_roy
It is good that issue has solved for you.

Hi @dinesh_kumar_inala ,

I answered your question there.
https://community.fyers.inhttps://fyers.in/community/t/facing-issue-with-fyers-api-v3-auth-code-generation-and-token-generation-for-my-app/19800?highlight=CjzCVGs5hOUsnJ2