I have a Upstox trading account and am building a personal application to manage my trades locally. Can I obtain an access token for my account? Also, can I use localhost as the redirect URI for the OAuth login process, since I don’t have an official app

I have a Upstox trading account, and I’m building a personal application to manage my trades. Currently, I don’t have an official app, and I’m working locally. Is it possible to obtain an access token for my account? Does Upstox support API access for individual users like me, or is it restricted to specific use cases?

Additionally, since I’m working locally, can I use my localhost as the redirect URI, as it’s one of the parameters required for the login process? If I’m missing anything or there are any considerations I should be aware of, please let me know.

curl --location ‘https://api.upstox.com/login/authorize?client_id=3123123&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fauth%2Fcallback&response_type=code&state=random_string
–header ‘Cookie: __cf_bm=QiSzxVQLRQsme7yXhPrtklJm.k3qZh6MnxIsRtEqtso-1738233757-1.0.1.1-T0duFJBtkH.QSS7BSl3Vy72f6TV_1T2O.qH7eeYTvGKZ44CjUCqfgFlgr6Dzb1TI; _cfuvid=aCgFUL3hdKQtfYkEjSfdTt1uYtYNoJVPdO4tNA6oIek-1738233757025-0.0.1.1-604800000’

Bro, you can directly generate access token from your api management page of upstox. Simply get your access token from there because access token change daily. Don’t go for long route

2 Likes

Hi @Darshan,

Welcome to the Upstox Community! @Daljit_singh is absolutely correct. Access token is valid for a day and expires at 3:30 AM in the morning. Also, the previous access tokens get invalidated if you create a new access token.

@Daljit_singh thanks for your prompt help!