Use It On Your Stream
Send us the name of your Twitch category and we will tell you whether you can die in that game. Your bot can use the answer to switch a death counter on or off.
The request
It is one GET request, with the category name on the end of the address. No key or sign-up is needed.
GET https://can-i-die.in/api/<category name>The reply is plain text, and one of three things:
- true
- You can die in this game.
- false
- You cannot die in this game.
- 404
- An empty reply. No game has that name, or we have no answer for it yet.
A game's slug works in place of its name. The slug is the last part of the address of the game's page here, such as baldurs-gate-iii.
Setting up your bot
Each example below reads your current category and asks about it, so the answer follows you when you change game. Chat bots post the answer as the word “true” or “false”.
Streamer.bot
Add these two sub-actions to an action, in this order:
- Twitch › User › Get User Info for Target, with User Login set to
%broadcastUserName%. This puts your category in%game%. If the action is not started by a Twitch trigger, put Add Broadcaster Information before it. - Core › Network › Fetch URL, with Variable Name set to
canDieand this as the URL:https://can-i-die.in/api/%game%
%canDie% then holds true, false, or nothing when there is no answer. Test it with an If/Else sub-action.
Nightbot
Send this in your chat to add a !candie command:
!commands add !candie Can you die in $(twitch $(channel) "{{game}}")? $(urlfetch https://can-i-die.in/api/$(querystring $(twitch $(channel) "{{game}}")))When there is no answer, Nightbot posts an error message of its own in place of the answer.
StreamElements
Send this in your chat:
!command add !candie Can you die in $(game)? $(customapi https://can-i-die.in/api/$(pathescape $(game)))When there is no answer, StreamElements posts “The remote server returned status code 404”.
Fossabot
Create a command with this as its response:
Can you die in $(game)? $(customapi https://can-i-die.in/api/$(pathencode $(game)))When there is no answer, Fossabot leaves the answer blank.
Anything else
Any tool that can fetch a web address will work. Browser sources and overlays can call it too, from any site.
curl "https://can-i-die.in/api/Pok%C3%A9mon%20Red%20Version"How names are matched
Our game names come from IGDB, which is also where Twitch gets its categories, so most names match as they are. Capitals, accents and punctuation are ignored, and a sequel's number can be written either way: “3” finds “III”, and “III” finds “3”. Here is what some names return right now:
| Name sent | Reply | Why |
|---|---|---|
| Firewatch | false | A plain name. Capitals do not matter, so “firewatch” and “FIREWATCH” work too. |
| Pokémon Red Version | true | Accents are optional. “Pokemon Red Version” finds the same game. |
| Animal Crossing: New Horizons | false | Punctuation is ignored, so the colon can be left out. |
| Friday Night Funkin' | false | Apostrophes are optional. “Friday Night Funkin” works as well. |
| Baldur's Gate 3 | true | Twitch names this category with a 3, where our data has III. Roman numerals and ordinary numbers are treated as the same, so the Twitch name still finds it. |
| Forza Horizon V | false | The same the other way round. Our data has this game as “Forza Horizon 5”. |
| Fate/Grand Order | true | A slash in the name works, written as it is or as %2F. |
| 100% Orange Juice | true | A percent sign has to be sent as %25. Bots do this for you when you use their encoding variable. |
| Until Dawn | false | Several games share this name. You get the one we have an answer for, and the most popular of those. |
| Just Chatting | 404, empty | Not a game, so there is no answer. |
| baldurs-gate-iii | true | A slug, taken from the address of the game's page here. It always finds exactly that game. |
Category finds nothing? Search for the game on the main list and use the slug from its page instead.