Retrieve the list of songs you have generated

February 17, 2025

Table of contents

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

https://api.useapi.net/v1/riffusion/music/?…

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

  • offset is optional, specify the offset from where to start. Default 0.

  • limit is optional, specify the number of songs to return. Default 10.

  • id is optional, specify the music id to retrieve. You can specify job_id value returned by POST music/create-prompt or POST music/create-compose to retrieve the status and results of the music generation job.

Responses
  • 200 OK

    [
        {
            "id": "<uuid>",
            "group_id": "",
            "author_id": "<uuid>",
            "created_at": "2025-02-12T12:22:33.12345Z",
            "audio_variation": "Jazz-Pop, downtempo, smooth piano, light cymbal brushes, dreamy ambiance",
            "lyrics": "[Instrumental]",
            "lyrics_timestamped": "{…}",
            "title": "Vivid Daydream",
            "image_override": null,
            "conditions": "[{…}]",
            "sound": "Jazz-Pop, downtempo, smooth piano, light cymbal brushes, dreamy ambiance",
            "topic": "…",
            "image_id": "<uuid>",
            "simple_waveform": "[…]",
            "remix_parent_id": null,
            "duration_s": 234.57,
            "privacy": "unlisted",
            "transform": null,
            "parent_riff_id": null,
            "audio_upload_id": null,
            "is_favorite": false,
            "favorite_count": 0,
            "play_count": 0,
            "status": "completed",
            "download_url": "https://api.riffusion.com/….m4a",
            "share_url": "https://www.riffusion.com/riff/<uuid>",
            "image_url": "https://api.riffusion.com/….jpeg"
        }
    ]
    
  • 400 Bad Request

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

    {
      "error": "Unauthorized",
      "code": 401
    }
    
  • 596 Pending error

    API was unable to refresh your cookie. Please resolve this issue by using the POST accounts endpoint before making any new API calls.

    {
      "error": "Your Riffusion account has pending error. Please address this issue at https://useapi.net/docs/api-riffusion-v1/post-riffusion-accounts before making any new API calls."
    }
    
Model
{   // TypeScript, all fields are optional
    id: string
    group_id: string
    author_id: string
    created_at: string
    audio_variation: string
    lyrics: string
    lyrics_timestamped: string
    title: string
    image_override?: string
    conditions: string
    sound: string
    topic?: string
    image_id: string
    simple_waveform: string
    remix_parent_id?: string
    duration_s: number
    privacy: string
    transform?: string
    parent_riff_id?: string
    audio_upload_id?: string
    is_favorite: boolean
    favorite_count: number
    play_count: number
    status: 'completed' | 'failed' | 'processing'
    download_url?: string
    share_url?: string
    image_url?: string
}[]
Examples
  • curl "https://api.useapi.net/v1/riffusion/music/?user_id=<user_id>" \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const user_id = "Previously configured account"; 
    const apiUrl = `https://api.useapi.net/v1/riffusion/music/?user_id=${user_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"
    user_id = "Previously configured account"
    apiUrl = f"https://api.useapi.net/v1/riffusion/music/?user_id={user_id}"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It