Suno Timing API Integration Guide

SUNO allows us to create derivative works from generated music and obtain the music's lyrics and audio timeline. This document explains how to integrate the relevant API.

data.aligned_words returns word-by-word alignment times. The first three words from the actual response on this page are used as an example.

Word Start (seconds) End (seconds)
Window 13.097 13.727
lights 13.91583 14.86
across 14.99667 15.7

This API has only one input parameter, audio_id, which is the song ID generated by the official service.

The audio_id entered here is 3f8c1800-7a96-4a2b-811f-5fee716a9e32.

import os

import requests

url = "https://api.acedata.cloud/suno/timing"
headers = {
    "accept": "application/json",
    "authorization": f"Bearer {os.environ['API_KEY']}",
    "content-type": "application/json",
}
payload = {
    "audio_id": "3f8c1800-7a96-4a2b-811f-5fee716a9e32",
}

response = requests.post(url, json=payload, headers=headers, timeout=180)
print(response.text)

An excerpt of the result is shown below:

{
  "success": true,
  "task_id": "192b701b-8050-40f4-960c-29b54fd4822a",
  "trace_id": "b177ad51-617a-452a-a4ff-1115e8d2b347",
  "data": {
    "aligned_words": [
      {
        "word": "[Verse]\nWindow ",
        "success": true,
        "start_s": 13.097,
        "end_s": 13.727,
        "p_align": 0.99
      },
      {
        "word": "lights ",
        "success": true,
        "start_s": 13.91583,
        "end_s": 14.86,
        "p_align": 0.99
      },
      {
        "word": "across ",
        "success": true,
        "start_s": 14.99667,
        "end_s": 15.7,
        "p_align": 0.99
      },
      {
        "word": "the ",
        "success": true,
        "start_s": 15.78,
        "end_s": 15.948,
        "p_align": 0.99
      }
    ],
    "waveform_data": [
      0.14492,
      0.20651,
      0.1787
    ],
    "hoot_cer": 0.15671641791044777,
    "is_streamed": false,
    "aligned_lyrics": [
      {
        "text": "Window lights across the bay",
        "start_s": 13.097,
        "end_s": 16.188,
        "section": "Verse",
        "words": [
          {
            "text": "Window",
            "start_s": 13.097,
            "end_s": 13.727
          },
          {
            "text": " lights",
            "start_s": 13.727,
            "end_s": 14.86
          },
          {
            "text": " across",
            "start_s": 14.86,
            "end_s": 15.68
          },
          {
            "text": " the",
            "start_s": 15.7,
            "end_s": 15.94
          },
          {
            "text": " bay",
            "start_s": 15.948,
            "end_s": 16.188
          }
        ]
      },
      {
        "text": "Guide the boats that drift away",
        "start_s": 19.397,
        "end_s": 22.631,
        "section": "Verse",
        "words": [
          {
            "text": "Guide",
            "start_s": 19.397,
            "end_s": 19.789
          },
          {
            "text": " the",
            "start_s": 19.789,
            "end_s": 19.98
          },
          {
            "text": " bo",
            "start_s": 19.98,
            "end_s": 20.092
          },
          {
            "text": "ats",
            "start_s": 20.092,
            "end_s": 20.653
          },
          {
            "text": " that",
            "start_s": 20.689,
            "end_s": 21.063
          },
          {
            "text": " drift",
            "start_s": 21.22,
            "end_s": 22.07
          },
          {
            "text": " away",
            "start_s": 22.07,
            "end_s": 22.631
          }
        ]
      }
    ]
  }
}

aligned_words Field Description

As shown, data.aligned_words is an array of objects, each representing a word or phrase with timing information.

  • word: The actual word or phrase in the lyrics
  • success: A Boolean indicating whether the alignment of this word was successful
  • start_s: The start time of the word
  • end_s: The end time of the word
  • p_align: The probability or confidence score of the alignment, ranging from 0 to 1

data.aligned_lyrics provides timing for lines and words and can be used for scrolling lyrics. waveform_data contains waveform samples. When selecting a replacement segment, you can read the alignment times and listen to the original song to verify them.