auth code generation through python code

I am trying to create auth code through python code by passing auth URL. it is not getting through.but when i copy the auth URL and paste it in browser URL i can see the auth code

provide more details, not enough information.

Hi @anil.kzxqg358,
This is working as expected.

You will NOT get auth_code within Python Code itself.
You will get auth_URL from Python SDK which you need to use to validate your identity at browser (with TOTP / PIN) AFTER WHICH you will get auth_code sent by Fyers Server at your Redirect URI as URL param.

You can then capture this auth_code param to further generate access token with Python SDK.

This process you can do manually stepwise (safer) OR automate fully as per your convenience.

If you use refresh token, then only once in 15 days you need to enter pin / validate otherwise you can generate auth code directly from script everyday.

There is method for doing TOTP but i didnt pursue it. its safer to manually do it once in 15 days

I want to automate auth code and access token generation through python for Algo trading.

is there any way to do so.?

Current state:

I get get auth_URL from Python SDK which I need to use to validate my identity at browser (with TOTP / PIN) AFTER WHICH I will get auth_code sent by Fyers Server at my Redirect URI as URL param.

Hi @anil.kzxqg358

use this code

https://github.com/FyersDev/fyers-api-sample-code/tree/sample_v3/v3/python/login

How can we use refresh token to generate access token?