PHPackages                             chipslays/telegraph - 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. chipslays/telegraph

ActiveLibrary[API Development](/categories/api)

chipslays/telegraph
===================

Telegraph API Client for PHP

5.0.1(6mo ago)972512MITPHP

Since Feb 5Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/chipslays/telegraph)[ Packagist](https://packagist.org/packages/chipslays/telegraph)[ RSS](/packages/chipslays-telegraph/feed)WikiDiscussions v5.x Synced 1mo ago

READMEChangelog (9)Dependencies (1)Versions (13)Used By (2)

Telegraph PHP Library
=====================

[](#telegraph-php-library)

Modern PHP library for Telegraph API. Telegraph is a minimalist anonymous publishing platform created by Telegram. Create beautiful articles in seconds without registration.

Features
--------

[](#features)

- 🚀 Simple &amp; Intuitive API - Fluent interface for easy content building
- 🎨 Rich Content Support - Headers, paragraphs, lists, images, videos, code blocks
- 🔄 HTML Conversion - Automatic HTML to Telegraph format conversion with sanitization
- 🛡️ Type Safe - Full PHP 8.1+ type hints with readonly properties
- 📝 Fully Documented - Comprehensive PHPDoc comments for IDE support

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

[](#requirements)

- PHP 8.1 or higher
- cURL extension
- JSON extension

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

[](#installation)

Install via Composer:

```
composer require chipslays/telegraph
```

Quick Start
-----------

[](#quick-start)

```
use Telegraph\Telegraph;

// Create client
$telegraph = new Telegraph;

// Create account
$account = $telegraph->createAccount(
    shortName: 'MyBlog',
    authorName: 'John Doe'
);

// IMPORTANT: Save this token!
$token = $account->accessToken();

// Create page
$page = $account->createPage(
    title: 'Hello World',
    content: 'My first Telegraph article!'
);

echo "Published: " . $page->url();
```

```
$html =
