import requests
# Endpoint for retrieving brokerage charges from Upstox API
url = "https://api-v2.upstox.com/charges/brokerage?instrument_token=NSE_EQ|INE848E01016&quantity=1&product=I&transaction_type=BUY&price=50.00"
# Empty payload since GET requests typically do not use request bodies
payload = {}
# Set up the headers with the required API version and authorization token
headers = {
'Accept': 'application/json',
'Api-Version': '2.0',
'Authorization': '{your_access_token}'
}
# Make the GET request to the Upstox API
response = requests.get(url, headers=headers, json=payload)
Remember to include the parameters directly in the URL, as demonstrated. Usually, a GET request does not have a payload, but if the API requires these parameters in the request body, ensure you’re following the specific API documentation.
To view the same information, you can visit the section on the right side of this page: