If your video is less than 32MB, you can directly use /transcribe.
For larger videos, use /upload-url, then /transcribe.
Obtain your API key from your dashboard.
Transcribes a video from an uploaded file or from a file uploaded via /upload-url.
Method: POST
URL: https://api.symphoniclabs.com/transcribe
video: The video file to be transcribed. (Optional if filename is provided)filename: The name of the file uploaded via /upload-url. (Optional if video is provided)tier: The transcription tier. Options are regular, and fast. Defaults to regular.api_key: Your API key for authentication.segment_time: Segment time (int) for transcriptions, defaults to 20. Recommended range: 5-20.Returns a JSON object containing:
transcription: The transcribed text from your video.cost: The cost of the transcription in USD.remaining: Your remaining credits in USD.import requests
with open('video.mp4', 'rb') as f:
files = {
'video': ('video.mp4', f),
'api_key': (None, 'YOUR_API_KEY'),
'segment_time': (None, '20'),
}
response = requests.post('https://api.symphoniclabs.com/transcribe', files=files)
print(response.json())curl -X POST https://api.symphoniclabs.com/transcribe \
-F "video=@video.mp4" \
-F "api_key=YOUR_API_KEY" \
-F "segment_time=5"Generates a signed URL to upload a video file directly to our Google Cloud Storage bucket. Use this for videos larger than 32MB.
Method: GET
URL: https://api.symphoniclabs.com/upload-url
Returns a JSON object containing:
url: The signed URL to upload your video file using an HTTP PUT request.filename: A unique filename assigned to your uploaded video.import requests
response = requests.get('https://api.symphoniclabs.com/upload-url')
data = response.json()
url, filename = data['url'], data['filename']
with open('video.mp4', 'rb') as f:
requests.put(url, data=f, headers={'Content-Type': 'application/octet-stream'})
files = {
'filename': (None, filename),
'api_key': (None, 'YOUR_API_KEY'),
'segment_time': (None, '10'),
}
response = requests.post('https://api.symphoniclabs.com/transcribe', files=files)
print(response.json())response=$(curl -s https://api.symphoniclabs.com/upload-url)
url=$(echo $response | jq -r '.url')
filename=$(echo $response | jq -r '.filename')
curl -X PUT "$url" \
-H "Content-Type: application/octet-stream" \
--data-binary @video.mp4
curl -X POST https://api.symphoniclabs.com/transcribe \
-F "filename=$filename" \
-F "api_key=YOUR_API_KEY" \
-F "segment_time=10"The example uses jq to parse JSON responses. Ensure jq is installed on your system.
On macOS (using Homebrew):
brew install jqOn Debian/Ubuntu-based Linux systems:
sudo apt-get update
sudo apt-get install jq