SOS API

Media API for Telegram bots

Search YouTube and get a ready Telegram audio file. Pull Instagram, TikTok, Snapchat and Pinterest media as direct links. One key, one header.

Free plan: 100 requests a day. No card needed, the key comes from @dlsosbot.

How it works

Your bot sends a link or a song name. You get back something it can send right away.

1

Get your key

Open @dlsosbot and send /apikey. The key works at once.

2

Search

Send a song name to /v1/search and pick a result.

3

Download

Send the link to /v1/download. Popular tracks return instantly from cache.

4

Send it

Forward the Telegram file in your bot, or stream the direct link.

What you get from each platform

YouTube audio and video come back as Telegram files, so your bot never handles the upload. Social media comes back as direct links.

PlatformResponseAvailable on
YouTube audio and videoTelegram file link, cached after the first requestAll plans
YouTube searchTitle, link, duration and thumbnailAll plans
InstagramDirect links to videos, photos and carouselsPro and up
TikTokDirect video and audio linksPro and up
SnapchatDirect video links from Spotlight and storiesPro and up
PinterestDirect image, GIF and video linksPro and up

Pricing

Limits are per day and reset at midnight, Baghdad time. Failed requests are never counted.

Free

$0 / month

To try the API in your own bot.

  • 100 requests a day
  • YouTube and search
  • Valid 30 days
Get a free key

Starter

$5 / month

For a small music bot getting started.

  • 2,000 requests a day
  • YouTube and search
  • 30 days
Upgrade to Starter

Basic

$8 / month

For a music bot with a steady audience.

  • 4,000 requests a day
  • YouTube and search
  • 30 days
Upgrade to Basic

Standard

$12 / month

For busy music bots and several groups.

  • 8,000 requests a day
  • YouTube and search
  • 30 days
Upgrade to Standard

Pro Popular

$20 / month

For a music bot that also downloads from social media.

  • 20,000 YouTube and search requests a day
  • 3,000 social media downloads a day
  • Instagram, TikTok, Snapchat and Pinterest
  • 30 days
Upgrade to Pro

VIP

$30 / month

For busy bots with steady social media use.

  • 30,000 YouTube and search requests a day
  • 5,000 social media downloads a day
  • Instagram, TikTok, Snapchat and Pinterest
  • 30 days
Upgrade to VIP

Business

$45 / month

For large bots and several projects.

  • 50,000 YouTube and search requests a day
  • 10,000 social media downloads a day
  • Instagram, TikTok, Snapchat and Pinterest
  • 30 days
Upgrade to Business

Ultra

$80 / month

For the biggest bots and resellers.

  • 100,000 YouTube and search requests a day
  • 25,000 social media downloads a day
  • Instagram, TikTok, Snapchat and Pinterest
  • 30 days
Upgrade to Ultra
Need more than 100,000 a day? We set up a custom limit for your project.Message @SSSi5

Documentation

Base URL https://api.dlsos.win. All responses are JSON.

Authentication

Send your key in the X-API-Key header with every request. Get it from @dlsosbot with /apikey. Keep it private, and use /revoke in the bot to replace a leaked key. Your usage and plan stay the same.

Limits

  • Each successful request costs 1. Failed requests are refunded automatically.
  • Your limit is per day and resets at 00:00 Baghdad time.
  • Each key has its own platforms. A platform that is not enabled on your key returns 403.
  • Check your remaining requests any time with /plan in the bot or GET /v1/usage.

GET/v1/search

ParameterDescription
qWhat to search for, for example a song name. Required.
limitNumber of results, 1 to 20. Default 10.
curl -G https://api.dlsos.win/v1/search \
  --data-urlencode "q=Blinding Lights" \
  -H "X-API-Key: YOUR_KEY"
{
  "status": "success",
  "query": "Blinding Lights",
  "cached": false,
  "results": [
    {
      "id": "4NRXx6U8ABQ",
      "title": "The Weeknd - Blinding Lights (Official Video)",
      "url": "https://www.youtube.com/watch?v=4NRXx6U8ABQ",
      "duration": 263,
      "channel": "",
      "thumbnail": "https://i.ytimg.com/vi/4NRXx6U8ABQ/hq720.jpg"
    }
  ],
  "remaining": 4998
}

duration is in seconds. Pass any url to the download endpoint.

Track info

GET/v1/track

Get the title, duration and thumbnail of a YouTube video from its link or id, without downloading it. Useful to show the track name before you send it. Costs 1 request and needs the Search permission.

ParameterDescription
linkA YouTube link (watch, youtu.be, shorts, music) or the 11-character video id. Required.
curl -G https://api.dlsos.win/v1/track \
  --data-urlencode "link=https://youtu.be/4NRXx6U8ABQ" \
  -H "X-API-Key: YOUR_KEY"
{
  "status": "success",
  "cached": false,
  "track": {
    "id": "4NRXx6U8ABQ",
    "title": "The Weeknd - Blinding Lights (Official Video)",
    "url": "https://www.youtube.com/watch?v=4NRXx6U8ABQ",
    "duration": 263,
    "channel": "",
    "thumbnail": "https://i.ytimg.com/vi/4NRXx6U8ABQ/hq720.jpg"
  },
  "remaining": 4995
}

