getting 404 Client error when attempting to ingest data #230
Replies: 1 comment
-
Solved this one. Don't use the old zipline repo as it no longer works with Alpaca api! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm attempting to run
python zipline/data/bundles/alpaca_api.py
but get this error:requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://data.alpaca.markets/v1/bars/day?symbols=GOOG%2CAAPL%2CTSLA&limit=1000&end=2023-11-08T00%3A00%3A00%2B00%3A00
I updated the base url in the config file from https://paper-api.alpaca.markets to https://data.alpaca.markets. I also see that in the function get_api_version it should default to v2 if there is none specified in the config file. Am I missing a trick with my config file? Is there a default url somewhere? Any help would be greatly appreciated. Stack trace is here...
zipline/data/bundles/alpaca_api.py:272: UserWarning: Overwriting bundle with name 'alpaca_api'
def api_to_bundle(interval=['1m']):
zipline/data/bundles/alpaca_api.py:350: UserWarning: Overwriting bundle with name 'alpaca_api'
end_session=end_date
Traceback (most recent call last):
File "zipline/data/bundles/alpaca_api.py", line 358, in
show_progress=True,
File "/Users/anon/zipline-trader/zipline/data/bundles/core.py", line 513, in ingest
pth.data_path([name, timestr], environ=environ),
File "zipline/data/bundles/alpaca_api.py", line 302, in ingest
daily_bar_writer.write(daily_data_generator(), assets=assets_to_sids.values(), show_progress=True)
File "/Users/anon/zipline-trader/zipline/data/bcolz_daily_bars.py", line 207, in write
return self._write_internal(it, assets)
File "/Users/anon/zipline-trader/zipline/data/bcolz_daily_bars.py", line 269, in _write_internal
for asset_id, table in iterator:
File "/Users/anon/zipline-trader/zipline/data/bcolz_daily_bars.py", line 264, in iterator
for asset_id, table in iterator:
File "/Users/anon/opt/anaconda3/envs/zipline/lib/python3.6/site-packages/click/_termui_impl.py", line 318, in generator
for rv in self.iter:
File "/Users/anon/zipline-trader/zipline/data/bcolz_daily_bars.py", line 198, in
(sid, self.to_ctable(df, invalid_data_behavior))
File "zipline/data/bundles/alpaca_api.py", line 295, in
return (sid_df for (sid_df, *metadata.iloc[sid_df[0]]) in df_generator(interval='1d',
File "zipline/data/bundles/alpaca_api.py", line 234, in df_generator
df: pd.DataFrame = get_aggs_from_alpaca(partial, start, end, 'day' if interval == '1d' else 'minute', 1)
File "zipline/data/bundles/alpaca_api.py", line 199, in get_aggs_from_alpaca
response = _iterate_api_calls()
File "zipline/data/bundles/alpaca_api.py", line 119, in _iterate_api_calls
end=curr.isoformat()
File "/Users/anon/opt/anaconda3/envs/zipline/lib/python3.6/site-packages/alpaca_trade_api/rest.py", line 513, in get_barset
resp = self.data_get('/bars/{}'.format(timeframe), params)
File "/Users/anon/opt/anaconda3/envs/zipline/lib/python3.6/site-packages/alpaca_trade_api/rest.py", line 193, in data_get
'GET', path, data, base_url=base_url, api_version=api_version,
File "/Users/anon/opt/anaconda3/envs/zipline/lib/python3.6/site-packages/alpaca_trade_api/rest.py", line 139, in _request
return self._one_request(method, url, opts, retry)
File "/Users/anon/opt/anaconda3/envs/zipline/lib/python3.6/site-packages/alpaca_trade_api/rest.py", line 160, in _one_request
resp.raise_for_status()
File "/Users/anon/opt/anaconda3/envs/zipline/lib/python3.6/site-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://data.alpaca.markets/v1/bars/day?symbols=GOOG%2CAAPL%2CTSLA&limit=1000&end=2023-11-08T00%3A00%3A00%2B00%3A00
Beta Was this translation helpful? Give feedback.
All reactions