PHPackages                             dansup/pixelfed-php - 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. dansup/pixelfed-php

ActiveLibrary[API Development](/categories/api)

dansup/pixelfed-php
===================

Pixelfed PHP SDK

v1.0.0(6y ago)24482[3 issues](https://github.com/dansup/pixelfed-php/issues)AGPL-3.0-onlyPHPPHP ^7.2

Since Jan 31Pushed 6y ago2 watchersCompare

[ Source](https://github.com/dansup/pixelfed-php)[ Packagist](https://packagist.org/packages/dansup/pixelfed-php)[ Docs](https://github.com/dansup/pixelfed-php)[ RSS](/packages/dansup-pixelfed-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Pixelfed PHP Library
====================

[](#pixelfed-php-library)

PHP Library for [Pixelfed](https://pixelfed.org)

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

[](#installation)

Install with [Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos)

```
composer require dansup/pixelfed-php
```

Authentication
--------------

[](#authentication)

You need a token from a Pixelfed instance. Navigate to `/settings/applications` on the Pixelfed instance and generate a new `Personal Access Tokens`. Use that token for authentication.

Examples
--------

[](#examples)

### Nodeinfo

[](#nodeinfo)

```
php -f examples/nodeinfo.php
```

Methods
-------

[](#methods)

### user()

[](#user)

Returns current user.

> GET /api/v1/accounts/verify\_credentials

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->user();
```

### accountById($id)

[](#accountbyidid)

Fetch account by user id.

> GET /api/v1/accounts/{$id}

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountById($id);
```

### accountFollowersById($id)

[](#accountfollowersbyidid)

Fetch account followers by user id.

> GET /api/v1/accounts/{$id}/followers

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountFollowersById($id);
```

### accountFollowingById($id)

[](#accountfollowingbyidid)

Fetch account following by user id.

> GET /api/v1/accounts/{$id}/following

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountFollowingById($id);
```

### accountStatusesById($id)

[](#accountstatusesbyidid)

Fetch account statuses by user id.

> GET /api/v1/accounts/{$id}/statuses

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountStatusesById($id);
```

### accountSearch($id)

[](#accountsearchid)

Fetch accounts by search query.

> GET /api/v1/accounts/search?q={$id}

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountSearch($id);
```

### accountBlocks()

[](#accountblocks)

Fetch account blocks of current user.

> GET /api/v1/blocks

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountBlocks();
```

### accountLikes()

[](#accountlikes)

Fetch likes of current user.

> GET /api/v1/favourites

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountLikes();
```

### accountFollowRequests()

[](#accountfollowrequests)

Fetch follow requests of current user.

> GET /api/v1/follow\_requests

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountFollowRequests();
```

### instance()

[](#instance)

Fetch pixelfed instance data.

> GET /api/v1/instance

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->instance();
```

### accountMutes()

[](#accountmutes)

Fetch account mutes of current user.

> GET /api/v1/mutes

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountMutes();
```

### accountNotifications()

[](#accountnotifications)

Fetch notifications of current user.

> GET /api/v1/notifications

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountNotifications();
```

### homeTimeline()

[](#hometimeline)

Fetch home timeline.

> GET /api/v1/timelines/home

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->homeTimeline();
```

### publicTimeline()

[](#publictimeline)

Fetch public timeline.

> GET /api/v1/timelines/public

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->publicTimeline();
```

### statusById($id)

[](#statusbyidid)

Fetch status by id.

> GET /api/v1/statuses/{$id}

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->statusById($id);
```

### statusRebloggedById($id)

[](#statusrebloggedbyidid)

Fetch reblogs/shares by status id.

> GET /api/v1/statuses/{$id}/reblogged\_by

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->statusRebloggedById($id);
```

### statusLikedById($id)

[](#statuslikedbyidid)

Fetch likes by status id.

> GET /api/v1/statuses/{$id}/favourited\_by

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->statusLikedById($id);
```

### followAccountById($id)

[](#followaccountbyidid)

Follow account by id.

> POST /api/v1/accounts/{$id}/follow

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->followAccountById($id);
```

### unfollowAccountById($id)

[](#unfollowaccountbyidid)

Unfollow account by id.

> POST /api/v1/accounts/{$id}/unfollow

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->unfollowAccountById($id);
```

### accountBlockById($id)

[](#accountblockbyidid)

Block account by id.

> POST /api/v1/accounts/{$id}/block

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountBlockById($id);
```

### accountUnblockById($id)

[](#accountunblockbyidid)

Unblock account by id.

> POST /api/v1/accounts/{$id}/unblock

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountUnblockById($id);
```

### statusFavouriteById($id)

[](#statusfavouritebyidid)

Like status by id.

> POST /api/v1/statuses/{$id}/favourite

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->statusFavouriteById($id);
```

### statusUnfavouriteById($id)

[](#statusunfavouritebyidid)

Unlike status by id.

> POST /api/v1/statuses/{$id}/unfavourite

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->statusUnfavouriteById($id);
```

### mediaUpload($file)

[](#mediauploadfile)

Upload media.

> POST /api/v1/media

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->mediaUpload($file);
```

### accountMuteById($id)

[](#accountmutebyidid)

Mute account by id.

> POST /api/v1/accounts/{$id}/mute

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountMuteById($id);
```

### accountUnmuteById($id)

[](#accountunmutebyidid)

Unmute account by id.

> POST /api/v1/accounts/{$id}/unmute

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->accountUnmuteById($id);
```

### statusCreate($mediaIds = \[\], $caption = null, $sensitive = false, $scope = 'public', $inReplyToId = null)

[](#statuscreatemediaids---caption--null-sensitive--false-scope--public-inreplytoid--null)

Create new status, requires `$mediaIds` from `mediaUpload()`

> POST /api/v1/statuses

**AUTHENTICATION REQUIRED**

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$token = 'personal-access-token-here';
$api = new PixelfedApi($domain, $token);
$data = $api->statusCreate($mediaIds, $caption = null, $sensitive = false, $scope = 'public', $inReplyToId = null);
```

### nodeinfo()

[](#nodeinfo-1)

Fetch instance nodeinfo.

> GET /api/nodeinfo/2.0.json

```
use \Pixelfed\PixelfedApi;

$domain = 'https://pixelfed.social';
$api = new PixelfedApi($domain);
$data = $api->nodeinfo();
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Daniel Supernault](https://github.com/dansup)
- [All Contributors](../../contributors)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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 ~10 days

Total

2

Last Release

2284d ago

Major Versions

v0.0.1 → v1.0.02020-02-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6f279a69b741c13c678663a9780d178bd9432c63b53b155e8e751dc560ddcca?d=identicon)[dansup](/maintainers/dansup)

---

Top Contributors

[![dansup](https://avatars.githubusercontent.com/u/877217?v=4)](https://github.com/dansup "dansup (22 commits)")

---

Tags

packagepixelfedpixelfed-apiapilibraryfediversepixelfedpixelfed-sdk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dansup-pixelfed-php/health.svg)

```
[![Health](https://phpackages.com/badges/dansup-pixelfed-php/health.svg)](https://phpackages.com/packages/dansup-pixelfed-php)
```

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[chatapi/whatsapp

Library for WhatsApp api

453.6k](/packages/chatapi-whatsapp)[danielstieber/coda-php

CodaPHP is a library that makes it easy to use Coda API in web projects.

306.4k2](/packages/danielstieber-coda-php)

PHPackages © 2026

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