承接 jwilsson/spotify-web-api-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jwilsson/spotify-web-api-php

最新稳定版本:7.0.0

Composer 安装命令:

composer require jwilsson/spotify-web-api-php

包简介

A PHP wrapper for Spotify's Web API.

关键字:

README 文档

README

Packagist build Coverage Status

This is a PHP wrapper for Spotify's Web API. It includes the following:

  • Helper methods for all API endpoints:
    • Information about artists, albums, tracks, podcasts, audiobooks, and users.
    • List music featured by Spotify.
    • Playlist and user music library management.
    • Spotify catalog search.
    • User playback control.
  • Authorization flow helpers.
  • Automatic refreshing of access tokens.
  • Automatic retry of rate limited requests.
  • PSR-4 autoloading support.

Requirements

Installation

Install it using Composer:

composer require jwilsson/spotify-web-api-php

Usage

Before using the Spotify Web API, you'll need to create an app at Spotify’s developer site.

Note: Applications created after 2021-05-27 might need to perform some extra steps.

Simple example displaying a user's profile:

require 'vendor/autoload.php';

$session = new SpotifyWebAPI\Session(
    'CLIENT_ID',
    'CLIENT_SECRET',
    'REDIRECT_URI'
);

$api = new SpotifyWebAPI\SpotifyWebAPI();

if (isset($_GET['code'])) {
    $session->requestAccessToken($_GET['code']);
    $api->setAccessToken($session->getAccessToken());

    print_r($api->me());
} else {
    $options = [
        'scope' => [
            'user-read-email',
        ],
    ];

    header('Location: ' . $session->getAuthorizeUrl($options));
    die();
}

For more instructions and examples, check out the documentation.

The Spotify Web API Console can also be of great help when trying out the API.

Contributing

Contributions are more than welcome! See CONTRIBUTING.md for more info.

License

MIT license. Please see LICENSE.md for more info.

统计信息

  • 总下载量: 1.21M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 895
  • 点击次数: 1
  • 依赖项目数: 12
  • 推荐数: 0

GitHub 信息

  • Stars: 885
  • Watchers: 34
  • Forks: 154
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-06-20