Hi Upstox Developer Team,
Whenever I try to generate an authorization code using the official OAuth2 URL:
https://api.upstox.com/v2/login/authorization/dialog?response_type=code&client_id=&redirect_uri=http://localhost:5000
I immediately get this error message:
“Sorry, you have been blocked. You are unable to access Upstox.”
This issue is preventing me from authenticating and generating an access token. I’ve already raised multiple support tickets (Ticket IDs: [9593307] Unable to Access Upstox API Authorization (Blocked on Auth URL)) but they keep redirecting me to this forum instead of resolving the block.
Please verify and unblock my account or whitelist my API access. I am working on an educational/trading project and need this access urgently.
Thank you for your quick attention to this issue.
Hi @VAIJANTI_29565189 Could you please share 6 digit UCC ?
My UCC (Client Code) is 5BAC2H. Please verify my API access and remove the block if possible.
Hi @VAIJANTI_29565189 , there is no issue with the access, as I noticed you were able to generate an auth code yesterday.
Could you please share the request details for which you are encountering this error message?
Hi, thanks for your response!
I’m still facing a 400 Bad Request error while trying to exchange the authorization code for an access token using the Upstox API v2 endpoint.
Here are my request details:
Endpoint:
https://api.upstox.com/v2/login/authorization/token
Headers:
accept: application/json
Content-Type: application/x-www-form-urlencoded
Request Body (Python request):
code=xrAQlH
client_id=3c724f7b-4b71-4fa2-bc8c-700968e238f4
client_secret=nzkks6****2
redirect_uri=http://localhost:5000
grant_type=authorization_code
Error from Python:
⚠️ HTTP error: 400 Client Error: Bad Request for url: https://api.upstox.com/v2/login/authorization/token
However, when I test this exact same request using curl, it works perfectly:
Working curl command:
curl -X POST "https://api.upstox.com/v2/login/authorization/token" ^
-H "accept: application/json" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "code=9eieXF&client_id=3c724f7b-4b71-4fa2-bc8c-700968e238f4&client_secret=nzkks6****2&redirect_uri=http://localhost:5000&grant_type=authorization_code"
Successful curl response:
{"email":"aayushysirsolkar786@gmail.com","user_id":"5BAC2H","access_token":"eyJ0eXAiOiJ*****TDDE", ...}
Could you please check if there’s any environment, redirect, or header-level difference that might cause this to fail in the Python request but succeed via curl?
Hi @VAIJANTI_29565189 , please refer sample example codes here
Hi @Anand_sajankar,
Earlier, we faced an issue fetching intraday market data for our ATS(project name where we upstox API), which was due to an invalid access token / expired token flow. We were able to resolve it by refreshing the token correctly in our code and handling retries with proper authentication.
Now, our ATS requires fetching a full list of NSE instruments to dynamically select the top movers for intraday trading.
Currently, the endpoint we are using:
https://api-v2.upstox.com/master/instruments
returns a 404 Not Found error.
Could you please provide:
-
The current, working API endpoint for fetching the full list of NSE instruments.
-
Any required parameters, headers, or authentication steps needed to successfully fetch this data.
This will allow our system to automatically update the instrument list each day and continue functioning without manual intervention.
Thanks for your help.
Best regards,
Aayushy
Hi @VAIJANTI_29565189 There isn’t any API available for this at the moment. However, you can download the Instrument JSON file Instruments | Upstox Developer API to get the complete list of instruments.
Thanks
@Anand_Sajankar thanks, for your help
1 Like