Skip to content

Docs: Example code in README hits a 403 error for new usersΒ #543

@pselle

Description

@pselle

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

  1. Create a new account on polygon.io
  2. Follow the steps in the README, including the sample main.go file and appropriately setting the environment variable for API key
  3. go run main.go
  4. 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions