Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/YunzhiYike/Suno-SDK
This is an unofficial Suno API based on PHP; it provides support for all Suno interfaces.
https://github.com/YunzhiYike/Suno-SDK
php suno suno-ai suno-sdk
Last synced: about 1 month ago
JSON representation
This is an unofficial Suno API based on PHP; it provides support for all Suno interfaces.
- Host: GitHub
- URL: https://github.com/YunzhiYike/Suno-SDK
- Owner: YunzhiYike
- License: mit
- Created: 2024-04-02T14:31:32.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-03T08:49:50.000Z (8 months ago)
- Last Synced: 2024-07-07T08:47:17.466Z (5 months ago)
- Topics: php, suno, suno-ai, suno-sdk
- Language: PHP
- Homepage: https://sunoai.ai
- Size: 482 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-CN.md
- License: LICENSE
Awesome Lists containing this project
- awesome-suno - YunzhiYike/Suno-SDK - This is an unofficial Suno API based on PHP; it provides support for all Suno interfaces. (List of Projects / PHP)
- awesome-suno - YunzhiYike/Suno-SDK - This is an unofficial Suno API based on PHP; it provides support for all Suno interfaces. (List of Projects / PHP)
README
[English](README.md) | 中文 | [日本語](./README-JP.md)
# 非官方 Suno PHP-SDK
这是一个基于 PHP 的非官方 Suno API;它为所有 Suno 接口提供支持。## 安装 🔨
```bash
composer require yunzhiyike/suno-ai-sdk
```## 方法 📖
- [x] `generateMusic` [说明: 生成音乐, 返回 `uid` ]
- [x] `refreshSession` [说明: 延长会话时间, 返回 `PersonalInfoEntity` ]
- [x] `getUserInfoByEmail` [说明: 通过电子邮件获取用户信息, 返回 `PersonalInfoEntity` ]
- [x] `getWorkList` [说明:获取生成的音乐列表, 返回 `WorkEntity[]` ]
- [x] `getAvailableTimes` [说明: 获取可用次数, 返回 `int` ]## Cookie提取 🚗
> 在此之前你需要先登录!
![img_1.png](img_1.png)
## 示例 🌲
```php
refreshSession();
$userInfo = $sunoApi->getUserInfoByEmail($info->getEmail());
$page = 1;
$res = $sunoApi->getWorkList($userInfo->getUserId(), $page);
foreach ($res as $r) {
var_dump($r);
}
var_dump($sunoApi->getAvailableTimes($userInfo->getUserId()));
var_dump($sunoApi->generateMusic($userInfo->getUserId(), 'music title', 'music text', 'music tags', true));
}
}```