Skip to content

Commit b054f79

Browse files
authored
Update README with more recent dates in examples (#75)
For free users, just getting started with the client, the REST response 404s, because historical data back to 2018 is unavailable. A quick update of the docs prevents users who are just beginning with the client from receiving the following error: ```sh python sample.py Traceback (most recent call last): File "<PATH>/sample.py", line 14, in <module> main() File "<PATH>/sample.py", line 9, in main resp = client.stocks_equities_daily_open_close("AAPL", "2018-03-02") File "<PYTHON_PATH>/lib/python3.9/site-packages/polygon/rest/client.py", line 128, in stocks_equities_daily_open_close return self._handle_response("StocksEquitiesDailyOpenCloseApiResponse", endpoint, query_params) File "<PYTHON_PATH>/lib/python3.9/site-packages/polygon/rest/client.py", line 35, in _handle_response resp.raise_for_status() File "<PYTHON_PATH>/lib/python3.9/site-packages/requests/models.py", line 943, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.polygon.io/v1/open-close/AAPL/2018-03-02?apiKey=<REDACTED> ```
1 parent 1509ddd commit b054f79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def main():
6060
# RESTClient can be used as a context manager to facilitate closing the underlying http session
6161
# https://requests.readthedocs.io/en/master/user/advanced/#session-objects
6262
with RESTClient(key) as client:
63-
resp = client.stocks_equities_daily_open_close("AAPL", "2018-03-02")
63+
resp = client.stocks_equities_daily_open_close("AAPL", "2021-06-11")
6464
print(f"On: {resp.from_} Apple opened at {resp.open} and closed at {resp.close}")
6565

6666

@@ -93,8 +93,8 @@ def main():
9393
# RESTClient can be used as a context manager to facilitate closing the underlying http session
9494
# https://requests.readthedocs.io/en/master/user/advanced/#session-objects
9595
with RESTClient(key) as client:
96-
from_ = "2019-01-01"
97-
to = "2019-02-01"
96+
from_ = "2021-01-01"
97+
to = "2021-02-01"
9898
resp = client.stocks_equities_aggregates("AAPL", 1, "minute", from_, to, unadjusted=False)
9999

100100
print(f"Minute aggregates for {resp.ticker} between {from_} and {to}.")

0 commit comments

Comments
 (0)