Speaker Intelligence
Analyze conversations with enhanced speaker insights
1. Submit job
Endpoint
POSThttps://speakerscope.ai/api/intelligence
Fields
| Field | Type | Description |
|---|---|---|
audio_url | string | URL of the audio file |
num_speakers | int (optional) | Exact number of speakers |
min_speakers | int (optional) | Minimum number of speakers |
max_speakers | int (optional) | Maximum number of speakers |
speakers | dict[str, str] (optional) | Maps speaker names to a URL of a reference audio sample |
Example
import requests
response = requests.post(
"https://speakerscope.ai/api/intelligence",
auth=("<API_KEY>", "<API_SECRET>"),
json={
"audio_url": "<AUDIO_URL>",
# "num_speakers": <int>, # optional
# "min_speakers": <int>, # optional
# "max_speakers": <int>, # optional
# "speakers": <dict[str, str]>, # optional
},
)
print(response.json())Response
| Field | Type | Description |
|---|---|---|
job_id | str | Job identifier used to poll for the result |
{
"job_id": "cca90f61-c3f4-496b-a33c-6d77a4ce92bf"
}2. Get results
Endpoint
GEThttps://speakerscope.ai/api/intelligence/{job_id}
Example
import requests
response = requests.get(
"https://speakerscope.ai/api/intelligence/<JOB_ID>",
auth=("<API_KEY>", "<API_SECRET>"),
)
print(response.json())Response
| Field | Type | Description |
|---|---|---|
status | str | "pending", "completed", or "failed" |
progress | str (optional) | Progress description (when "pending") |
error | str (optional) | Error message (when "failed") |
segments | list[dict] | List of speaker segments in chronological order (when "completed") |
segments[].speaker | str | Speaker label (e.g. "SPEAKER_00", "SPEAKER_01") |
segments[].start | float | Segment start time in seconds |
segments[].end | float | Segment end time in seconds |
speakers | dict[str, dict] | Maps each speaker label to their identity, gender, and language predictions (when "completed") |
speakers.<speaker>.identity.prediction | str (optional) | Name of the enrolled speaker that best matches this speaker (when speakers is provided) |
speakers.<speaker>.identity.probabilities | dict[str, float] (optional) | Maps each enrolled speaker name to their confidence scores, sorted in descending order |
speakers.<speaker>.gender.prediction | str | Predicted gender ("male" or "female") |
speakers.<speaker>.gender.probabilities | dict[str, float] | Maps gender labels to their confidence scores, sorted in descending order |
speakers.<speaker>.language.prediction | str | Predicted ISO 639-1 language code |
speakers.<speaker>.language.probabilities | dict[str, float] | Maps language codes to their confidence scores, sorted in descending order |
stats | dict | Aggregated statistics computed across the whole conversation (when "completed") |
stats.speech_ratio | float | Proportion of the audio containing speech |
stats.non_speech_ratio | float | Proportion of the audio containing no speech |
stats.speaker_ratio | dict[str, float] | Proportion of speech time attributed to each speaker |
stats.gender_ratio | dict[str, float] | Proportion of speech time attributed to each predicted gender |
stats.language_ratio | dict[str, float] | Proportion of speech time attributed to each predicted language |
Pending
{
"status": "pending",
"progress": "Predicting..."
}Completed
{
"status": "completed",
"segments": [
{ "speaker": "SPEAKER_00", "start": 0.0, "end": 5.2 },
{ "speaker": "SPEAKER_01", "start": 5.4, "end": 12.8 },
{ "speaker": "SPEAKER_00", "start": 13.1, "end": 19.7 },
{ "speaker": "SPEAKER_01", "start": 20.0, "end": 28.3 },
...
],
"speakers": {
"SPEAKER_00": {
"identity": {
"prediction": "Bob",
"probabilities": { "Bob": 0.93, "Alice": 0.07 }
},
"gender": {
"prediction": "male",
"probabilities": { "male": 0.97, "female": 0.03 }
},
"language": {
"prediction": "en",
"probabilities": { "en": 0.91, "fr": 0.05, "de": 0.02, ... }
}
},
"SPEAKER_01": {
"identity": {
"prediction": "Alice",
"probabilities": { "Alice": 0.89, "Bob": 0.11 }
},
"gender": {
"prediction": "female",
"probabilities": { "female": 0.98, "male": 0.02 }
},
"language": {
"prediction": "fr",
"probabilities": { "fr": 0.20, "en": 0.16, "de": 0.07, ... }
}
}
},
"stats": {
"speech_ratio": 0.71,
"non_speech_ratio": 0.29,
"speaker_ratio": { "SPEAKER_00": 0.77, "SPEAKER_01": 0.23 },
"gender_ratio": { "male": 0.77, "female": 0.23 },
"language_ratio": { "en": 0.77, "fr": 0.23 }
}
}