API for current song

Hi, i’m using essential playing for display the title of the current song on obs, but now i would know : is there a way to use the .txt file created by essential playing for create an API for a command in the chat? Sorry if i did some grammatical errors, because i’m not englis :stuck_out_tongue:

What you can do is set the file to output into a Dropbox Public folder, and then use the public link to that file in Nightbot’s $(urlfetch) variable to fetch the contents of that file to display in chat.

If you are on Windows, you can do the same for OneDrive. Make sure you sync the folder you have the textfile(s) in with onedrive and in Onedrive create a link. Such a link would look like this:

https://onedrive.live.com/redir?resid=[the object ID]&authkey=!ADwjj24SWiohviQ&ithint=folder%2cjpg

Change ‘redir’ in the link to ‘download’ and you can use the link in chat by using $(urlfetch [link]) which will pull the raw textfile data into chat…

Here’s an example which does exactly what you want as I use it in Nightbot:

Thanks for asking $(user). Song currently playing: $(urlfetch https://onedrive.live.com/download?resid=279C0413866AC417!578505&authkey=!AC59GCXh2dgk6ZQ&ithint=file%2ctxt)
1 Like

Hello,

I’m using Nightbot BETA and i like it and i was wondering if there is a “Current song” api for it like the one for the regular nightbot. I stop using the regular nightbot cause it kept on crashing, and now i can’t display the current song in my stream.

The Nightbot Beta has a full API: https://api-docs.nightbot.tv The specific endpoint for getting the current song: https://api-docs.nightbot.tv/#get-queue

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