DEV Community

Sh Raj
Sh Raj

Posted on β€’ Edited on β€’ Originally published at github.com

11 1 1 1 1

PhpGram - A PHP library for interacting with the Telegram Bot API.

PhpGram

PhpGram is a PHP library for interacting with the Telegram Bot API, providing easy-to-use methods for sending messages, media, managing chats, stickers, inline queries, payments, and more.

GitHub logo SH20RAJ / phpgram

A PHP library for interacting with the Telegram Bot API.

PhpGram

License PHP Telegram Bot API Visitors Latest Stable Version

PhpGram is a PHP library for interacting with the Telegram Bot API, providing easy-to-use methods for sending messages, media, managing chats, stickers, inline queries, payments, and more.

Table of Contents

Installation

Install PhpGram via Composer:

composer require sh20raj/phpgram
Enter fullscreen mode Exit fullscreen mode

Alternatively, you can clone the repository:

git clone https://github.com/SH20RAJ/phpgram.git
Enter fullscreen mode Exit fullscreen mode

Usage

Initialization

First, include the library in your PHP file and initialize PhpGram with your bot token:

require __DIR__ . '/../src/PhpGram.php';

use PhpGram\PhpGram;

$token = 'YOUR_BOT_TOKEN';
$bot = new PhpGram($token);
Enter fullscreen mode Exit fullscreen mode

Basic Usage

Try Example: Toss Bot (Toss a coin and get the result or roll a dice)

// Example: Get bot information
$botInfo = $bot->getMe()
echo 'Bot
…
Enter fullscreen mode Exit fullscreen mode

Table of Contents

Installation

Install PhpGram via Composer:

composer require sh20raj/phpgram
Enter fullscreen mode Exit fullscreen mode

Alternatively, you can clone the repository:

git clone https://github.com/SH20RAJ/phpgram.git
Enter fullscreen mode Exit fullscreen mode

Usage

Initialization

First, include the library in your PHP file and initialize PhpGram with your bot token:

require_once 'path/to/phpgram.php';

$token = 'YOUR_BOT_TOKEN';
$bot = new PhpGram($token);
Enter fullscreen mode Exit fullscreen mode

Basic Usage

// Example: Get bot information
$botInfo = $bot->getMe();
echo 'Bot Username: ' . $botInfo['result']['username'] . PHP_EOL;
Enter fullscreen mode Exit fullscreen mode

Sending Messages and Media

Sending Text Messages

// Send a text message
$chatId = 'YOUR_CHAT_ID';
$message = 'Hello from PhpGram!';
$response = $bot->sendMessage($chatId, $message);
Enter fullscreen mode Exit fullscreen mode

Sending Photos

// Send a photo
$photoPath = 'path/to/photo.jpg';
$response = $bot->sendPhoto($chatId, $photoPath, ['caption' => 'Check out this photo!']);
Enter fullscreen mode Exit fullscreen mode

Sending Audio

// Send an audio file
$audioPath = 'path/to/audio.mp3';
$response = $bot->sendAudio($chatId, $audioPath, ['caption' => 'Listen to this audio!']);
Enter fullscreen mode Exit fullscreen mode

Sending Documents

// Send a document
$documentPath = 'path/to/document.pdf';
$response = $bot->sendDocument($chatId, $documentPath, ['caption' => 'Here is your document.']);
Enter fullscreen mode Exit fullscreen mode

Sending Videos

// Send a video
$videoPath = 'path/to/video.mp4';
$response = $bot->sendVideo($chatId, $videoPath, ['caption' => 'Watch this video!']);
Enter fullscreen mode Exit fullscreen mode

Sending Animations

// Send an animation
$animationPath = 'path/to/animation.gif';
$response = $bot->sendAnimation($chatId, $animationPath, ['caption' => 'Enjoy this animation!']);
Enter fullscreen mode Exit fullscreen mode

Sending Voice Messages

// Send a voice message
$voicePath = 'path/to/voice.ogg';
$response = $bot->sendVoice($chatId, $voicePath, ['caption' => 'Listen to this voice message!']);
Enter fullscreen mode Exit fullscreen mode

Sending Video Notes

// Send a video note
$videoNotePath = 'path/to/video_note.mp4';
$response = $bot->sendVideoNote($chatId, $videoNotePath);
Enter fullscreen mode Exit fullscreen mode

