Scheduled weather updates in Telegram: a template that posts the temperature to a chat

Scheduled weather updates in Telegram come from a ready-made nana800 template: a timer starts the scheme, a request block gets data from the Yandex Weather API, and a bot sends the city name and the current temperature to your chat. You need a bot token from @BotFather and your own Yandex Weather API key, with no code to write. Your balance is topped up to $3.50 for free every month, no card needed.

Build it in the builder
The Weather in Telegram (Weather info) template scheme in the nana800 builder

Chain of blocks

  1. 1

    Trigger

    button starts the scheme by hand, so you can check the message without waiting for the schedule. The button is free.

  2. 2

    Trigger · Repeating timer

    time internal starts the scheme on a schedule. In the template it fires at the start of every hour, Moscow time, and the second, minute, hour, day and month fields change the schedule.

  3. 3

    Action · HTTP request

    request sends a GET request to the Yandex Weather API. The address holds the coordinates of Amsterdam, and the X-Yandex-Weather-Key header holds a sample key that you replace with your own.

  4. 4

    Action · Send Telegram message

    Telegram message send posts the city name and the current temperature from the weather answer to the chat, plus a map point as a separate message. The bot token and chat ID are empty, you fill them in.

What it is good for

  • Morning weather in a team chat of couriers, builders or outdoor event organizers
  • Weather in the Telegram channel of a campsite, a cafe with a summer terrace or a local community
  • An alert in a chat when the temperature drops below zero, with a condition block before the message
  • A base for any scheduled message with data from an outside API, for example exchange rates or order statuses

How to set it up

  1. 1

    Create a scheme from the template

    In the builder open Templates, find the Weather info template and click Use. Choose the project and scheme to create it in, then click Create.

  2. 2

    Paste your Yandex Weather API key

    Yandex issues the key in its Yandex Weather API service and sets the free access terms and limits. In the request block paste the key into the X-Yandex-Weather-Key header instead of the sample from the template.

  3. 3

    Set your city

    In the request address replace the numbers after lat= (latitude) and lon= (longitude) with the coordinates of your city, which any map service shows for a point. In the Telegram message send block put the same latitude into the latitude field and the longitude into the longitude field, or clear both if you do not need the map point.

  4. 4

    Connect the bot

    In the Telegram message send block paste the bot token from @BotFather and the chat ID, which @getmyid_bot shows. The message text in the template is in English: rewrite it as you like and keep the inserted city and temperature from the request block.

  5. 5

    Set the schedule

    In the time internal trigger choose when it runs. Hour 8 and minute 0 send a message every day at 8:00, an asterisk in the hour field sends one every hour. Check the time zone: Moscow time is the default.

  6. 6

    Turn the scheme on and test it

    Press Start in your bot, turn the scheme on and press the button in the button trigger: the message arrives at once. If there is no temperature, open the result of the request block in the run history to see the answer of the weather service. When it works, keep the scheme on, and the weather comes on schedule. While it is on, it costs $0.0042 per hour.

Services in this template

  • Schedule

    Run schemes on a schedule without code: every minute, every day at a set hour, on chosen weekdays or once at an exact time. Free balance every month, no card needed.

  • HTTP request

    Send HTTP requests to any API without code: GET, POST, PUT, PATCH and DELETE with headers and a JSON body. Free balance every month, no card needed.

  • Telegram

    Build a Telegram bot without code: reply to messages, add buttons, send leads and alerts to a chat, group or channel. Free balance every month, no card needed.

Frequently asked questions

Every scheduled run takes three basic block runs: the timer, the weather request and the message. 1,000 basic block runs cost $1, and the test button is free. An enabled scheme costs $0.0042 per hour. Your balance is topped up to $3.50 for free every month, no card needed. A scheme with a timer stays on around the clock, so most of that goes to scheme hours.

Yandex issues it in its Yandex Weather API service. The template holds a sample, not a real key, so replace it with yours in the X-Yandex-Weather-Key header of the request block. Yandex decides how many requests are free and what more costs, and nana800 does not pay for this key.

Yes. The request block calls any https:// address. Change the address and headers following the docs of the weather service you like, and insert the fields of its answer into the message text: they are in body of the request block.

Yes. The Yandex Weather API answer also has the feels-like temperature, wind and the forecast for the next days. With the scheme on, press the button for a test run, open the result of the request block, find the fields you need in body and insert them into the message text.

Add the bot to the group, or make it an admin of the channel, and put the group or channel ID into the chat ID field: it starts with -100, and @getmyid_bot shows it. A public channel also works with its @name.

In private chats the bot can only write to people who pressed Start, and in a channel it must be an admin. With a wrong weather key the service answers with an error, and the message gets undefined instead of the city and temperature: the answer of the service is in the result of the request block. The timer fires only while the scheme is on.

Build your first scheme for free

Sign-up is free and needs no card. Every month the balance is topped up to $3.50 for free, enough for about 3,500 runs of basic blocks.

Build it in the builder