PHPackages                             jacklul/e621-api - 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. jacklul/e621-api

AbandonedArchivedLibrary[API Development](/categories/api)

jacklul/e621-api
================

Wrapper for e621.net API

0.5.1(7y ago)3138MITPHPPHP ^5.5|^7.0

Since Feb 21Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jacklul/e621-api)[ Packagist](https://packagist.org/packages/jacklul/e621-api)[ RSS](/packages/jacklul-e621-api/feed)WikiDiscussions master Synced yesterday

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

Due to many changes in the new API this project has been discontinued.
----------------------------------------------------------------------

[](#due-to-many-changes-in-the-new-api-this-project-has-been-discontinued)

e621 API [![Build Status](https://camo.githubusercontent.com/f9a8f85071e4556e6e5f0d2c5baffed70e7c5f31bfebcc4341be7d4ce1ce2e6a/68747470733a2f2f7472617669732d63692e6f72672f6a61636b6c756c2f653632312d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jacklul/e621-api)
========================================================================================================================================================================================================================================================================================

[](#e621-api-)

Simple wrapper for e621.net API written in PHP, uses [**Guzzle**](https://github.com/guzzle/guzzle) under the hood.

**This class is currently in development, most of the stuff was not tested and not every method in entities is implemented yet.**

Table of Contents
-----------------

[](#table-of-contents)

- [Instructions](#instructions)
    - [Installation](#installation)
    - [Usage](#usage)
    - [Logging in](#logging-in)
    - [Debugging](#debugging)
- [API Methods](#api-methods)
- [Exceptions](#exceptions)
- [License](#license)

Instructions
------------

[](#instructions)

### Installation

[](#installation)

Install this package through [Composer](https://github.com/composer/composer) - `composer require jacklul/e621-api`.

### Usage

[](#usage)

- Initialize the `E621` object:

```
    require 'vendor/autoload.php';

    use jacklul\E621API\E621;

    $api = new E621();
```

- You should specify custom user agent to identify your project:

```
    $options = [
        'headers'  => [
            'User-Agent' => 'My project',
        ],
    ];

    $api = new E621($options);
```

- Perform request with parameters:

```
    $request = $api->postIndex(['tags' => 'cat order:score', 'limit' => 25]);
```

- This will return `Response` object, to get the actual data we make sure the request was successful first before getting result data:

```
    if ($request->isSuccessful()) {
        $results = $request->getResult();    // Result data (usually array of objects, empty array means no results)
    } else {
        echo $request->getReason();     // Failure reason
        echo $request->getMessage();    // Failure descriptive message (when available)
        echo $request->getRawResult();  // Raw response (when available)
    }
```

- You can easily iterate over the result using `foreach()` and then print every image's URL:

```
    /** @var \jacklul\E621API\Entity\Post $post */
    foreach ($results as $post) {
        echo $post->getFileUrl() . PHP_EOL;
    }
```

You can pass **Guzzle**'s options applied only for a single request as a second parameter:

```
    $request = $api->postIndex(['tags' => 'cat order:score'], ['timeout' => 10]);
```

By default library will throw exceptions on connection failures or errors, you can disable this by using:

```
    $api->throwExceptions(false);   // Not recommended
```

When disabled - all error messages will be available via `$request->getError()` method and `$request->getReason()` will contain a message that you can display to the user.

### Logging in

[](#logging-in)

Some actions require logging in to execute, to authenticate you can either pass `login` and `password_hash` (API key) parameters with each request or set it globally:

```
    $api = new E621();
    $api->login('login', 'api_key');  // Set authentication data
    $request = $api->dmailInbox();
    $api->logout();                   // Remove authentication data
```

### Debugging

[](#debugging)

You can set progress handler through **Guzzle**'s options while initializing the object, per single request or after:

```
    $api->setProgressHandler([$this, 'progress']);
    $api->setProgressHandler(null);     // Unset the handler
```

Similar with a debug logging function:

```
    $api->setDebugLogHandler([$this, 'logger']);
    $api->setDebugLogHandler(null);     // Unset the handler
```

This will write the output to `php://temp` until the request finishes and then it will flush it to your handler, if you need to use different approach then set your handler through **Guzzle**'s options.

API Methods
-----------

[](#api-methods)

See [official API documentation](https://e621.net/help/show/api).

#### Posts

[](#posts)

- **postCreate** (login required)
- **postUpdate** (login required)
- **postShow**
- **postCheckMd5**
- **postTags**
- **postIndex**
- **postFlag** (login required)
- **postDestroy** (login required)
- **postDeletedIndex**
- **postPopularByDay**
- **postPopularByWeek**
- **postPopularByMonth**
- **postRevertTags** (login required)
- **postVote** (login required)

#### Tags

[](#tags)

- **tagIndex**
- **tagShow**
- **tagUpdate** (login required)
- **tagRelated**
- **tagAliasIndex**
- **tagImplicationIndex**

#### Artists

[](#artists)

- **artistIndex**
- **artistCreate** (login required)
- **artistUpdate** (login required)
- **artistDestroy** (login required)

#### Comments

[](#comments)

- **commentShow**
- **commentIndex**
- **commentSearch**
- **commentCreate** (login required)
- **commentUpdate** (login required)
- **commentDestroy** (login required)
- **commentHide** (login required)
- **commentUnhide** (login required)
- **commentVote** (login required)

#### Blips

[](#blips)

- **blipCreate** (login required)
- **blipUpdate** (login required)
- **blipIndex**
- **blipShow**
- **blipHide** (login required)
- **blipUnhide** (login required)

#### Wiki

[](#wiki)

- **wikiIndex**
- **wikiCreate** (login required)
- **wikiUpdate** (login required)
- **wikiShow**
- **wikiDestroy** (login required)
- **wikiLock** (login required)
- **wikiUnlock** (login required)
- **wikiRevert** (login required)
- **wikiHistory**
- **wikiRecentChanges**

#### Notes

[](#notes)

- **noteIndex**
- **noteSearch**
- **noteHistory**
- **noteRevert** (login required)
- **noteUpdate** (login required)

#### Users

[](#users)

- **userIndex**
- **userShow**
- **userRecordShow**

#### Dmail

[](#dmail)

- **dmailCreate** (login required)
- **dmailInbox** (login required)
- **dmailShow** (login required)
- **dmailHide** (login required)
- **dmailUnhide** (login required)
- **dmailHideAll** (login required)
- **dmailUnhideAll** (login required)
- **dmailMarkAllRead** (login required)

#### Forum

[](#forum)

- **forumCreate** (login required)
- **forumUpdate** (login required)
- **forumIndex**
- **forumSearch**
- **forumShow**
- **forumHide** (login required)
- **forumUnhide** (login required)

#### Pools

[](#pools)

- **poolIndex**
- **poolShow**
- **poolUpdate** (login required)
- **poolCreate** (login required)
- **poolDestroy** (login required)
- **poolAddPost** (login required)
- **poolRemovePost** (login required)

#### Sets

[](#sets)

- **setIndex**
- **setShow**
- **setCreate** (login required)
- **setUpdate** (login required)
- **setAddPost** (login required)
- **setRemovePost** (login required)
- **setDestroy** (login required)
- **setMaintainers** (login required)

#### Maintainers

[](#maintainers)

- **setMaintainerIndex** (login required)
- **setMaintainerCreate** (login required)
- **setMaintainerDestroy** (login required)
- **setMaintainerApprove** (login required)
- **setMaintainerDeny** (login required)
- **setMaintainerBlock** (login required)

#### Favorites

[](#favorites)

- **favoriteListUsers**
- **favoriteCreate** (login required)
- **favoriteDestroy** (login required)

#### Tag History

[](#tag-history)

- **postTagHistoryIndex**

#### Flag History

[](#flag-history)

- **postFlagHistoryIndex**

#### Tickets

[](#tickets)

- **ticketCreate** (login required)
- **ticketIndex**
- **ticketShow**

Exceptions
----------

[](#exceptions)

#### `jacklul\E621API\Exception\ConnectException`

[](#jacklule621apiexceptionconnectexception)

Is thrown when connection to e621.net API failed or timed out, in most cases it will also contain `GuzzleHttp\Exception\ConnectException` exception which might explain the issue (`$e->getPrevious()`).

#### `jacklul\E621API\Exception\LoginRequiredException`

[](#jacklule621apiexceptionloginrequiredexception)

Is thrown when executed method requires logging in but no login data was provided.

#### `jacklul\E621API\Exception\E621Exception`

[](#jacklule621apiexceptione621exception)

Is thrown when something happens but it's none of the above.

Possible cases:

- HTTP client error, will contain `GuzzleHttp\Exception\GuzzleException` exception (`$e->getPrevious()`)
- data parsing error, will contain `Psr\Http\Message\ResponseInterface` object (`$e->getResponse()`, to get raw body use `$e->getResponse()->getBody()`

License
-------

[](#license)

**MIT License**, for details see [LICENSE](LICENSE).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~40 days

Recently: every ~55 days

Total

9

Last Release

2728d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8418678?v=4)[Jack'lul](/maintainers/jacklul)[@jacklul](https://github.com/jacklul)

---

Top Contributors

[![jacklul](https://avatars.githubusercontent.com/u/8418678?v=4)](https://github.com/jacklul "jacklul (63 commits)")

---

Tags

apiapi-wrappere621e621-apinsfwwrapperapiwrappere621

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jacklul-e621-api/health.svg)

```
[![Health](https://phpackages.com/badges/jacklul-e621-api/health.svg)](https://phpackages.com/packages/jacklul-e621-api)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M84](/packages/openai-php-laravel)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[resend/resend-php

Resend PHP library.

617.2M37](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M12](/packages/checkout-checkout-sdk-php)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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