PHPackages                             sysbot/tgscraper - 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. [API Development](/categories/api)
4. /
5. sysbot/tgscraper

ActiveLibrary[API Development](/categories/api)

sysbot/tgscraper
================

Utility to extract scheme from Telegram Bot API webpage.

4.0.9(1y ago)2613210LGPL-3.0-or-laterPHPPHP &gt;=8.0

Since Jun 17Pushed 1y agoCompare

[ Source](https://github.com/Sysbot-org/tgscraper)[ Packagist](https://packagist.org/packages/sysbot/tgscraper)[ RSS](/packages/sysbot-tgscraper/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (10)Versions (27)Used By (0)

TGScraper
=========

[](#tgscraper)

[![License](https://camo.githubusercontent.com/b4830e27dff9613a2cddd55257029c00ddebd4d95269d6cde6aa5ea571e0f5ca/687474703a2f2f706f7365722e707567782e6f72672f737973626f742f7467736372617065722f6c6963656e7365)](https://packagist.org/packages/sysbot/tgscraper)[![Required PHP Version](https://camo.githubusercontent.com/56459bbfbd0df4a3174c560184292e4fb0a900ce4c7f54be3159c707f42925d5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d254532253839254135382e302d627269676874677265656e)](https://camo.githubusercontent.com/56459bbfbd0df4a3174c560184292e4fb0a900ce4c7f54be3159c707f42925d5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d254532253839254135382e302d627269676874677265656e)[![Latest Stable Version](https://camo.githubusercontent.com/7cb1c2d39b01ab16361affa55300487fd630bdf45d0673dee90e0e148c97535a/687474703a2f2f706f7365722e707567782e6f72672f737973626f742f7467736372617065722f76)](https://packagist.org/packages/sysbot/tgscraper)[![Dependencies](https://camo.githubusercontent.com/f1af39e3dfc1e2421039982beb85c41492d462945478fe3f038aac4ecdf784f1/68747470733a2f2f696d672e736869656c64732e696f2f6c6962726172696573696f2f6769746875622f537973626f742d6f72672f746773637261706572)](https://libraries.io/github/Sysbot-org/tgscraper)[![Code Quality](https://camo.githubusercontent.com/efb1756c39996f00e2417ac5faa62bda9210e77c50f9207aef26dccf036d5310/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f537973626f742d6f72672f746773637261706572)](https://scrutinizer-ci.com/g/Sysbot-org/tgscraper/?branch=master)

A PHP library used to extract JSON data (and auto-generate PHP classes) from [Telegram bot API documentation page](https://core.telegram.org/bots/api).

Changelog
---------

[](#changelog)

Interested in recent changes? Have a look [here](CHANGELOG.md)!

Installation
------------

[](#installation)

Install the library with composer:

```
  $ composer require sysbot/tgscraper --prefer-stable
```

(Optional) Install the cache package:

```
  $ composer require sysbot/tgscraper-cache
```

Using from command line
-----------------------

[](#using-from-command-line)

Once installed, you can use the CLI to interact with the library.

For basic help and command list:

```
  $ vendor/bin/tgscraper help
```

### JSON

[](#json)

Extract the latest schema in a human-readable JSON:

```
  $ vendor/bin/tgscraper app:export-schema --readable botapi.json
```

Or, if you want a Postman-compatible JSON (thanks to [davtur19](https://github.com/davtur19/TuriBotGen/blob/master/postman.php)):

```
  $ vendor/bin/tgscraper app:export-schema --postman botapi_postman.json
```

### YAML

[](#yaml)

Extract the latest schema in YAML format:

```
  $ vendor/bin/tgscraper app:export-schema --yaml botapi.yaml
```

### OpenAPI

[](#openapi)

Extract the latest OpenAPI schema in JSON format:

```
  $ vendor/bin/tgscraper app:export-schema --openapi botapi_openapi.json
```

Or, if you prefer YAML:

```
  $ vendor/bin/tgscraper app:export-schema --openapi --yaml botapi_openapi.yaml
```

### Stubs

[](#stubs)

*Note: since Telegram may change the page format at any time, do **NOT** rely on the automagically generated stubs from this library, **ALWAYS** review the code!*

TGScraper can also generate class stubs that you can use in your library. A sample implementation is available in the [Sysbot Telegram module](https://github.com/Sysbot-org/Sysbot-tg).

Create stubs in the `out/` directory using `Sysbot\Telegram` as namespace prefix:

```
  $ vendor/bin/tgscraper app:create-stubs --namespace-prefix "Sysbot\Telegram" out
```

### All versions

[](#all-versions)

If you want to generate all schemas and stubs for every Bot API version, you can!

Here's an example on how to export everything to the `out/` directory, with schemas in human-readable format and using `Sysbot\Telegram` as namespace prefix for the stubs:

```
  $ vendor/bin/tgscraper app:dump-schemas -r --namespace-prefix "Sysbot\Telegram" out
```

Custom format
-------------

[](#custom-format)

If you're interested in the custom format generated by TGScraper, you can find its schema [here](docs/schema.json).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 96.5% 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 ~44 days

Recently: every ~118 days

Total

26

Last Release

686d ago

Major Versions

1.4 → 2.02021-07-24

2.1 → 3.02021-08-23

3.0.3 → 4.02022-04-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0cd238b296b6fdfe554447dc0e77483ae4f0e5239df0d8ed29ccb23194f016e?d=identicon)[sys-001](/maintainers/sys-001)

---

Top Contributors

[![sys-001](https://avatars.githubusercontent.com/u/28715512?v=4)](https://github.com/sys-001 "sys-001 (55 commits)")[![davtur19](https://avatars.githubusercontent.com/u/13476215?v=4)](https://github.com/davtur19 "davtur19 (2 commits)")

---

Tags

bot-apijson-schemaopenapiphpphp-code-generatorphp-frameworkschema-generationtelegramtelegram-bottelegram-bot-api

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sysbot-tgscraper/health.svg)

```
[![Health](https://phpackages.com/badges/sysbot-tgscraper/health.svg)](https://phpackages.com/packages/sysbot-tgscraper)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)

PHPackages © 2026

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