Avatar image

JSON Textify

How to use this endpoint on Streamelements

This API will read the JSON response from the website and convert the values in parenthesis to JSON paths, returning its value

$(touser) ► $(customapi./api/json-textify?channel=$(channel)&site=SITE_WITH_JSON_DATA&msg="MESSAGE")

Example:

Let's say you want to show the first ability name of Pokémon Pikachu from PokeAPI:

site=https://pokeapi.co/api/v2/pokemon/pikachu
msg="First ability: (abilities[0].ability.name)"

The command will be:

$(touser) ► $(customapi./api/json-textify?channel=$(channel)&site=https://pokeapi.co/api/v2/pokemon/pikachu&msg="First ability: (abilities[0].ability.name)")

This is the response:

First ability: static

Note:
You can format the message and use as many JSON paths as you want in the message.
Just make sure the path is correct and to add them inside parenthesis.


Configure your message

You can use the box below to configure your chat message.
Copied to clipboard