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

# 获取歌单歌曲 ID 列表

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

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

## Path parameters

- `id` integer, required

## Response `200`

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

- object

## Other responses

- `400` — 无效的歌单 ID
- `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/versions/e4d4950ef665/schema)
