Retrieve generated song lyrics and other details

December 2, 2024

Table of contents

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

https://api.useapi.net/v1/mureka/music/song_id

The song_id value returned by one of the following endpoints:

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Responses
  • 200 OK

    {
        "song": {
            "song_id": "user:777-mureka:987654321-song:123456789",
            "title": "<song title>",
            "version": "1",
            "duration_milliseconds": 1234567,
            "generate_at": 123456789,
            "genres": [
                "rock",
                "metal"
            ],
            "moods": [
                "majestic",
                "romantic",
                "mysterious"
            ],
            "mp3_url": "https://<download link>.mp3",
            "share_key": "<share key>",
            "machine_audit_state": 1,
            "credit_type": 1,
            "cover": "https://<cover image>.png",
            "lyrics": [
                {
                    "rows": [
                        {
                            "start": 1,
                            "end": 100,
                            "text": "lyrics here"
                        },
                        {
                            "start": 200,
                            "end": 300,
                            "text": "lyrics continues"
                        }
                    ]
                }
            ],
            "video": {},
            "share_link": "https://<share link>"
        },
        "user": {
            "id": "987654321",
            "user_id": 987654321,
            "stage_name": "<stage name>",
            "profile_image": "https://<profile image>.png"
        },
        "feed_id": 998877665544332211
    }
    
  • 400 Bad Request

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

    {
      "error": "Unauthorized",
      "code": 401
    }
    
  • 404 Not Found

    {
      "error": "The song has been deleted"
    }
    
Model
{ // TypeScript, all fields are optional
    song: {
        song_id: number
        title: string
        version: string
        duration_milliseconds: number
        generate_at: number
        genres: string[]
        moods: string[]
        mp3_url: string
        share_key: string
        share_link: string
        machine_audit_state: number
        credit_type: number
        cover: string
        lyrics: {
            seg_type: number
            user_input_tag: string
            start?: number
            end?: number
            rows?: {
                start?: number
                end?: number
                text: string
            }[]
        }[]
        video?: {
            video_url: string
            video_cover_url: string
            video_id: number
        }
    }
    user: {
        id: string
        user_id: number
        stage_name: string
        profile_image: string
    }
    feed_id: number
}
Examples
  • curl "https://api.useapi.net/v1/mureka/music/song_id" \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const song_id = "song_id"; 
    const apiUrl = `https://api.useapi.net/v1/mureka/music/${song_id}`; 
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`,
      },
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    song_id = "song_id"
    apiUrl = f"https://api.useapi.net/v1/mureka/music/{song_id}"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It