The Sheet should be public and Anyone with link can view. Example:
https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit?usp=sharing
If you dont want to create a key you can use this URL format (which downloads a json.txt file of the format):
- https://docs.google.com/spreadsheets/d/{spreadsheetId}/gviz/tq
- https://docs.google.com/spreadsheets/d/{spreadsheetId}/gviz/tq?sheet={sheetName}&tq=select+*+Where+A=27938
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.