Dokumentation

Video Endpoints

Create a Video

POST https://api.soundmadeseen.com/public/v1/video/generate/

This endpoint allows for the generation of videos, utilising a clip, and a static design.

The body of the request must contain the following fields:

  • clip - the clip that will provide the audio for the generated video.
  • design - the static design which will provide the general look of the video.
  • name - the name of the video

The body may also contain the following optional field:

  • template_variables - this is a JSON array of dict objects with name and value parameters that can be used to populate template variables with a matching name in a design. The field should have a format similar to the following:
[
    {"name": "first_name", "value": "Rane" },
    {"name": "business_name", "value": "SoundMadeSeen Industries"},
    {"name": "heading_text", "value": "The Greatest Video ever"}
]

Responses

A successful response will return an HTTP response with status code 201 and will contain content similar to the following:

{
    "success": true,
    "video_key": "MXapJbuWejpMdZg3ZGQv2R"
}

The value of video_key can then be used to check the status of the video using the Check Video Status endpoint documented later on this page.

If a clip or design can not be found, a response with HTTP status code 404 will be returned with content similar to the following:

{
    "success": false,
    "error": "Custom design not found"
}

Other errors will be returned with an HTTP status code in the 400 range, and a response similar to the following:

{
    "success": false,
    "error": "Name is required"
}

Read on for some simple code examples:

Codebeispiele

import requests

# Replace these with your actual values
API_KEY = "MY_API_KEY"
URL = "https://api.soundmadeseen.com/public/v1/video/generate/"

# Form data
data = {
    "name": "API created video",
    "clip": "k9PAd4Bq9KL8jz92gPG2ET",
    "design": "YVXKxzPE9W39DcLgiNkaLA",
    "template_variables": '[{"name": "first_name", "value": "Rane"}, {"name": "business_name", "value": "SoundMadeSeen Industries"}, {"name": "heading_text", "value": "The Greatest Video ever"}]'
}

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

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

# Handle the response
if response.status_code == 200:
    data = response.json()
    if data.get("success"):
        print("Video generation initiated successfully!")
        print(f"Video Key: {data['video_key']}")
    else:
        print("Video generation failed. Response:", data)
else:
    print("Failed to generate video.")
    print(f"Status Code: {response.status_code}")
    print("Response:", response.text)

List Videos

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

This endpoint provides a list of completed videos 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', 'updated', 'name' or 'duration'. Defaults to 'created'
  • 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": "MXapJbuWejpMdZg3ZGQv2R",
      "duration": 66.208333,
      "created": "2025-01-24T22:39:12.543908Z",
      "name": "An amazing new video",
      "video_size": {
        "name": "Story",
        "width": 1080,
        "height": 1920
      }
    },
    {
      "key": "SGC9ZMnVaMb8YfbPJ7xjrc",
      "duration": 27.583333,
      "created": "2025-01-20T22:26:47.471287Z",
      "name": "My amazing video in square format",
      "video_size": {
        "name": "Square",
        "width": 1080,
        "height": 1080
      }
    }]
}

Here are some code examples:

Codebeispiele

import requests

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

# 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(f"Total Videos: {data['count']}")
    print(f"Current Page: {data['current']}")
    print(f"Total Pages: {data['total_pages']}")
    print("Videos:")
    for video in data["results"]:
        print(f"- Key: {video['key']}")
        print(f"  Name: {video['name']}")
        print(f"  Duration: {video['duration']} seconds")
        print(f"  Created: {video['created']}")
        print(f"  Video Size: {video['video_size']['name']} ({video['video_size']['width']}x{video['video_size']['height']})")
        print("")
else:
    print("Failed to retrieve videos.")
    print(f"Status Code: {response.status_code}")
    print(f"Response: {response.text}")

Video status

GET https://api.soundmadeseen.com/public/v1/video/video_key/status/

This endpoint can be used to check the status of a video.

This endpoint contains the following path parameters:

  • video_key - the key, or identifier of the video.

Responses

A successful response will have an HTTP status code of 200 and contain a JSON object similar to the following:

{
  "key": "MXapJbuWejpMdZg3ZGQv2R",
  "status": "completed",
  "duration": 66.208333,
  "created": "2025-01-24T22:39:12.543908Z",
  "updated": "2025-01-24T22:40:58.408499Z"
}

The status field will contain the value pending, processing, completed or error.

If a video belonging to the current team cannot be found, this endpoint will return a response with an HTTP code of 404.

Codebeispiele

import requests

# Replace with your actual API key and video key
API_KEY = "MY_API_KEY"
VIDEO_KEY = "<video_key>"  # Replace with the actual video key
URL = f"https://api.soundmadeseen.com/public/v1/video/{VIDEO_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("Video Status:")
    print(f"  Key: {data['key']}")
    print(f"  Status: {data['status']}")
    print(f"  Duration: {data['duration']} seconds")
    print(f"  Created: {data['created']}")
    print(f"  Updated: {data['updated']}")
else:
    print("Failed to retrieve video status.")
    print(f"Status Code: {response.status_code}")
    print("Response:", response.text)

Video detail

GET https://api.soundmadeseen.com/public/v1/video/video_key/

This endpoint displays the same information as the Video status endpoint, but in addition contains a download_url field, which contains a url that can be used to generate the video with the specified key.

This endpoint contains the following path parameters:

  • video_key - the key, or identifier of the video.

Responses

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

{
  "key": "MXapJbuWejpMdZg3ZGQv2R",
  "duration": 66.208333,
  "created": "2025-01-24T22:39:12.543908Z",
  "status": "completed",
  "error_message": null,
  "download_url": "https://signed-url-that-can-be-used-to-download-video"
}

The status field will contain the value pending, processing, completed or error.

If the status field has a value of completed, the download_url will contain a signed url that can be used to download the generated video. This url will expire 24 hours after it is generated.

If a video belonging to the current team cannot be found, this endpoint will return a response with an HTTP code of 404.

Codebeispiele

import requests

# Replace with your actual API key and video key
API_KEY = "MY_API_KEY"
VIDEO_KEY = "<video_key>"  # Replace with the actual video key
URL = f"https://api.soundmadeseen.com/public/v1/video/{VIDEO_KEY}/"

# 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("Video Status:")
    print(f"  Key: {data['key']}")
    print(f"  Status: {data['status']}")
    print(f"  Duration: {data['duration']} seconds")
    print(f"  Created: {data['created']}")
    print(f"  Updated: {data['updated']}")
    print(f"  Download URL: {data['download_url']}")
else:
    print("Failed to retrieve video status.")
    print(f"Status Code: {response.status_code}")
    print("Response:", response.text)

Feedback senden