Retrieves the transcript of a meeting after the bot has finished recording. The transcript includes timestamped text with speaker identification.
Method Signature
bot.getTranscript(params: GetTranscriptParams): Promise<Transcript>
Parameters
The unique identifier of the bot
Whether to use enhanced speaker identification. Default is false.
Response
Returns a transcript object with an array of transcript entries:
Array of transcript word objectsThe transcribed word or phrase
Start timestamp in seconds from the beginning of the recording
End timestamp in seconds from the beginning of the recording
Identifier for the speaker (e.g., “Speaker 1”, “Speaker 2”)
Confidence score for the transcription (0-1)
Example
import { Recall } from '@recall.ai/sdk';
const client = new Recall({
apiKey: 'your-api-key',
region: 'us-west-2'
});
// Get transcript
const transcript = await client.bot.getTranscript({
id: 'bot_1234567890'
});
console.log(`Transcript contains ${transcript.words.length} words`);
// Print transcript
for (const word of transcript.words) {
console.log(`[${word.start_time}s] ${word.speaker}: ${word.text}`);
}
Example: With Enhanced Diarization
const transcript = await client.bot.getTranscript({
id: 'bot_1234567890',
enhanced_diarization: true
});
console.log('Transcript with enhanced speaker identification:');
for (const word of transcript.words) {
console.log(`${word.speaker}: ${word.text}`);
}
async function formatTranscript(botId: string): Promise<string> {
const transcript = await client.bot.getTranscript({ id: botId });
let formatted = '';
let currentSpeaker = '';
let currentText = '';
for (const word of transcript.words) {
if (word.speaker !== currentSpeaker) {
if (currentText) {
formatted += `${currentSpeaker}: ${currentText.trim()}\n\n`;
}
currentSpeaker = word.speaker;
currentText = word.text;
} else {
currentText += ' ' + word.text;
}
}
// Add final speaker's text
if (currentText) {
formatted += `${currentSpeaker}: ${currentText.trim()}\n`;
}
return formatted;
}
const formattedTranscript = await formatTranscript('bot_1234567890');
console.log(formattedTranscript);
Example: Search Transcript
async function searchTranscript(botId: string, searchTerm: string) {
const transcript = await client.bot.getTranscript({ id: botId });
const matches = transcript.words.filter(word =>
word.text.toLowerCase().includes(searchTerm.toLowerCase())
);
console.log(`Found ${matches.length} occurrences of "${searchTerm}"`);
for (const match of matches) {
console.log(`[${match.start_time}s] ${match.speaker}: ${match.text}`);
}
return matches;
}
await searchTranscript('bot_1234567890', 'action items');
Example: Get Speaker Statistics
async function getSpeakerStats(botId: string) {
const transcript = await client.bot.getTranscript({ id: botId });
const stats: Record<string, { wordCount: number, duration: number }> = {};
for (const word of transcript.words) {
if (!stats[word.speaker]) {
stats[word.speaker] = { wordCount: 0, duration: 0 };
}
stats[word.speaker].wordCount++;
stats[word.speaker].duration += (word.end_time - word.start_time);
}
console.log('Speaker Statistics:');
for (const [speaker, data] of Object.entries(stats)) {
console.log(`${speaker}: ${data.wordCount} words, ${data.duration.toFixed(1)}s speaking time`);
}
return stats;
}
await getSpeakerStats('bot_1234567890');
Notes
- Transcripts are available after the bot status reaches
done
- Enhanced diarization provides better speaker identification but may take longer to process
- The transcript is generated based on the
transcription_options specified when creating the bot
- Confidence scores indicate the reliability of each transcribed word