Docs
Dashboard
KyroScript

Internet data

Scripts with allow: internet can look things up online. Every request counts toward a limit per run and a daily limit for your whole bot, which you can see in Scripts → Internet.

Integrations (Pro and Max)

Ready-made lookups that need no keys or setup. Kyro makes the request and gives your script clean data, or none when nothing is found.

integrations.weather(place: text) → mapNeeds allow: internet

The weather right now somewhere: place, country, temp_c, temp_f, feels_like_c, humidity, wind_kph, condition and emoji. none if the place isn’t found.

  • place: a city or place name
w = integrations.weather("London")
integrations.define(word: text) → mapNeeds allow: internet

An English dictionary entry: word, phonetic and meanings (a list of maps with part, definition and example). none if it isn’t found.

d = integrations.define("serendipity")
integrations.wikipedia(topic: text) → mapNeeds allow: internet

A short Wikipedia summary: title, summary, url and image. none if there’s no article.

w = integrations.wikipedia("Octopus")
integrations.crypto_price(coin: text, currency?: text) → mapNeeds allow: internet

A coin’s price: coin, currency, price and change_24h (percent). none if the coin isn’t found.

  • coin: e.g. bitcoin, ethereum, solana
  • currency: usd (default), eur, gbp…
p = integrations.crypto_price("bitcoin")
integrations.steam_game(name: text) → mapNeeds allow: internet

A game on Steam: name, price (text), free, url, image and metacritic. none if it isn’t found.

g = integrations.steam_game("Hades")
secret(name: text) → secretNeeds allow: internet

An API key you saved in the dashboard. It can only be put in http request headers or query values, and only for the site it’s tied to: scripts can never read it. Max only.

key = secret("WEATHER_KEY")
http.get(url: text, headers?: map, query?: map) → mapNeeds allow: internet

Fetch a page from a site in your allowlist. Gives a map with status, ok, json (if the answer was JSON) and text. Max only.

  • url: https, on a site in your allowlist
r = http.get("https://api.example.com/stats", query={"id": "123"})
http.post(url: text, json?: any, headers?: map, query?: map) → mapNeeds allow: internet

Send JSON to a site in your allowlist. Gives a map with status, ok, json and text, like http.get. Max only.

  • url: https, on a site in your allowlist
  • json: sent as JSON (up to 16 KB)
r = http.post("https://api.example.com/scores", json={"user": user.id, "score": 10})
Command file
command: weather
description: Check the weather anywhere
arg place: text, required, A city or place
allow: internet
---
w = integrations.weather(args.place)
if w == none:
    fail("I couldn’t find {args.place}.")
card = embed(
    title="{w.emoji} Weather in {w.place}, {w.country}",
    description="{w.condition}, {w.temp_c}°C ({w.temp_f}°F). Feels like {w.feels_like_c}°C.",
    fields=[
        {"name": "Humidity", "value": "{w.humidity}%", "inline": true},
        {"name": "Wind", "value": "{w.wind_kph} km/h", "inline": true},
    ],
)
reply(card)

Your own sites (Max)

On Max, http.get and http.post can fetch data from your own APIs. For safety:

  • Only HTTPS sites you add to your bot’s allowlist (and their subdomains), up to 25. Discord, Kyro, IP addresses and private networks are never allowed.
  • Answers must come within 5 seconds and be under 256 KB. JSON becomes maps and lists in r.json; anything else is text in r.text. Files aren’t allowed.
  • What you send can be up to 16 KB, with the headers Accept, Content-Type, Authorization and your own X- headers.

API keys

Add a key in Scripts → Internet → Secrets, tied to the one site it’s for. Kyro stores it encrypted and never shows it again. In a script, secret("NAME") stands for the key: it can only go in a header or query value for its own site, and can’t be printed, saved or sent anywhere else. If a site sends the key back, your script sees [secret] instead.

Command file
command: stats
description: Look up a player on your game’s site
arg player: text, required, Player name
allow: internet
---
# api.example.com must be in your allowlist, and GAME_KEY saved as a secret for it
r = http.get(
    "https://api.example.com/players",
    query={"name": args.player},
    headers={"Authorization": secret("GAME_KEY")},
)
if not r.ok:
    fail("The game site said no ({r.status}).")
reply("📊 {args.player}: {r.json}")
✨ Tip Test runs in the editor never go online: they get a pretend answer, so you can try your script without using requests. They still check your allowlist and secret names.
Was this page helpful?