Skip to content

Feedback: api-reference-transcripts-word-search

Original URL: https://www.assemblyai.com/docs/api-reference/transcripts/word-search
Category: api-reference
Generated: 05/08/2025, 4:30:25 pm


Generated: 05/08/2025, 4:30:24 pm

Technical Documentation Analysis: AssemblyAI Word Search API

Section titled “Technical Documentation Analysis: AssemblyAI Word Search API”

This documentation has significant gaps that would frustrate developers trying to implement the word search functionality. While it covers the basic API structure, it lacks essential details about responses, authentication, and practical usage examples.

Problem: No response body schema or example provided. Impact: Developers don’t know what data they’ll receive or how to parse it.

Fix:

// Add example response
{
"id": "5551722-f677-48a6-9287-39d0ebb73c12",
"total_count": 3,
"matches": [
{
"text": "artificial intelligence",
"count": 2,
"timestamps": [
{
"start": 1500,
"end": 2100,
"confidence": 0.95
},
{
"start": 15300,
"end": 15900,
"confidence": 0.92
}
]
}
]
}

Current: Basic parameter names only Needed: Data types, formats, constraints, and examples

Improved Parameter Documentation:

Path Parameters:
- transcript_id (string, required): UUID of the completed transcript
Example: "5551722-f677-48a6-9287-39d0ebb73c12"
Query Parameters:
- words (string, required): Search terms separated by commas for multiple keywords
- Max 5 words per phrase
- Case-insensitive matching
- Supports partial word matching
Examples:
- Single word: "innovation"
- Multiple words: "artificial intelligence,machine learning"
- Phrase: "New York City"

Problems:

  • Repetitive examples with placeholder values
  • Inconsistent URL formatting (transcript_id vs :transcript_id)
  • Generic “string” values provide no guidance

Better Examples:

Terminal window
# Search for a single word
curl -G https://api.assemblyai.com/v2/transcript/5551722-f677-48a6-9287-39d0ebb73c12/word-search \
-H "Authorization: Bearer YOUR_API_KEY" \
-d words="innovation"
# Search for multiple keywords
curl -G https://api.assemblyai.com/v2/transcript/5551722-f677-48a6-9287-39d0ebb73c12/word-search \
-H "Authorization: Bearer YOUR_API_KEY" \
-d words="artificial intelligence,machine learning,AI"
# Search for a phrase
curl -G https://api.assemblyai.com/v2/transcript/5551722-f677-48a6-9287-39d0ebb73c12/word-search \
-H "Authorization: Bearer YOUR_API_KEY" \
-d words="New York City"
## Prerequisites
- Completed transcript (status: "completed")
- Valid API key with transcript access permissions
- Transcript must have word-level timestamps enabled

Current: Basic HTTP status codes Improved: Detailed error scenarios with solutions

## Error Responses
### 400 Bad Request
- Invalid transcript_id format
- Empty or malformed search terms
- Search phrase exceeds 5 words
### 404 Not Found
- Transcript doesn't exist
- Transcript belongs to different account
### 422 Unprocessable Entity
- Transcript processing incomplete
- Transcript failed processing
## Usage Guidelines
### Search Limitations
- Maximum 5 words per search phrase
- Case-insensitive matching
- Punctuation is ignored during matching
- Rate limit: 100 requests per minute
### Best Practices
- Use specific terms for better accuracy
- Search for phrases rather than single common words
- Consider transcript accuracy when interpreting results
### Performance Notes
- Response time scales with transcript length
- Cache results for repeated searches
- Use batch searches for multiple terms
## Language Support
Word search supports all languages available in AssemblyAI transcription. Search terms should match the transcript's language for optimal results.
# Python SDK example
import assemblyai as aai
client = aai.TranscriptApi(api_key="YOUR_API_KEY")
search_results = client.word_search(
transcript_id="5551722-f677-48a6-9287-39d0ebb73c12",
words=["innovation", "technology"]
)
## Troubleshooting
**No results found**: Verify spelling, try variations, or check if word exists in original transcript
**Timeout errors**: Large transcripts may take longer; implement retry logic
**Rate limiting**: Implement exponential backoff for high-volume usage
  1. High Priority: Add response schema and examples
  2. High Priority: Improve parameter documentation with constraints
  3. Medium Priority: Replace repetitive examples with meaningful ones
  4. Medium Priority: Add error handling details
  5. Low Priority: Include SDK examples and troubleshooting

These improvements would transform this documentation from a basic API reference into a comprehensive guide that enables developers to successfully implement word search functionality.