Currently, I am working on developing a simple WordPress plugin using PHP and JavaScript. The main goal of this plugin is to create a widget. If you are not familiar with how WordPress plugins work, don't worry - the implementation is not too complex since regular JS/PHP can be used. In fact, the solution to my question may lie within a single PHP/HTML file.
I have a publicly-accessible Google Sheet with specific sharing settings:
https://i.sstatic.net/vCIbo.png
What I aim to do now is fetch the value stored in a particular cell on a designated worksheet. The targeted worksheet is named Live Summary
and the cell of interest is E20
.
https://i.sstatic.net/8lgRL.png
Although I have managed to retrieve this data using oAuth 2.0 authentication, it is not ideal for users to authenticate just to view this information.
My objective is to seamlessly display the contents of this cell on my website at all times, almost as if it were directly sourced from the MySQL database where WordPress resides.
https://i.sstatic.net/tRSJN.png
I have come across suggestions about utilizing certain GET endpoints from the Google Sheets API, but without utilizing oAuth tokens, I am uncertain about where to begin.
If feasible, could someone please: a) confirm whether this is achievable, and b) provide guidance on how to kickstart this process?
Preferably, I would like to use JavaScript for this task, though PHP would also suffice.