Implementation:Elevenlabs Elevenlabs python VoicesClient Search
| Knowledge Sources | |
|---|---|
| Domains | Speech_Synthesis, Voice_Management |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete tool for searching and filtering available voices with pagination provided by the elevenlabs-python SDK.
Description
The VoicesClient.search method queries the ElevenLabs v2 voices endpoint to retrieve voices matching specified criteria. It supports full-text search across name, description, and labels, filtering by voice type and category, sorting by creation date or name, and paginated results. This is the recommended method for voice discovery (over get_all which returns the legacy v1 response).
Usage
Use this method when you need to find a specific voice by name or characteristics, list all voices of a particular type, implement voice selection UI with pagination, or fetch specific voices by their IDs.
Code Reference
Source Location
- Repository: elevenlabs-python
- File: src/elevenlabs/voices/client.py
- Lines: L83-98
Signature
def search(
self,
*,
next_page_token: typing.Optional[str] = None,
page_size: typing.Optional[int] = None,
search: typing.Optional[str] = None,
sort: typing.Optional[str] = None,
sort_direction: typing.Optional[str] = None,
voice_type: typing.Optional[str] = None,
category: typing.Optional[str] = None,
fine_tuning_state: typing.Optional[str] = None,
collection_id: typing.Optional[str] = None,
include_total_count: typing.Optional[bool] = None,
voice_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetVoicesV2Response:
"""
Gets a list of all available voices for a user with search,
filtering and pagination.
"""
Import
from elevenlabs import ElevenLabs
client = ElevenLabs()
# Access via: client.voices.search(...)
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| search | Optional[str] | No | Full-text search across name, description, labels |
| voice_type | Optional[str] | No | Filter: 'personal', 'community', 'default', 'workspace', 'non-default', 'saved' |
| category | Optional[str] | No | Filter by voice category |
| page_size | Optional[int] | No | Max results per page (up to 100, default 10) |
| next_page_token | Optional[str] | No | Pagination token from previous response |
| sort | Optional[str] | No | Sort field: 'created_at_unix' or 'name' |
| sort_direction | Optional[str] | No | 'asc' or 'desc' |
| voice_ids | Optional[Union[str, Sequence[str]]] | No | Fetch specific voice IDs |
| fine_tuning_state | Optional[str] | No | Filter by fine-tuning state |
| collection_id | Optional[str] | No | Filter by collection |
| include_total_count | Optional[bool] | No | Include total count in response |
Outputs
| Name | Type | Description |
|---|---|---|
| (return) | GetVoicesV2Response | Contains list of Voice objects with voice_id, name, labels, settings, plus pagination info (has_more, next_page_token) |
Usage Examples
Search by Name
from elevenlabs import ElevenLabs
client = ElevenLabs()
# Search for voices matching "Rachel"
response = client.voices.search(search="Rachel")
for voice in response.voices:
print(f"{voice.name}: {voice.voice_id}")
Filter by Type with Pagination
from elevenlabs import ElevenLabs
client = ElevenLabs()
# Get personal voices, 20 per page
response = client.voices.search(
voice_type="personal",
page_size=20,
sort="created_at_unix",
sort_direction="desc",
)
# Paginate
while response.has_more:
response = client.voices.search(
voice_type="personal",
page_size=20,
next_page_token=response.next_page_token,
)
Fetch Specific Voice IDs
from elevenlabs import ElevenLabs
client = ElevenLabs()
# Fetch specific voices by ID
response = client.voices.search(
voice_ids=["JBFqnCBsd6RMkjVDRZzb", "21m00Tcm4TlvDq8ikWAM"]
)