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
Chain of blocks
- 1
Trigger
button starts the scheme by hand, so you can check the message without waiting for the schedule. The button is free.
- 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
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
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
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
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
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
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
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
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
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