popnable/popnable-api

Popnable API 的 PHP 封装

dev-master 2019-10-10 15:05 UTC

This package is not auto-updated.

Last update: 2019-10-10 15:07:15 UTC


README

Popnable 是一家领先的网站,提供来自世界各地的 音乐排行榜。网站包含关于 250K 个视频,50K 位艺术家,110 个国家,100K 个音乐排行榜的数据。

此 API 是 Popnable API 的封装,允许您从 Popnable 仓库中获取音乐排行榜、歌曲、艺术家等。

要求

  • PHP 5.3.0 或更高版本

安装

  "require": {
        "popnable/popnable-api": "dev-master"
  }

基本示例

<?php
require_once __DIR__ . '/vendor/autoload.php'; // Autoload files using Composer autoload

$api_key = 'YOUR-API-KEY';

$client = new \Popnable\Client($api_key);

$popnable = new \Popnable\Commands\Songs($client);
$response = $popnable->getSongs([
    'ids' => '2,6,12'
])

入门

Popnable 需要一个账户来访问 API 密钥并管理它。您可以在一个账户中生成无限数量的 API 密钥。每次请求都会消耗一定数量的单位,这些单位可以通过以下两种方式获得

  • 免费单位 - 通过在 Popnable 上贡献内容获得
  • 付费单位 - 由您购买。每 1000 个单位的价格为 10 美元。请联系 Popnable 获取更多详情:support@popnable.com

API 密钥

Popnable 实现了对大量请求的基本防护。您必须拥有一个密钥(md5)。此密钥受到单位数量和 IP 地址的限制。

方法

searchByKeyword()
getTrends()
getSongs()
getSongsByTrend()
getArtists()
getArtistByTrend()
getDailyChart()
getWeeklyChart()
getMonthlyChart()
getYearEndChart()
getArtistChart()
getVideos()

社区

访问: https://popnable.com/forums

邮箱: support@popnable.com