{"id":22772898,"url":"https://github.com/baguettephp/mastodon-api","last_synced_at":"2025-04-15T06:50:19.551Z","repository":{"id":57091847,"uuid":"89470824","full_name":"BaguettePHP/mastodon-api","owner":"BaguettePHP","description":"Mastodon API Client/SDK for PHP","archived":false,"fork":false,"pushed_at":"2017-06-27T12:08:46.000Z","size":1146,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"development","last_synced_at":"2024-04-13T12:53:27.280Z","etag":null,"topics":["mastodon-api","php"],"latest_commit_sha":null,"homepage":"https://baguettephp.github.io/mastodon-api/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaguettePHP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-26T10:55:52.000Z","updated_at":"2018-10-19T06:09:48.000Z","dependencies_parsed_at":"2022-08-22T20:41:04.532Z","dependency_job_id":null,"html_url":"https://github.com/BaguettePHP/mastodon-api","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaguettePHP%2Fmastodon-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaguettePHP%2Fmastodon-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaguettePHP%2Fmastodon-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaguettePHP%2Fmastodon-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaguettePHP","download_url":"https://codeload.github.com/BaguettePHP/mastodon-api/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023708,"owners_count":21199958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mastodon-api","php"],"created_at":"2024-12-11T17:10:05.069Z","updated_at":"2025-04-15T06:50:19.534Z","avatar_url":"https://github.com/BaguettePHP.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Baguette PHP Mastodon API Client / SDK\n\n[![Package version](http://img.shields.io/packagist/v/zonuexe/mastodon-api.svg?style=flat)](https://packagist.org/packages/zonuexe/mastodon-api)\n[![Packagist](http://img.shields.io/packagist/dt/zonuexe/mastodon-api.svg?style=flat)](https://packagist.org/packages/zonuexe/mastodon-api)\n[![Build Status](https://travis-ci.org/BaguettePHP/mastodon-api.svg?branch=master)](https://travis-ci.org/BaguettePHP/mastodon-api)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/BaguettePHP/mastodon-api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/BaguettePHP/mastodon-api/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/BaguettePHP/mastodon-api/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/BaguettePHP/mastodon-api/?branch=master)\n[![Code Climate](https://codeclimate.com/github/BaguettePHP/mastodon-api.svg)](https://codeclimate.com/github/BaguettePHP/mastodon-api)\n\n## Installation\n\n```\n$ composer require zonuexe/mastodon-api\n```\n\n## Requires\n\n* PHP 5.5, 5.6, 7.0, 7.1, HHVM\n* [Composer](https://getcomposer.org/)\n\n## Features\n\n* IDE (PhpStorm) friendly class/function definitions\n* Support [multiparadigm programming](https://en.wikipedia.org/wiki/Programming_paradigm) style (procedural vs OOP)\n\n## Usage\n\n### Simple procedural style\n\n```php\n\u003c?php\n\nuse Baguette\\Mastodon as m;\n\n$service = m\\session(\n    'pawoo.net', $client_id, $client_secret,\n    [\n        'scope' =\u003e 'read write follow',\n        'grant' =\u003e ['username' =\u003e $username, 'password' =\u003e $password],\n    ]\n);\n\n// Get account by ID\n$account = $service-\u003egetAccount(42);\n\n// Toot!\n$status = $service-\u003epostStatus(m\\toot('トゥートゥー'));\n```\n\n### Manually API request\n\nIf you want to request unimplemented APIs in this SDK, you can write the request manually.  This technique is also useful when requesting instance-specific APIs.\n\n```php\n\u003c?php\n\nuse Baguette\\Mastodon as m;\n\n$service = m\\session(\n    'pawoo.net', $client_id, $client_secret,\n    [\n        // ...\n    ]\n);\n\n/** @var m\\Entity\\Account */\n$entity = m\\request($service, 'GET', '/api/v1/accounts/29', [], m\\Entity\\Account::class);\n\n// If you are a PhpStorm user, you can safely type the variable in the action of `/** @var */`.\n// Probably the following code will be fill with methods and properties by code completion.\n$entity-\u003e█\n```\n\n## Status of implementations\n\n* [x] GET /api/v1/accounts/:id `Account Mastodon::getAccount(int $id)`\n* [x] GET /api/v1/accounts/verify_credentials `Account Mastodon::getAccountCurrentUser()`\n* [x] PATCH /api/v1/accounts/update_credentials  `Account Mastodon::updateAccount(array $update_data)`\n* [x] GET /api/v1/accounts/:id/followers `Account[] getAccountFollowers(int $account_id)`\n* [ ] GET /api/v1/accounts/:id/following\n* [ ] GET /api/v1/accounts/:id/statuses\n* [ ] POST /api/v1/accounts/:id/follow\n* [ ] POST /api/v1/accounts/:id/unfollow\n* [ ] GET /api/v1/accounts/:id/block\n* [ ] GET /api/v1/accounts/:id/unblock\n* [ ] GET /api/v1/accounts/:id/mute\n* [ ] GET /api/v1/accounts/:id/unmute\n* [ ] GET /api/v1/accounts/relationships\n* [ ] GET /api/v1/accounts/search\n* [ ] POST /api/v1/apps\n* [x] GET /api/v1/blocks `Account[] getBlocks(array $options = [])`\n* [x] GET /api/v1/favourites `Status[] getFavourites(array $options = [])`\n* [x] GET /api/v1/follow_requests `Account[] getFollowRequests(array $options = [])`\n* [ ] POST /api/v1/follow_requests/:id/authorize\n* [ ] POST /api/v1/follow_requests/:id/reject\n* [ ] POST /api/v1/follows\n* [ ] GET /api/v1/instance\n* [ ] POST /api/v1/media\n* [ ] GET /api/v1/mutes\n* [ ] GET /api/v1/notifications\n* [ ] GET /api/v1/notifications/:id\n* [ ] POST /api/v1/notifications/clear\n* [ ] GET /api/v1/reports\n* [ ] POST /api/v1/reports\n* [ ] GET /api/v1/search\n* [x] GET /api/v1/statuses/:id `Status getStatus($status_id)`\n* [ ] GET /api/v1/statuses/:id/context\n* [ ] GET /api/v1/statuses/:id/card\n* [ ] GET /api/v1/statuses/:id/reblogged_by\n* [ ] GET /api/v1/statuses/:id/favourited_by\n* [x] POST /api/v1/statuses `Status Mastodon::postStatus(Toot $toot)`\n* [ ] DELETE /api/v1/statuses/:id\n* [ ] POST /api/v1/statuses/:id/reblog\n* [ ] POST /api/v1/statuses/:id/unreblog\n* [ ] POST /api/v1/statuses/:id/favourite\n* [ ] POST /api/v1/statuses/:id/unfavourite\n* [ ] GET /api/v1/timelines/home\n* [ ] GET /api/v1/timelines/public\n* [ ] GET /api/v1/timelines/tag/:hashtag\n\nCopyright\n---------\n\n**Baguette\\\\Mastodon** is licensed under [GNU General Public License, Version 3.0](https://www.gnu.org/licenses/gpl-3.0.html). See `./LICENSE`.\n\n    Baguette Mastodon - Mastodon API Client for PHP\n    Copyright (c) 2016 Baguette HQ / USAMI Kenta \u003ctadsan@zonu.me\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaguettephp%2Fmastodon-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaguettephp%2Fmastodon-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaguettephp%2Fmastodon-api/lists"}