Telegram Bot API

getUniqueGift

Category: Payments · Bot API 10.5 · Official documentation

Version history: Added in Bot API 10.4

Returns information about a unique gift by its name (Bot API 10.4).

Returns: On success, returns UniqueGift.

Parameters

ParameterTypeRequiredDescription
nameStringYesUnique name of the gift

Parameter descriptions are concise summaries; see the official documentation for the full text.

Example request

curl

curl -s -X POST "https://api.telegram.org/bot$TOKEN/getUniqueGift" \
  -H "Content-Type: application/json" \
  -d '{"name":"PlushPepe-1"}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/getUniqueGift",
    json={
        "name": "PlushPepe-1"
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getUniqueGift`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "PlushPepe-1"
  }),
});
console.log(await res.json());

Step-by-step guide: How to Create a Telegram Bot: Step by Step with BotFather and Python