Returns 404 if the video does not exist or is private.

Download

POST/v1/download

FieldDescription
platformyt, insta, tiktok, snap or pin. Required.
linkThe media link. Short links work too. Required.
videoYouTube only. true for video, false for audio. Default false.
curl -X POST https://api.dlsos.win/v1/download \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform":"yt","link":"https://youtu.be/4NRXx6U8ABQ","video":false}'

YouTube returns a Telegram file link. Send it with your bot by reading the message from the link, or forward it.

{
  "status": "success",
  "platform": "yt",
  "cached": true,
  "items": [
    {"type": "audio", "telegram_link": "https://t.me/…/98", "mirrored": true}
  ],
  "remaining": 4997
}

Instagram, TikTok, Snapchat and Pinterest return direct links. A post can have several items. Direct links expire, so download them right away.

{
  "status": "success",
  "platform": "insta",
  "cached": false,
  "title": "…",
  "items": [
    {"type": "video", "url": "https://…", "thumbnail": "https://…"},
    {"type": "image", "url": "https://…"}
  ],
  "remaining": 4996
}

The first YouTube request for a track can take up to a minute while it is prepared. After that it returns instantly for everyone. Set your client timeout to at least 120 seconds and retry once on a 524.

Stream link

POST/v1/stream_sos

The same YouTube file as /v1/download (audio, or mp4 with "video": true), as a direct link served by us, to play or download at once. The body is the same as /v1/download, YouTube only. It costs one request.

curl -X POST https://api.dlsos.win/v1/stream_sos \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform":"yt","link":"https://youtu.be/4NRXx6U8ABQ","video":false}'
{
  "status": "success",
  "url": "https://api.dlsos.win/v1/stream_sos/…?e=…&s=…",
  "expires_at": 1767225600,
  "ext": "m4a",
  "video": false,
  "title": "The Weeknd - Blinding Lights",
  "duration": 263,
  "telegram_link": null,
  "remaining": 4995
}
FieldDescription
urlAlways given. A signed link to the file on our server. It works for one hour, until expires_at (unix time), and supports Range requests for seeking. The file is deleted from our server after that.
telegram_linkThe same file in our Telegram channel. null the first time a track is requested, while it is still being stored; given on the requests after.
ext, videoThe file type: m4a or another audio type, or mp4 for video.
title, durationThe track's title and its length in seconds.

A new track can take a moment. Then the answer is 202 with {"status": "pending"} and a Retry-After header: wait that many seconds and send the same request again. A 202 does not cost a request. Request a new link when one expires; do not share it, anyone with the link can use it until it expires.

Usage

GET/v1/usage

Returns your plan, today's usage, the reset time and the platforms on your key. It does not cost a request. On a plan with social media downloads, social_limit, social_used and social_remaining show them: Instagram, TikTok, Snapchat and Pinterest are counted there, apart from your YouTube and search requests.

curl https://api.dlsos.win/v1/usage -H "X-API-Key: YOUR_KEY"

Errors

Errors come back as {"status": "error", "detail": "…"} with one of these codes.

CodeMeaningWhat to do
400The link is invalid or does not match the platform.Check the link and the platform value.
401The key is missing or wrong.Send it in X-API-Key.
403The key is disabled, expired, or the platform is not on your plan.Check /plan in the bot.
404No media was found at the link.Make sure the post is public.
429Today's limit is used up (or today's social media limit, for a social media download).Wait for the reset or upgrade.
202The stream link is still being prepared (/v1/stream_sos).Wait Retry-After seconds and send it again.
502, 503A source is temporarily unavailable.Retry in a few seconds.

Code examples

Search a song and download the first result.

import httpx

API = "https://api.dlsos.win"
HEADERS = {"X-API-Key": "YOUR_KEY"}

def get_song(query: str) -> str:
    with httpx.Client(headers=HEADERS, timeout=120) as http:
        found = http.get(f"{API}/v1/search", params={"q": query, "limit": 1}).json()
        url = found["results"][0]["url"]
        data = http.post(f"{API}/v1/download",
                         json={"platform": "yt", "link": url, "video": False}).json()
        return data["items"][0]["telegram_link"]

print(get_song("Blinding Lights"))

Questions

How do I upgrade?

Message @SSSi5 with the plan you want. Your key stays the same, the new limit and platforms apply as soon as payment is confirmed.

When does my daily limit reset?

Every day at 00:00 Baghdad time. Unused requests do not carry over.

Do failed requests count?

No. If a request fails for any reason, it is refunded to your daily limit straight away.

Why is the first YouTube request slower?

The track is downloaded and uploaded to Telegram once. Every request after that returns the same file in under a second.

Can I use one key in several bots?

Yes. The limit is shared between them. For separate limits, ask for a second key.