$(customapi)

Overview

$(customapi ...) fetches data from other websites and displays it in chat. This is useful when you want to pull in jokes, statistics, or other data from external services.

$(urlfetch ...) is an alias with identical behavior - both work the same way.

Syntax

There are two variants:

1. Display the complete response:

$(customapi URL)

When you want to display everything the website returns.

2. Display only a specific part:

$(customapi URL | json.path)

Sometimes a website returns many different pieces of information, but you only need a small part of it. Then you can select the desired part using a "JSON path".

Examples

$(customapi https://api.example.com/joke)

$(customapi https://official-joke-api.appspot.com/random_joke | setup)

$(urlfetch https://api.example.com/stats?channel=$(channel) | data.viewerCount)

Where to use it in the dashboard

You can use $(customapi ...) in Bot -> Commands, Bot -> Timer, Bot -> Chat Alerts, and Chat Automation -> Raid Shoutout, as well as in Stream Tools -> Clip Command when using a custom response template.

Notes

  • Only standard web links (URLs starting with http:// or https://) are supported.
  • Responses are truncated to a maximum of 450 characters and displayed in one line.
  • Private addresses and localhost are blocked for security reasons.
  • The JSON path (the part after the |) only works if the website returns its data in JSON format. If you're not sure, just try it without the JSON path first!
$(customapi) | ByteMate Docs