Skip to content
Notifications
Clear all

Guide: Using Descript's API to automatically transcribe customer support calls.

1 Posts
1 Users
0 Reactions
1 Views
(@data_diver_43)
Reputable Member
Joined: 2 months ago
Posts: 119
Topic starter   [#14697]

Hey everyone! I've been experimenting with Descript's API to streamline a task at my internship: analyzing customer support calls for recurring themes. The manual upload-and-transcribe process was getting tedious, so I automated it. Here's a breakdown of my workflow, in case it helps others.

My goal was to get MP3 recordings from our call system (via a shared drive) transcribed automatically, with the results dumped into a Google Sheet for the team. Descript's API is pretty straightforward for this. The core steps are:

1. **Upload the media file** to get a `media_id`.
2. **Start a transcription job** using that `media_id`.
3. **Poll for completion** (it takes a few minutes).
4. **Fetch the transcript text** and push it to my destination.

Here's the key Python snippet for the transcription part:

```python
import requests
import time

api_key = "YOUR_DESCRIPT_API_KEY"
headers = {"Authorization": f"Bearer {api_key}"}

# 1. Upload
upload_url = "https://api.descript.com/v1/media/upload"
upload_response = requests.post(upload_url, headers=headers)
upload_data = upload_response.json()
media_id = upload_data['id']

# (You'd then PUT the actual file binary to the signed URL in upload_data['signed_url'])

# 2. Create transcript
transcript_url = "https://api.descript.com/v1/transcripts"
payload = {
"media_id": media_id,
"language": "en"
}
transcript_response = requests.post(transcript_url, json=payload, headers=headers)
transcript_id = transcript_response.json()['id']

# 3. Poll for result
status_url = f"https://api.descript.com/v1/transcripts/{transcript_id}"
while True:
status_resp = requests.get(status_url, headers=headers)
status = status_resp.json()['status']
if status == 'completed':
break
time.sleep(10)

# 4. Fetch text
text_url = f"https://api.descript.com/v1/transcripts/{transcript_id}/text"
text_response = requests.get(text_url, headers=headers)
transcript_text = text_response.json()['text']
```

The main hiccup I ran into was handling the file upload correctly—the API gives you a pre-signed URL for an S3-style PUT request, which tripped me up at first. Also, the polling loop is essential; there's no webhook option on the basic plan, I believe.

From here, I use `gspread` to append `transcript_text` along with the filename and date to a Sheet. This setup has cut out hours of manual work each week. I'm curious if anyone else has built similar pipelines? Specifically, I'm wondering about error handling for very poor audio quality calls—does the API just return low-confidence text, or does it fail? My tests have been okay so far, but our call quality varies a lot.



   
Quote