Ingestion API client
This client is new in v4 of the Python API clients.
The Ingestion API client is part of the algoliasearch
package.
You can install this package with pip
:
1
pip install 'algoliasearch>=4,<5'
To use the Ingestion client, add this import to your files:
1
from algoliasearch.ingestion.client import IngestionClientSync
To create an instance of the client:
1
2
3
4
# In an asynchronous context, you can use IngestionClient instead, which exposes the exact same methods.
client = IngestionClientSync(
"ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
)
Replace ALGOLIA_APPLICATION_ID_REGION
with your Algolia application’s analytics region: us
for the United States or eu
for Europe.
You can check your analytics region in the Infrastructure > Analytics section of the Algolia dashboard.
Async code
To use the Ingestion client in async environments, add these imports instead:
1
2
import asyncio
from algoliasearch.ingestion.client import IngestionClient
The client supports the async with
statement to automatically close open connections.
1
2
3
async def run():
async with IngestionClient(ALGOLIA_APPLICATION_ID, ALGOLIA_API_KEY) as client:
# client.search(...)
The method names are the same for synchronous and asynchronous methods.
List of methods
Each method makes one request to the Ingestion API.
Authentications
client.list_authentications | List authentication resources |
client.create_authentication | Create an authentication resource |
client.search_authentications | Search for authentication resources |
client.get_authentication | Retrieve an authentication resource |
client.update_authentication | Update an authentication resource |
client.delete_authentication | Delete an authentication resource |
Destinations
client.list_destinations | List destinations |
client.create_destination | Create a destination |
client.search_destinations | Search for destinations |
client.get_destination | Retrieve a destination |
client.update_destination | Update a destination |
client.delete_destination | Delete a destination |
Sources
client.list_sources | List sources |
client.create_source | Create a source |
client.validate_source | Validates a source payload |
client.search_sources | Search for sources |
client.get_source | Retrieve a source |
client.update_source | Update a source |
client.delete_source | Delete a source |
client.validate_source_before_update | Validates an update of a source payload |
client.trigger_docker_source_discover | Trigger a stream-listing request |
client.run_source | Run all tasks linked to a source |
Tasks
client.list_tasks_v1 | List tasks |
client.create_task_v1 | Create a task |
client.search_tasks_v1 | Search for tasks |
client.get_task_v1 | Retrieve a task |
client.update_task_v1 | Update a task |
client.delete_task_v1 | Delete a task |
client.run_task_v1 | Run a task |
client.enable_task_v1 | Enable a task |
client.disable_task_v1 | Disable a task |
client.list_tasks | List tasks |
client.create_task | Create a task |
client.search_tasks | Search for tasks |
client.get_task | Retrieve a task |
client.update_task | Update a task |
client.delete_task | Delete a task |
client.run_task | Run a task |
client.push_task | Push a `batch` request payload through the Pipeline |
client.enable_task | Enable a task |
client.disable_task | Disable a task |
Transformations
client.list_transformations | List transformations |
client.create_transformation | Create a transformation |
client.try_transformation | Try a transformation |
client.search_transformations | Search for transformations |
client.get_transformation | Retrieve a transformation |
client.update_transformation | Update a transformation |
client.delete_transformation | Delete a transformation |
client.try_transformation_before_update | Try a transformation |
Observability
client.list_runs | List task runs |
client.get_run | Retrieve a task run |
client.list_events | List task run events |
client.get_event | Retrieve a task run event |