Closed Zakk-Yang closed 2 years ago
Describe the bug
TICK = "BTCUSD" ALPACA_PARAMS = { "timeframe": "15Min", # 1Min, 15Min, 1Hour, 1Day "limit": 10, 'start': '2021-09-09', } BASE_URL = 'https://data.alpaca.markets/v1beta1/crypto' BAR_URL = f'/{TICK}/trades' r = requests.get( BASE_URL + BAR_URL, headers = ALPACA_HEADERS, params= ALPACA_PARAMS ) print(r.json())
Error:
{'code': 40010000, 'message': 'unexpected parameter(s): timeframe'} Thank you.
{'code': 40010000, 'message': 'unexpected parameter(s): timeframe'}
Hello, you are using the wrong endpoint: BAR_URL = f'/{TICK}/trades', please use bars instead of trades.
BAR_URL = f'/{TICK}/trades'
Describe the bug
Error:
{'code': 40010000, 'message': 'unexpected parameter(s): timeframe'}
Thank you.