A GNU Social-compatible microblogging server https://mastodon.social PHP API
require_once '/path/Mastodon_api.php';
$mastodon_api = new Mastodon_api();
$mastodon_api->set_url('Mastodon url');
// print_r($mastodon_api->create_app('APP Name',null,null,'Mastodon url'));
$mastodon_api->set_client('client_id','client_secret');
// print_r($mastodon_api->login('your login email','your login password'));
$mastodon_api->set_token('access_token','token_type');
$mastodon_api->timelines_home();
You Choice New Library. https://github.com/yks118/Mastodon-api-php-oauth