PlaylistService is read-only and exposes two operations:
GetPlaylist
Content — playlists may contain songs, podcasts, or other supported entity kinds, so branch on the oneof id to render each row correctly.
GetPlaylist works with both API keys and OAuth tokens. With an API key you can read public playlists; with an OAuth token you can additionally read playlists the authenticated user has access to.
GetUserPlaylists
read OAuth scope.
Mutating playlists
The current SDK exposes read-only playlist operations. Creating, editing, reordering, or deleting playlists requires the user to operate inside the Anghami app or web client. Awrite-scoped mutation surface is reserved for a future revision.
Patterns
- Mixed-content rendering. Use the
Content.oneof idarm to dispatch to the right entity-fetch (e.g.GetSong) when you need full detail beyond the wrapper’s display fields. - Avoid N+1. When rendering a playlist of N songs and you need song-level data, fetch the playlist first, then use
BatchGetSongswith the collected IDs — one call instead of N. - Pagination. Long playlists are deeply paginated. Render the first page eagerly and lazy-load on scroll.