StaticGramBot API

getUserProfileAudiosПоддерживается

Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.

Особенности StaticGram

saved music (users.getSavedMusic privacy)

Параметры

user_idIntegerобязательный
Unique identifier of the target user
offsetIntegerнеобязательный
Sequential number of the first audio to be returned. By default, all audios are returned.
limitIntegerнеобязательный
Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.

Пример запроса

curl
curl "https://api.staticgram.top/bot$TOKEN/getUserProfileAudios" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 123456789
  }'
aiogram 3
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer

session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.staticgram.top"))
bot = Bot(TOKEN, session=session)

result = await bot.get_user_profile_audios(user_id=123456789)
JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/getUserProfileAudios`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "user_id": 123456789
  }),
});
const data = await res.json();

Ответ (UserProfileAudios)

JSON
{
  "ok": true,
  "result": {
    "total_count": 1,
    "audios": []
  }
}

Описания методов и типов взяты из официальной документации Telegram Bot API (Bot API 10.3). Адрес API: https://api.staticgram.top