Sending Media Groups

// Send a media group
$mediaGroup = [
    ['type' => 'photo', 'media' => 'path/to/photo1.jpg'],
    ['type' => 'photo', 'media' => 'path/to/photo2.jpg'],
];
$response = $bot->sendMediaGroup($chatId, $mediaGroup);
Enter fullscreen mode Exit fullscreen mode

Sending Locations

// Send a location
$response = $bot->sendLocation($chatId, 40.712776, -74.005974); // New York City coordinates
Enter fullscreen mode Exit fullscreen mode

Sending Venues

// Send a venue
$response = $bot->sendVenue($chatId, 40.712776, -74.005974, 'Venue Name', 'Venue Address');
Enter fullscreen mode Exit fullscreen mode

Sending Contacts

// Send a contact
$response = $bot->sendContact($chatId, 'PHONE_NUMBER', 'FirstName', ['last_name' => 'LastName']);
Enter fullscreen mode Exit fullscreen mode

Sending Polls

// Send a poll
$response = $bot->sendPoll($chatId, 'Your Question?', ['Option 1', 'Option 2']);
Enter fullscreen mode Exit fullscreen mode

Sending Dice

// Send a dice
$response = $bot->sendDice($chatId);
Enter fullscreen mode Exit fullscreen mode

Managing Chats and Members

// Kick a member from a chat
$userId = 'USER_ID_TO_KICK';
$response = $bot->kickChatMember($chatId, $userId);

// Unban a member from a chat
$response = $bot->unbanChatMember($chatId, $userId);

// Restrict a member in a chat
$permissions = ['can_send_messages' => false];
$response = $bot->restrictChatMember($chatId, $userId, $permissions);

// Promote a member to an admin
$response = $bot->promoteChatMember($chatId, $userId);

// Set custom title for an admin
$response = $bot->setChatAdministratorCustomTitle($chatId, $userId, 'Custom Title');
Enter fullscreen mode Exit fullscreen mode

Handling Stickers

// Send a sticker
$stickerPath = 'path/to/sticker.webp';
$response = $bot->sendSticker($chatId, $stickerPath);

// Get a sticker set
$stickerSetName = 'sticker_set_name';
$response = $bot->getStickerSet($stickerSetName);

// Upload a sticker file
$stickerFilePath = 'path/to/sticker.png';
$response = $bot->uploadStickerFile($userId, $stickerFilePath);

// Create a new sticker set
$stickerParams = [
    'name' => 'sticker_set_name',
    'title' => 'Sticker Set Title',
    'png_sticker' => 'path/to/sticker.png',
    'emojis' => 'πŸ˜€',
];
$response = $bot->createNewStickerSet($userId, $stickerParams);

// Add a sticker to a set
$response = $bot->addStickerToSet($userId, 'sticker_set_name', 'path/to/sticker.png', 'πŸ˜€');

// Set sticker position in a set
$response = $bot->setStickerPositionInSet('sticker_file_id', 0);

// Delete a sticker from a set
$response = $bot->deleteStickerFromSet('sticker_file_id');
Enter fullscreen mode Exit fullscreen mode

Inline Mode

// Answer an inline query
$inlineQueryId = 'INLINE_QUERY_ID';
$results = [ /* Array of InlineQueryResult objects */ ];
$response = $bot->answerInlineQuery($inlineQueryId, $results);
Enter fullscreen mode Exit fullscreen mode

Payments

// Send an invoice
$invoiceParams = [
    'title' => 'Product Name',
    'description' => 'Description of the product',
    'payload' => 'unique_payload',
    'provider_token' => 'PROVIDER_PAYMENT_TOKEN',
    'start_parameter' => 'start_param',
    'currency' => 'USD',
    'prices' => json_encode([ ['label' => 'Product Price', 'amount' => 1000] ]),
];
$response = $bot->sendInvoice($chatId, $invoiceParams);

// Answer a shipping query
$shippingQueryId = 'SHIPPING_QUERY_ID';
$response = $bot->answerShippingQuery($shippingQueryId, true);

// Answer a pre-checkout query
$preCheckoutQueryId = 'PRE_CHECKOUT_QUERY_ID';
$response = $bot->answerPreCheckoutQuery($preCheckoutQueryId, true);
Enter fullscreen mode Exit fullscreen mode

