Documentation

Clip Endpoints

Create a clip

POST https://api.soundmadeseen.com/public/v1/uploads/upload_key/create-clip/

The Create a clip endpoint creates a clip from the file upload specified by "upload_key".

If the file upload that this clip is extracted from contains a transcription, the appropriate part of the file upload's transcription will be copied over to a new transcription which is associated with this clip.

This endpoint accepts the following path parameters:

  • upload_key - the key or identifier of the upload to generate the clip from.

This endpoint requires the following body (form) parameters:

  • start - a float value in seconds from the beginning of the file upload. Defines the start of the clip. Must be a non negative value.
  • end - a float value in seconds from the beginning of the file upload. Defines the end of the clip. Must be a non negative value and greater than the start value.

This endpoint accepts the following optional body (form) parameters:

  • name - if this field is specified, set the name of the clip. If it is not specified, the name of the clip will be automatically generated.
  • transcribe - if there is not already a transcription for the original file upload, and this is set to true, then a new transcription will be generated.
  • number_of_speakers - if transcribe is set to true, then the number of speakers in the clip can be set as a hint for the transcription engine. If this field is not set, the transcription engine will guess.
  • language_code - if transcribe is set to true, and there is not a transcription for the original file upload, the language code of the new transcription can be set from the list of acceptable language codes.

Responses

If successful this endpoint will return a response with an HTTP status code of 201 and an output similar to the following:

{
  "success": true,
  "key": "Zk74kjXdFLekwWDdPZhDpr"
}

The key value from this response can be used to check the status of the clip using the Check Clip Status endpoint, documented below.

If the response is unsuccessful, the response will return an HTTP status code in the 400 range with error output similar to the following:

{
  "success": false,
  "error": "Start and end times are required"
}

Some code examples follow:

Code examples

import requests

# Replace these with your actual values
API_KEY = "MY_API_KEY"
UPLOAD_KEY = "<upload_key>"  # Replace with the actual upload_key
URL = f"https://api.soundmadeseen.com/public/v1/uploads/{UPLOAD_KEY}/create-clip/"

# Parameters for the clip
params = {
    "start": 10.5,  # Start time in seconds
    "end": 20.0,    # End time in seconds
    "name": "My New Clip"  # Name of the clip
}

# Headers
headers = {
    "Authorization": f"Api-Key {API_KEY}",
    "Content-Type": "application/json"
}

# Make the POST request
response = requests.post(URL, json=params, headers=headers)

# Handle the response
if response.status_code == 200:
    result = response.json()
    if result.get("success"):
        print("Clip created successfully!")
        print(f"Clip Key: {result['key']}")
    else:
        print("Failed to create clip. Response:", result)
else:
    print("Error:", response.status_code)
    print("Response:", response.text)

List Clips

GET https://api.soundmadeseen.com/public/v1/clips/

This endpoint provides a listing of clips belonging to the current team.

This endpoint accepts the following querystring parameters:

  • order - sets the field that determines the order results are returned. May accept the following values: 'created_date', 'name' or 'duration'. Defaults to 'created_date'
  • dir - sets the direction that determines the order results are returned. May have the values 'asc' and 'desc'. Defaults to 'desc'.
  • page - responses of this request are paginated and have a page size of 12. Setting this parameter will return the appropriate page. Defaults to 1.

Response

If successful, returns an HTTP status code of 200 with a paginated response similar to the following:

{
  "count": 2,
  "current": 1,
  "total_pages": 1,
  "page_size": 12,
  "start_index": 1,
  "end_index": 2,
  "extra_params": {},
  "results": [
    {
      "key": "Zk74kjXdFLekwWDdPZhDpr",
      "audio_file_upload": "MFeBLAYGhUwEt6i3SriWKB",
      "created_date": "2025-01-25T02:49:05.299742Z",
      "name": "Demonstration clip",
      "original_end": 115.5,
      "original_start": 0,
      "duration": 115.5
    },
    {
      "key": "jDKXpnQ3zceYqqcmXtgeEm",
      "audio_file_upload": "iwhESqoQdPVkxURbUvAUN5",
      "created_date": "2025-01-24T22:38:33.552155Z",
      "name": "Another Demonstration clip",
      "original_end": 66.18660541572054,
      "original_start": 0,
      "duration": 66.18660541572054
    }]
}

Some code examples follow:

Code examples

import requests

API_KEY = "MY_API_KEY" # Replace this with your actual API key
URL = "https://api.soundmadeseen.com/public/v1/clips/"

# Headers
headers = {
    "Authorization": f"Api-Key {API_KEY}"
}

# Make the GET request
response = requests.get(URL, headers=headers)

# Handle the response
if response.status_code == 200:
    data = response.json()
    print("Total Clips:", data["count"])
    print("Current Page:", data["current"])
    print("Total Pages:", data["total_pages"])
    print("Results:")
    for clip in data["results"]:
        print(f"- Key: {clip['key']}")
        print(f"  Name: {clip['name']}")
        print(f"  Created Date: {clip['created_date']}")
        print(f"  Duration: {clip['duration']} seconds")
        print(f"  Audio File Upload: {clip['audio_file_upload']}")
        print("")
else:
    print("Failed to retrieve clips.")
    print("Status Code:", response.status_code)
    print("Response:", response.text)

Clip Status

GET https://api.soundmadeseen.com/public/v1/clips/clip_key/status/

This endpoint can be used to check the status of a clip and is particularly useful to check after a clip has been generated using the Create a clip endpoint. The response contains a status field which may have a value of pending, error or completed.

This endpoint accepts the following path parameters:

  • upload_key - the key or identifier of this upload.

Responses

A successful response will have an HTTP status code of 200 and will look similar to the following (once the clip has been generated and fully processed):

{
  "key": "Zk74kjXdFLekwWDdPZhDpr",
  "audio_file_upload": "MFeBLAYGhUwEt6i3SriWKB",
  "created_date": "2025-01-25T02:49:05.299742Z",
  "name": "Demonstration clip",
  "original_end": 115.5,
  "original_start": 0,
  "duration": 115.5,
  "status": "completed"
}

If a clip with the specified clip_key can not be found, the response will have an HTTP status code of 404.

Following are some code examples:

Code examples

import requests

# Replace these with your actual values
API_KEY = "MY_API_KEY"
CLIP_KEY = "<clip_key>"  # Replace with the actual clip key
URL = f"https://api.soundmadeseen.com/public/v1/clips/{CLIP_KEY}/status/"

# Headers
headers = {
    "Authorization": f"Api-Key {API_KEY}"
}

# Make the GET request
response = requests.get(URL, headers=headers)

# Handle the response
if response.status_code == 200:
    data = response.json()
    print("Clip Key:", data["key"])
    print("Name:", data["name"])
    print("Audio File Upload Key:", data["audio_file_upload"])
    print("Created Date:", data["created_date"])
    print("Original Start:", data["original_start"], "seconds")
    print("Original End:", data["original_end"], "seconds")
    print("Duration:", data["duration"], "seconds")
    print("Status:", data["status"])
else:
    print("Failed to retrieve clip status.")
    print("Status Code:", response.status_code)
    print("Response:", response.text)

Clip transcription status

GET https://api.soundmadeseen.com/public/v1/clips/clip_key/transcription/

This endpoint can be used to check the status and retrieve the text of a clip's transcription.

This endpoint accepts the following path parameters:

  • clip_key - the key or identifier of this clip.

Response

A successful response will return HTTP status code 200 and will return a JSON object similar to the following:

{
  "engine": "manual",
  "status": "imported",
  "language_code": "en",
  "created_date": "2025-01-25T02:49:17.161332Z",
  "text": "The text of the transcription will appear in this field"
}

If a clip cannot be found with the provided key, a response with HTTP status code 404 will be returned with the following JSON output:

{
  "success": false,
  "error": "Clip not found"
}

If a clip is found, but does not have a transcription, a response with HTTP status code 404 will be returned with the following JSON output:

{
  "success": false,
  "error": "Transcription not found"
}

Read on for code examples:

Code examples

import requests

# Replace these with your actual values
API_KEY = "MY_API_KEY"
CLIP_KEY = "<clip_key>"  # Replace with the actual clip key
URL = f"https://api.soundmadeseen.com/public/v1/clips/{CLIP_KEY}/transcription/"

# Headers
headers = {
    "Authorization": f"Api-Key {API_KEY}"
}

# Make the GET request
response = requests.get(URL, headers=headers)

# Handle the response
if response.status_code == 200:
    data = response.json()
    print("Transcription Details:")
    print("Engine:", data["engine"])
    print("Status:", data["status"])
    print("Language Code:", data["language_code"])
    print("Created Date:", data["created_date"])
    print("Text:", data["text"])
else:
    print("Failed to retrieve transcription.")
    print("Status Code:", response.status_code)
    print("Response:", response.text)

Upload a transcription for a clip

POST https://api.soundmadeseen.com/public/v1/clips/clip_key/transcription/

This endpoint can be used to upload an SRT or VTT file which will be used as a transcription for the clip with the specified clip_key.

The body of this request should be set to multipart/form-data to enable file uploading.

This endpoint accepts the following path parameters:

  • clip_key - the key or identifier for this clip.

The body of the request must contain the following field:

  • file - the file to upload. This file must be in SRT or VTT format and can be a maximum of 250kb in size.

The body of the request may also contain the following field:

  • language_code - the language code of the transcription. This must be a language code as specified in our acceptable language codes list. Defaults to en (English)

If a transcription is already associated with this clip, it will be deleted and replaced with the uploaded transcription.

Response

If successful, a response will return an HTTP status code of 200, with a json response similar to the following:

{
  "engine": "API file upload",
  "status": "imported",
  "language_code": "en_au",
  "created_date": "2024-12-15T02:03:35.141011Z",
  "text": "This field contains the text of the transcription"
}

If a clip with the associated key can not be found, a response with an HTTP status code of 404 will be returned.

Other error responses will be in the 400 range and will have an output similar to the following:

{
  "success": "false",
  "error": "Invalid file type"
}

Read on for even more example code!

Code examples

import requests

# Replace these with your actual values
API_KEY = "MY_API_KEY"
CLIP_KEY = "<clip_key>"  # Replace with the actual clip key
FILE_PATH = "path/to/your/file.srt"  # Replace with the path to your SRT or VTT file
URL = f"https://api.soundmadeseen.com/public/v1/clips/{CLIP_KEY}/transcription/"

# Headers
headers = {
    "Authorization": f"Api-Key {API_KEY}"
}

# Prepare the file for upload
with open(FILE_PATH, "rb") as file:
    files = {
        "file": file
    }

    # Make the POST request
    response = requests.post(URL, headers=headers, files=files)

# Handle the response
if response.status_code == 200:
    data = response.json()
    print("Upload successful!")
    print("Engine:", data["engine"])
    print("Status:", data["status"])
    print("Language Code:", data["language_code"])
    print("Created Date:", data["created_date"])
    print("Text:", data["text"])
else:
    print("Failed to upload file.")
    print("Status Code:", response.status_code)
    print("Response:", response.text)

Send Feedback