Skip to main content
POST
/
v1
/
streaming
/
music
AcquireMusicStream
curl --request POST \
  --url https://sdk.anghami.com/v1/streaming/music \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "songId": {
    "value": "<string>"
  },
  "maxQuality": "AUDIO_QUALITY_UNSPECIFIED"
}
'
{
  "stream": {
    "manifestUrl": "<string>",
    "drmScheme": "DRM_SCHEME_UNSPECIFIED",
    "licenseUrl": "<string>",
    "drmParams": {},
    "expiresInSeconds": 123,
    "availableQualities": [
      {
        "label": "<string>",
        "bitrateKbps": 123,
        "codec": "<string>"
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.sdk.anghami.com/llms.txt

Use this file to discover all available pages before exploring further.

Headers

Authorization
string
required

OAuth 2.0 Bearer token with the 'stream' scope. Required for all streaming operations. Format: Bearer <access_token>.

Example:

"Bearer eyJhbGciOiJSUzI1NiIs..."

Accept-Language
string

Preferred locale for error messages and metadata (BCP 47).

Example:

"ar"

Body

application/json

AcquireMusicStreamRequest is the request message for acquiring a music stream. This is the billable event for music playback.

songId
object
required

SongID is a typed identifier for a song.

maxQuality
enum<string>

AudioQuality enumerates the available audio stream quality tiers.

Available options:
AUDIO_QUALITY_UNSPECIFIED,
AUDIO_QUALITY_LOW,
AUDIO_QUALITY_STANDARD,
AUDIO_QUALITY_HIGH,
AUDIO_QUALITY_LOSSLESS

Response

Successful response

AcquireMusicStreamResponse is the response message containing the music stream details.

stream
object

StreamInfo contains the information required to play a stream. Returned by all stream acquisition RPCs.