Docs: Example code in README hits a 403 error for new users
Describe the bug
Using the main.go in the README (last trade), I hit a "403 Not Authorized" error. On further research, the example in the README is only available on the "Stocks Developer" level: https://polygon.io/docs/rest/stocks/trades-quotes/last-trade, so not available to initial users.
To Reproduce
- Create a new account on polygon.io
- Follow the steps in the README, including the sample main.go file and appropriately setting the environment variable for API key
-
go run main.go - Receive 403 error
Expected behavior Expect example in the README to work without authorization error (the quickstart is very well written otherwise!)
Perhaps use an example that's in the initial set of permissions for a new user, or warn that the example in the README is only available above certain levels … I also noted that using cURL to the last trade endpoint (the README example) has more helpful text in the response, perhaps this could be propagated through the go client to users:
{"status":"NOT_AUTHORIZED","request_id":"...","message":"You are not entitled to this data. Please upgrade your plan at https://polygon.io/pricing"}
As an end user, when I saw 403 I thought I made a mistake in the API key, so this visibility would help to clarify that the API key is entered correctly, just not authorized.
Hey @pselle, sorry about that and thanks for the heads up. What example where you trying and I'll review/update. There are also tons of examples in the docs https://polygon.io/docs/rest/quickstart here with go code examples.
I'm referencing the one in the README: https://github.com/polygon-io/client-go?tab=readme-ov-file#getting-started -- I love the simple copy/paste approach here btw in the docs -- that's the last trade API in that section.
Perfect, thanks. I'll take a look.
+1 to this issue. Seems like a pretty big blocker to have the example code not working, I'm a new user and this is pretty poor first experience with the Polygon product offering if the first thing the docs say to try doesn't work.