---
title: "{urlfetch:https://…}"
description: Replace the variable with whatever text a URL returns.
---

```text
{urlfetch:https://example.com/anything}
```

**Platforms:** Twitch and Kick.

The bot fetches the address and drops the response text into the
message - perfect for pulling live data from your own server or a
third-party API into a chat response.

## Examples

```text
!weather  →  {urlfetch:https://wttr.in/London?format=3}
!define   →  {urlfetch:https://api.example.com/define?word={queryescape:{arg:1}}}
```

The second one is the pattern for viewer input: the address is yours,
fixed when you save the command, and the viewer's word rides in the
query, encoded by [`{queryescape:}`](/chat-bot/variables/queryescape-pathescape).

## Good to know

- **The host is fixed.** Variables may appear in the path or query, never
  in the domain - a viewer can never steer the fetch somewhere else.
- Requests go out from a **CDN edge** (Cloudflare's network), not from
  TipPage's own servers - the endpoint you call sees a Cloudflare edge
  IP. Allow Cloudflare's ranges or use a token in your URL rather than
  allowlisting one address.
- **HTTPS only**, and responses are trimmed to plain text and capped to
  fit a chat message (about 400 characters).
- Responses are **cached for ~10 seconds**, so a spammed command doesn't
  hammer your endpoint.
- Whatever comes back is treated as text - a response containing
  `{variables}` is shown literally, not run.
- Up to two `{urlfetch:}` per response. Available to Twitch partners,
  and to everyone once the edge relay is enabled for your account.

## If you run the endpoint

Every request the bot makes identifies itself, so you can tell it apart
from other traffic and know who to talk to if a command is misbehaving:

```text
User-Agent: TipPage-Urlfetch/1.0 (+https://docs.tippage.com/chat-bot/variables/urlfetch)
X-TipPage-Tenant: t_3501414b
```

`X-TipPage-Tenant` is the id of the TipPage channel whose command
made the request. To report a command that's hammering or misusing your
service, email [hello@tippage.com](mailto:hello@tippage.com) with that id
and we'll take it from there. You can also simply refuse requests
carrying it - the streamer's command will render an empty result.
