The Sheet should be public and Anyone with link can view. Example:
If you dont want to create a key you can use this URL format (which downloads a json.txt file of the format):
Or configure a key as per the Official docs.
- Go to Google Console and create a project (or use an existing one)
- Goto Credenetials page and create a API Key
- Include Sheets API from library
You can now get json using URL Format:
With the V4 pattern, the spreadsheet needs to be shared as File > Share > Share with others > anyone with the link can view.