Skip to content

Conversation

asandoval
Copy link
Contributor

For free users, those of us 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:

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>

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>
```
@jbonzo jbonzo merged commit b054f79 into polygon-io:master Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants