Retrieve a list of reference songs

December 2, 2024

Table of contents

  1. Request Headers
  2. Query Parameters
  3. Responses
  4. Model
  5. Examples
  6. Try It

https://api.useapi.net/v1/mureka/music/refs/?…

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Query Parameters
  • account is optional when only one account configured. However, if you have multiple accounts configured, this parameter becomes required.

  • mood is optional. Filter songs by mood, to retrieve list supported moods use GET music/moods-and-genres.

  • genre is optional. Filter songs by genre, to retrieve list supported genres use GET music/moods-and-genres.

  • last_id is optional. Use it to retrieve the next page of data. To do so, set its value to the last_id returned in the previous response when the more field in that response is true.

Responses
  • 200 OK

    {
        "list": [
            {
                "id": 1122334455,
                "url": "https://<song download url>.mp3",
                "duration_milliseconds": 30000,
                "mood": "relaxed",
                "title": "<song title>",
                "genre": "afrobeat",
                "username": "<user name>"
            },
            {
                "id": 66778899,
                "url": "https://<song download url>.mp3",
                "duration_milliseconds": 30000,
                "mood": "restless",
                "title": "<song title>",
                "genre": "rock",
                "username": "<user name>"
            }
        ],
        "last_id": 77665544332211,
        "more": true
    }
    
  • 400 Bad Request

    {
        "error": "<Error message>",
        "code": 400
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
    list: {
        id: number
        url: string
        duration_milliseconds: number
        mood: string
        title: string
        genre: string
        username: string
    }[]
    last_id: number
    more: boolean
}
Examples
  • curl "https://api.useapi.net/v1/mureka/music/refs/?account=account" \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const account = "Previously configured account"; 
    const apiUrl = `https://api.useapi.net/v1/mureka/music/refs/?account=${account}`; 
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`,
      },
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    account = "Previously configured account"
    apiUrl = f"https://api.useapi.net/v1/mureka/music/refs/?account={account}"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It