How to fetch data from Google Sheets with Nightbot?

Hi there, sorry I’ve tried looking around but don’t see my specific case

I have a Google spreadsheet. 5 columns:
Game Name (the cell contains the name of the game)
Played on Twitch? (the cell contains yes or no)
Played on Youtube? (the cell contains yes or no)
Do I recommend the game? (the cell contains yes or no)
Youtube link (if it exists)? (the cell contains a youtube link)

I would like to make a command where chat can find the info, instead of looking up the sheet
So say !game Hollow Knight then Nightbot will give the relevant data
I’m ok with it just showing the Youtube link if showing the whole answers is too much

Thank you in advance

Could be possible, I’m not sure. You would have to be able to read and understand and implement this: Sheets API  |  Google Developers into your code using URL fetch:

https://docs.nightbot.tv/variables/urlfetch

1 Like

Hi there, thank you for the reply.

That said, I don’t understand this. I’ve kinda read the sheets api website, but then what do I do?
Am I supposed to code something from scratch? For reference, I’ve only made a webpage in HTML class in like…2012 haha. But even then I wrote something in a laptop then we don’t actually host it, the browser just went “directory path in laptop” in the address bar
Would you happen to know of a video tutorial or articles for it? Like do I write it in notepad ++ then put it into my Google Sheets? Any info would be appreciated

Once again, thank you for taking the time to answer my first question.

I’m not sure how to call in information from cells sorry, but I’m using this site to try and understand it more

The key word is “try” :sweat_smile:

Ah ok, I’ll be sure to look around there.

Thank you for the responses!

1 Like

give your spreadsheet ID

Hey @Andyndt!

Yup, and then host it. After that you’ll have an URL to call with Nightbot’s $(urlfetch).
Sorry, we don’t provide help on how to write an API, or exploit third-party app.

if you only want to fetch data then use this api

https://sheets.googleapis.com/v4/spreadsheets/[SPREADSHEET_ID]/values/[SPREADSHEET_NAME]?key=[YOUR_API_KEY]
documentation

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.