---
title: "随机获取歌曲"
method: GET
path: "/songs/random"
tags: ["歌曲管理"]
---

# 随机获取歌曲

`GET /songs/random`

与 /songs 共享过滤条件，随机返回 limit 首歌曲完整对象。用于「随机播放」场景。
返回字段与 GET /songs 一致（数组包裹在 songs 字段中），total 为实际返回数量。

## Query parameters

- `type` string
- `keyword` string
- `path_prefix` string
- `genre` string
- `artist` string
- `album` string
- `language` string
- `style` string
- `year` integer
- `decade` integer
- `exclude_playlist_labels` string
- `limit` integer

## Response `200`

成功返回随机歌曲列表

- object

## Other responses

- `500` — 服务器错误

---

[API](https://skmtc.net/songloft-org/apis/songloft-api.md) · [All operations](https://skmtc.net/songloft-org/apis/songloft-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/songloft-org/songloft-api/revisions/3597db751d49/schema)
