Use this endpoint to get the full transcript for a specified ambient session after it has completed.
Updated:The response will now include the new lang_id field within the payload. The lang_id field indicates the language in which the transcript was sent.
For a full list of language codes and their corresponding languages, refer to the Language Mapping section.
Code Examples
import requests
ambient_session_id = "123dfg-456dfg-789dfg-012dfg"
url = f"https://sdp.suki.ai/api/v1/ambient/session/{ambient_session_id}/transcript"
headers = {
"sdp_suki_token": "<sdp_suki_token>"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
transcript_data = response.json()
print("Transcript:")
for transcript in transcript_data.get("final_transcript", []):
print(f"Transcript ID: {transcript.get('transcript_id')}")
print(f"Recording ID: {transcript.get('recording_id')}")
print(f"Language: {transcript.get('lang_id')}")
print(f"Transcript: {transcript.get('transcript')}")
print(f"Start Time: {transcript.get('start_time')}")
print(f"End Time: {transcript.get('end_time')}")
# Start offset (relative to beginning of audio)
start_offset = transcript.get('start_offset', {})
if start_offset:
print(f"Start Offset: {start_offset.get('hours')}h {start_offset.get('minutes')}m {start_offset.get('seconds')}s")
# End offset (relative to beginning of audio)
end_offset = transcript.get('end_offset', {})
if end_offset:
print(f"End Offset: {end_offset.get('hours')}h {end_offset.get('minutes')}m {end_offset.get('seconds')}s")
print("---")
else:
print(f"Failed to get transcript: {response.status_code}")
print(response.json())