---
title: "获取歌单歌曲 ID 列表"
method: GET
path: "/playlists/{id}/song-ids"
tags: ["歌单管理"]
---

# 获取歌单歌曲 ID 列表

`GET /playlists/{id}/song-ids`

返回歌单内全部歌曲的 ID，不分页。sort/order 语义与 GET /playlists/{id}/songs 完全一致（同一套排序逻辑），省略时默认 position 升序。
用途：客户端需要知道「某首歌在歌单里排第几」时（如从播放历史里的某首歌接着往下播），用本端点拿到有序 ID 数组后取下标，即可直接作为 /playlists/{id}/songs 的 offset 使用（传相同的 sort/order），避免为此拉取全部歌曲对象。
形态与 GET /songs/ids 对齐。

## Path parameters

- `id` integer, required

## Query parameters

- `sort` string
- `order` string

## Response `200`

成功返回 {ids:[1,2,3], total:3}

- object

## Other responses

- `400` — 无效的歌单 ID
- `500` — 服务器错误

## Changes

- **2026-08-11** `632043f09e58` — 2 info
  - added the new optional `query` request parameter `order`
  - added the new optional `query` request parameter `sort`
- **2026-07-30** `9d0c9dd2d9a4` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/songloft-org/apis/songloft-api/changes/playlists/:id/song-ids/get.md)

---

[API](https://skmtc.dev/songloft-org/apis/songloft-api.md) · [All operations](https://skmtc.dev/songloft-org/apis/songloft-api/llms.txt) · [OpenAPI document](https://skmtc.dev/songloft-org/apis/songloft-api/revisions/94a164c257e6?raw)