Games

// Send a game
$gameShortName = 'game_short_name';
$response = $bot->sendGame($chatId, $gameShortName);

// Set game score
$response = $bot->setGameScore($userId, 100);

// Get game high scores
$response = $bot->getGameHighScores($userId);
Enter fullscreen mode Exit fullscreen mode

Handling Updates

// Get updates
$updates = $bot->getUpdates();

// Set a webhook
$response = $bot->setWebhook('https://yourdomain.com/webhook');

// Delete a webhook
$response = $bot->deleteWebhook();

// Get webhook info
$response = $bot->getWebhookInfo();
Enter fullscreen mode Exit fullscreen mode

Contributing

Contributions are welcome! Fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—     β–ˆβ–ˆβ•—      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ`.        β•™β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€  ΒΏβ–“β–“β–“β–“β–“β–“β–“β–“β–„/ "β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€.  β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“   β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–„β–ˆβ•—
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ `  β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“  ` β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ `  β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“   β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ  β–€β–€β–“β–“β–“β–“β–“β–“β–“β–Œβ•“β•–. β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–„β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ ╩╦╙▀▀▀▀▀ β•£`,β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•  β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—
β–„β–€β–ˆβ–„β•™β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„ .... ,β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—       β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ–„β–€β–ˆβ–„β•™β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€  β•ͺβ•’%╦══~β•“,β”” β•šβ–’β–’β–’ β•™β–€|,╓╓═╀H   β–€β–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•       β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
β–ˆβ–€β–€β–€-β–€β–ˆβ–Œβ–„β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   ║▒▒▒▒▒▒▒▒▒▒╒╦ β•˜ -β•£β–’β–’β–’β–’β–’β–’β–’β–’β–’β•’β••   β–€β–ˆ  β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—     β–ˆβ–ˆβ•‘   β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
β–ˆβ–ˆβ–„β–€β–ˆβ–ˆβ””β•‘β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„          ═╕╕╕╕╕═╕═══════       β–„β–„β–„β–„  β•šβ•β•  β•šβ•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β•β•šβ•β•β•β•β•β•β•     β•šβ•β•    β•šβ•β•β•β•β•β•
β–ˆβ–ˆβ–ˆβ–ˆβ–„β–€β–ˆβ–Œβ•‘β–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ         β••   β•©β–’β–’β–’β–’β–’β–’β–’β–’β–’Γ‘          β–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ŒΓ–β–“β–Œ   β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ`β•”β–’β–’β•£ β–ˆ β–’β–’m   β•šβ–’β•’β–’β–’β–’β•© -β•£β–’ β–Œ β–’β–’β–’ β–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—
β–ˆβ–ˆβ–ˆβ–ˆ -"" βˆžβ•™,β–€.β•™β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•œ β–’β–’β–’ β–„β–ˆ Γ‘   -   S.  ═▒▒▒▒ β–ˆ β•‘β–’β–’β••β””β–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ•β•β–ˆβ–ˆβ•”β•β•β•  β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ -Β«   βˆžβ–„.β–€",╓═     β•’β–ˆβ–ˆ   ═╣▒▒ `Γ‘β•›        β–ˆβ–Œ β–’β–’β–’ β–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—     β–ˆβ–ˆβ•‘      β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ ΒΊ     β•€β•£β–’β•£β•©^",β–„β–„β–ˆβ–ˆβ–ˆβ–€  β–’β–’β•£"     ''''''' β–€β–€     `β–ˆβ–ˆ  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•”β•β•β•     β–ˆβ–ˆβ•‘       β•šβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–Œ       β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”€         ---------    L'β–’β–’β–’ β–ˆβ–ˆ  β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•‘        β–ˆβ–ˆβ•‘   β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€-     β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€       '╧╧╧╧╧╧╧╧╧`     β•š ╧╧╧- β–€  β•šβ•β•     β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•   β•šβ•β•        β•šβ•β•    β•šβ•β•β•β•β•β•  β•šβ•β•β•β•β•β•
Enter fullscreen mode Exit fullscreen mode

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry πŸ•’

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more β†’

Top comments (1)

Collapse
 
sh20raj profile image
Sh Raj β€’

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay