HTTP
Send a GET request to an endpoint and provide the result to this bot.
The HTTP counter requests a URL and puts the answer into your template. Use it for any API that answers with a short number or a short text.
Availability: every bot. It needs no privileged intents.

Options
URL (GET)
The endpoint the bot requests.
Required. Only GET is supported: no headers, no body, so an API key has to travel in the query string.
Lifetime (in seconds)
How long the response is cached.
Optional. Empty means no cache. See Refresh and caching.
Data path
Where the value you want sits inside a JSON response.
Required when the response is JSON, ignored when it is plain text.
Fallback value
The value the counter returns when the request fails, so the counter does not break.
Optional. It covers every failure of the request.
Display label
A custom name for this counter's chip in the editor. It does not change the channel output.
Optional. Open it with the Edit display label button.
URL (GET), Lifetime (in seconds), Data path and Fallback value each accept another counter instead of a typed value. Hover the gear button on the nested counter's row to read what it has to return. See Nested counters.
Data path
The syntax is the one JS uses to access properties and array items.
key
current
Reads a property.
.key
current.temp_c
Reads a property of the previous step. Keys with spaces or dashes work unquoted.
["key"] or ['key']
["a.b"]
Reads a property whose name contains a dot, a bracket or a quote.
[0]
[0].price_usd
Reads an array item.
What it returns
A
text/plainresponse is returned whole, and Data path is ignored.An
application/jsonresponse returns the value found at Data path.Only numbers and strings can be shown. A boolean,
null, an object or an array fails.With a Fallback value set, a failed request returns that value and the channel keeps updating. The dashboard still lists the real error on the counter.
Without one, a failed request renames the channel (or rewrites the topic) to
ERROR!until the next successful update.
A channel name must be at least 2 characters, so an endpoint that answers with a single character breaks a counter that stands alone in a voice or category channel name. Put some text around it.
Testing in the dashboard

Opening a counter that already has a URL fetches it once. On a new counter, type a URL first, then press Fetch.
Test response shows the body that came back, pretty-printed when it is JSON.
Preview shows the value your Data path pulls out of that body, and updates as you type. A wrong path shows the error here instead of the value.
You cannot test a counter whose Data path is a nested counter, and Fetch does nothing when only URL (GET) is one. Preview the whole template instead, as described in Template editor.
Formatting
Number formatting applies to numbers only. A text/plain body and a JSON string are printed exactly as they arrived, so Use compact notation, Override default locale and Override default digits do nothing for them. To format a value an API sends as a JSON string, put the HTTP counter inside a Number counter. The formatting settings then apply, and the conversion drops trailing zeros. See Formatting counters.
Refresh and caching
With Lifetime (in seconds) empty or 0 the bot requests the URL on every channel update: every 10 minutes on the public bot, every 5 minutes on the legacy premium bot, custom bots and self-hosted bots. With a lifetime set, the response is stored and reused until it expires. Match it to your API's rate limit: 3600 for a weather endpoint you read once an hour, 300 for a price. See How counters update.
Examples
More free APIs in the public-apis list.
Current temperature in New York from WeatherAPI (free, API key after signing up).
URL (GET)
https://api.weatherapi.com/v1/current.json?key=<YOUR API KEY>&q=New%20York&aqi=no
Lifetime (in seconds)
3600
Data path
current.temp_c
The response also carries current.temp_f for Fahrenheit and current.is_day (1 by day, 0 by night). Feed current.is_day into a Replace counter to turn it into ☀️ or 🌙.

New York and °C in the templateUS air quality index for Los Angeles from IQAir (free, API key after signing up).
URL (GET)
https://api.airvisual.com/v2/city?city=Los%20Angeles&state=California&country=USA&key=<YOUR API KEY>
Lifetime (in seconds)
3600
Data path
data.current.pollution.aqius

LA AQI - , with the IQAir endpoint, a one hour lifetime and the data path filled inBitcoin price in USD from the Coinlore API (free, no API key).
URL (GET)
https://api.coinlore.net/api/ticker/?id=90
Lifetime (in seconds)
300
Data path
[0].price_usd
The endpoint answers with an array, which is why the path starts with [0]. Coinlore sends the price as a JSON string, so it reaches the channel exactly as written. Wrap the HTTP counter in a Number counter if you want compact notation or a different locale applied to it.

BTC: $81502.27, the live price when this was capturedErrors
The HTTP counter requires a URL, which is missing.
Fill URL (GET). A Fallback value does not cover this.
The HTTP response status code is invalid (not 200).
Check the API key and the query string, then press Fetch.
The content type of the HTTP response is invalid (not text/plain or application/json).
Look for another endpoint or another API.
A data path must be specified for HTTP requests whose content type is application/json.
Fill Data path.
"<key>" doesn't exists in <path>
The path does not match the response. Press Fetch and check the Test response box.
Only number, string values can be returned, but got <type>
The path stops on an object, an array, a boolean or null. Walk one step further, or remember that [10] and above need ["10"].
The evaluation took too long and timed out.
Use a faster endpoint, or set a Lifetime (in seconds) so the value is reused.
The result for the channel name is less than 2 characters long.
Put some text around the counter.
The URL of the HTTP counter points to a private or forbidden network address.
On the bots we host, that address is not allowed. Use a public endpoint.
Errors a Fallback value absorbed are still listed on the counter in the dashboard, so check there when a value looks frozen. More in Troubleshooting.
Last updated