/youtube/audio/tg-bot

POST7 credits15 credits when it is not cached

audio straight into your telegram bot

we send the audio to your bot and hand back a file_id, so your bot forwards a file it already owns instead of uploading one. 7 credits when we have the track cached, 15 when we have to fetch it first. send X-Return-File-Id: false to get channel_id and message_id instead.

parameters

nametypedescriptionexample
video_idrequiredstringyoutube video id (not the full url)vk6014HuxcE
bot_usernamerequiredstringyour bot, with the @@your_bot

every request carries X-Api-Key.

request

curl
curl -X POST 'https://api.fastsaver.io/v1/youtube/audio/tg-bot' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"video_id":"vk6014HuxcE","bot_username":"@your_bot"}'
raw http
http
POST https://api.fastsaver.io/v1/youtube/audio/tg-bot
Content-Type: application/json

{
  "video_id": "vk6014HuxcE",
  "bot_username": "@bot_username"
}

response

response
{
  "ok": true,
  "file_id": "CQACAgIAAxkDAAIVKWk..."
}

what to do with the file_id

the audio is already sitting in your bot. file_id is telegram's own handle for it, so sendAudio delivers it without uploading anything - no bandwidth from you and no wait. a file_id only works for the bot that received the file, which is why we ask for bot_username: hand it to another bot and telegram answers wrong file identifier. reuse it as often as you like.

http
POST https://api.telegram.org/bot<your_bot_token>/sendAudio
Content-Type: application/json

{
  "chat_id": 123456789,
  "audio": "CQACAgIAAxkDAAIVKWk..."
}

with X-Return-File-Id: false you get channel_id and message_id instead - pass those to copyMessage when you would rather forward the original message than send a fresh one.

telegram bot api: sendAudio

try it

costs 7 credits · real call
goes straight to the api, never to us
youtube video id (not the full url)
your bot, with the @
paste a key, or sign in and it fills itself