- Obtain an API Key: Ensure you have a valid API key from TradingAPI.
- Base Endpoint: The base endpoint is https://tradingapi.rest/v1/indicator/{indicator}
- Required Parameters:
- exchange: the exchange to retrieve data from (e.g., "bybit")
- limit: maximum number of data points to retrieve
- interval: time interval (e.g., "1h")
- base: base currency of the trading pair (e.g., "BTC")
- quote: quote currency of the trading pair (e.g., "USDT")
- backtrack: number of periods to go back in time
- backtracks: number of periods to calculate the indicator
- timestamp: set to 1 to include timestamps in the response
- reverse: set to 1 to reverse the order of returned data
- Required Headers:
- X-API-KEY: your API key
- User-Agent: (optional) your custom User Agent
import requests url = "https://tradingapi.rest/v1/indicator/rsi" # Example with RSI params = { "exchange": "bybit", "limit": 50, "interval": "1h", "base": "BTC", "quote": "USDT", "backtrack": 50, "backtracks": 50, "timestamp": 1, "reverse": 0 } headers = { "X-API-KEY": "YOUR-API-KEY", "User-Agent": "YOUR-USER-AGENT" } response = requests.get(url, params=params, headers=headers) data = response.json() print(data)
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article