PHPackages                             postuf/telegram-api-lib - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. postuf/telegram-api-lib

ActiveLibrary

postuf/telegram-api-lib
=======================

Telegram scenario-based API aimed at OSINT

v0.6.5(2y ago)3133.9k47[2 issues](https://github.com/Postuf/telegram-osint-lib/issues)[1 PRs](https://github.com/Postuf/telegram-osint-lib/pulls)MITPHPPHP ^7.4

Since Jan 15Pushed 2y ago15 watchersCompare

[ Source](https://github.com/Postuf/telegram-osint-lib)[ Packagist](https://packagist.org/packages/postuf/telegram-api-lib)[ Docs](https://github.com/Postuf/telegram-osint-lib)[ RSS](/packages/postuf-telegram-api-lib/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (121)Used By (0)

Telegram OSINT scenario library
===============================

[](#telegram-osint-scenario-library)

[![Gitpod ready-to-code](https://camo.githubusercontent.com/c01324668ea00cd2b02dc9fbf541676fb30543b69ef99a070d62a110917126d0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f476974706f642d72656164792d2d746f2d2d636f64652d626c75653f6c6f676f3d676974706f64)](https://gitpod.io/#https://github.com/Postuf/telegram-osint-lib)

[![codecov](https://camo.githubusercontent.com/2217b2166e790f3249737373139263c0d8e0eb72dbca2f1b43853b9a6725ac4f/68747470733a2f2f636f6465636f762e696f2f67682f506f737475662f74656c656772616d2d6f73696e742d6c69622f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/Postuf/telegram-osint-lib)

Description
-----------

[](#description)

A lot of Telegram API libraries around, but none of them demonstrates how to execute complex scenarios like draining all photos from channels, monitor users presence or register new account. This projects aims to correct situation: now you can easily create new scenarios and one-click execute existing ones.

Using Telegram API from official Android client.

Rationale
---------

[](#rationale)

Telegram protocol  has technically thorough and detailed documentation, but does not cover usage scenarios. Our goal is to make a library that implements some real-life OSINT usage scenarios, including:

- searching user in specific groups;
- parsing group members;
- monitoring user online status;
- downloading photos from channel;
- monitoring user profile changes (photo/bio/etc.);
- fetching messages by specific user.

Requirements
------------

[](#requirements)

- PHP 7.4+
- Composer
    - phpseclib

Docs
----

[](#docs)

- [Create scenario](docs/create-scenario.md)

QuickStart
----------

[](#quickstart)

First of all, add library to your app user composer:

```
composer require postuf/telegram-api-lib

```

To check out usage examples, go to `examples` dir. You need auth keys generated, run `php registration.php` to get this. Now you are all set, you can run any of examples, for example, `php parseGroupMembers.php`, and check the output.

Verbose logging (all messages sent/received) is enabled by default, add `--info` to arguments to suppress it.

### Docker container

[](#docker-container)

```
docker build -t telegram-osint-lib .
docker run -d -t --name tg-osint-lib telegram-osint-lib
docker exec -it tg-osint-lib /bin/bash
php examples/registration.php

```

When you get AuthKey in registration script, you can use it the following way:

```
docker exec  --env BOT=your-auth-key -i tg-osint-lib php examples/monitorNumbers.php -n 123123123
# if you save key to file
docker exec  --env BOT=@auth-key-filename-in-docker -i tg-osint-lib php examples/monitorNumbers.php -n 123123123

```

Limitations
===========

[](#limitations)

2FA not supported.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community27

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 71.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Recently: every ~115 days

Total

118

Last Release

943d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7759d1130ef0024c88247336e1a403cbe066d0580dc88a9f7103849720cf366?d=identicon)[Postuf\_ Ginemiagl](/maintainers/Postuf_%20Ginemiagl)

![](https://www.gravatar.com/avatar/7d00dd1d4eadf43052543656ded599f393f1f8251a0f067161777efdea7694c2?d=identicon)[Ririconj](/maintainers/Ririconj)

---

Top Contributors

[![Qusonann](https://avatars.githubusercontent.com/u/58689118?v=4)](https://github.com/Qusonann "Qusonann (151 commits)")[![Ririconj](https://avatars.githubusercontent.com/u/37244566?v=4)](https://github.com/Ririconj "Ririconj (22 commits)")[![Ctorowir](https://avatars.githubusercontent.com/u/59605215?v=4)](https://github.com/Ctorowir "Ctorowir (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![Ttakeleif](https://avatars.githubusercontent.com/u/61975174?v=4)](https://github.com/Ttakeleif "Ttakeleif (5 commits)")[![Ginemiagl](https://avatars.githubusercontent.com/u/48316855?v=4)](https://github.com/Ginemiagl "Ginemiagl (5 commits)")[![tombouctou](https://avatars.githubusercontent.com/u/529780?v=4)](https://github.com/tombouctou "tombouctou (2 commits)")[![kirkins](https://avatars.githubusercontent.com/u/9503662?v=4)](https://github.com/kirkins "kirkins (1 commits)")[![Danealau](https://avatars.githubusercontent.com/u/57352065?v=4)](https://github.com/Danealau "Danealau (1 commits)")[![AsenOsen](https://avatars.githubusercontent.com/u/2146615?v=4)](https://github.com/AsenOsen "AsenOsen (1 commits)")[![Siliariy](https://avatars.githubusercontent.com/u/70318893?v=4)](https://github.com/Siliariy "Siliariy (1 commits)")

---

Tags

osinttelegramtelegram-apitelegram-scenario

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/postuf-telegram-api-lib/health.svg)

```
[![Health](https://phpackages.com/badges/postuf-telegram-api-lib/health.svg)](https://phpackages.com/packages/postuf-telegram-api-lib)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M9](/packages/aporat-store-receipt-validator)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
