Documentation Index
Fetch the complete documentation index at: https://docs.xhuoapi.ai/llms.txt
Use this file to discover all available pages before exploring further.
SUNO 允許我們對生成的音樂獲取官方生成的MP4鏈接,本文檔講解相關 API 的對接方法。
該 API 只有一個輸入參數,就是 audio_id,它是官方生成的歌曲ID。
這裡我們輸入的 audio_id 是 275113ab-fe5c-4bca-a33c-0cca96b39fa6。
import requests
url = "https://api.xhuoapi.ai/v1/suno/mp4"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"audio_id": "275113ab-fe5c-4bca-a33c-0cca96b39fa6"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
結果如下:
{
"success": true,
"task_id": "03ae7cca-c3a2-40a0-98b2-8f33426af438",
"trace_id": "848d8d5a-d6bb-4e16-bb29-768c22cf1b3b",
"data": {
"video_url": "https://cdn1.suno.ai/275113ab-fe5c-4bca-a33c-0cca96b39fa6.mp4"
}
}
可以看到,data 的 video_url 欄位就是該歌曲所對應的MP4文件鏈接。