Regenerate song

December 13, 2024

Table of contents

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

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

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
Request Body
{
    "song_id": 123456789,
    "start_milliseconds": 123456
}
Responses
  • 200 OK

    {
        "feed_id": 11223344,
        "state": 3,
        "songs": [
            {
                "song_id": "user:777-mureka:123456789-song:33445566",
                "title": "<title>",
                "version": "1.1.1",
                "is_regenerate": true,
                "regenerate_from": 123456,            
                "duration_milliseconds": 234567,
                "generate_at": 12345677,
                "genres": [
                    "electronic",
                    "indie"
                ],
                "moods": [
                    "quirky",
                    "angry",
                    "restless"
                ],
                "mp3_url": "https://<download link>.mp3",
                "share_key": "<share key>",
                "recall": true,
                "machine_audit_state": 1,
                "credit_type": 1,
                "cover": "https://<cover image>.png",
                "share_link": "https://<share link>"
            },
            {
                "song_id": "user:777-mureka:123456789-song:33445566",
                "title": "<title>",
                "version": "1.1.2",
                "is_regenerate": true,
                "regenerate_from": 123456,            
                "duration_milliseconds": 1234567,
                "generate_at": 12345667,
                "genres": [
                    "electronic",
                    "world-music"
                ],
                "moods": [
                    "dark",
                    "quirky",
                    "energetic"
                ],
                "mp3_url": "https://<download link>.mp3",
                "share_key": "<share key>",
                "machine_audit_state": 1,
                "credit_type": 1,
                "cover": "https://<cover image>.png",
                "share_link": "https://<share link>"
            }
        ]
    }
    
  • 400 Bad Request

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

    {
      "error": "Wrong username/password combination.",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
    feed_id: number
    state: number
    songs?: {
        song_id: number
        title: string
        version: string
        is_regenerate: boolean
        regenerate_from: number
        duration_milliseconds: number
        generate_at: number
        genres: string[]
        moods: string[]
        mp3_url: string
        share_key: string
        machine_audit_state: number
        credit_type: number
        cover: string
    }[]
}
Examples
  • curl -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer …" \
         -X POST https://api.useapi.net/v1/mureka/music/regenerate \
         -d '{"song_id": …, "start_milliseconds": …}'
    
  • const song_id = 123456789;      
    const start_milliseconds = 123456; 
    const apiUrl = `https://api.useapi.net/v1/mureka/music/regenerate`; 
    const api_token = "API token";
    const data = { 
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${api_token}`,
        'Content-Type': 'application/json' }
    };
    data.body = JSON.stringify({ 
      song_id, start_milliseconds
    });
    const response = await fetch(apiUrl, data);
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    song_id = 123456789
    start_milliseconds = 123456
    apiUrl = f"https://api.useapi.net/v1/mureka/music/regenerate" 
    api_token = "API token"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {api_token}"
    }
    body = {
        "song_id": song_id,
        "lyrics": start_milliseconds
    }
    response = requests.post(apiUrl, headers=headers, json=body)
    print(response, response.json())
    
Try It