Authentication
To use the Transcription API, you'll need to authenticate your requests using an API key. Include your API key in the headers of all requests.
Authentication Example
curl -X POST https://api.transcription.com/v1/transcribe \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"audio_url": "https://example.com/audio.mp3"}'
Raw Audio Transcription
Convert raw audio files into text using our high-accuracy transcription engine. Supports multiple audio formats including MP3, WAV, M4A, and FLAC.
Request
Node.js Example
const response = await fetch('https://api.transcription.com/v1/transcribe', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
audio_url: 'https://example.com/audio.mp3',
language: 'en-US',
speaker_detection: true,
timestamps: true
})
});
const data = await response.json();
Response
Response Example
{
"id": "tr_123abc",
"status": "completed",
"text": "Welcome to our podcast...",
"speakers": [
{
"speaker": "Speaker 1",
"text": "Welcome to our podcast",
"timestamp": "00:00:00"
}
],
"confidence": 0.98,
"duration": 126.5
}
Streaming Audio
Get real-time transcription results by streaming audio directly to our API. Perfect for live events and real-time applications.
WebSocket Example
const ws = new WebSocket('wss://api.transcription.com/v1/stream');
ws.onopen = () => {
ws.send(JSON.stringify({
type: 'auth',
api_key: 'YOUR_API_KEY'
}));
};
ws.onmessage = (event) => {
const transcription = JSON.parse(event.data);
console.log(transcription.text);
};
// Send audio chunks
audioStream.on('data', (chunk) => {
ws.send(chunk);
});