curl
curl --request GET \
--url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/related-products/task/1514562690001 \
--header 'accept: application/json' \
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID'// Initialize the client
var client = new RecommendClient(
new RecommendConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);
// Call the API
var response = await client.GetRecommendStatusAsync(
"<YOUR_INDEX_NAME>",
Enum.Parse<RecommendModels>("RelatedProducts"),
12345L
);
// print the response
Console.WriteLine(response);// Initialize the client
final client = RecommendClient(
appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY');
// Call the API
final response = await client.getRecommendStatus(
indexName: "<YOUR_INDEX_NAME>",
model: RecommendModels.fromJson("related-products"),
taskID: 12345,
);
// print the response
print(response);// Initialize the client
client, err := recommend.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
if err != nil {
// The client can fail to initialize if you pass an invalid parameter.
panic(err)
}
// Call the API
response, err := client.GetRecommendStatus(client.NewApiGetRecommendStatusRequest(
"<YOUR_INDEX_NAME>", recommend.RecommendModels("related-products"), 12345))
if err != nil {
// handle the eventual error
panic(err)
}
// print the response
print(response)// Initialize the client
RecommendClient client = new RecommendClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
// Call the API
GetRecommendTaskResponse response = client.getRecommendStatus("<YOUR_INDEX_NAME>", RecommendModels.RELATED_PRODUCTS, 12345L);
// print the response
System.out.println(response);// Initialize the client
const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY').initRecommend();
// Call the API
const response = await client.getRecommendStatus({
indexName: 'indexName',
model: 'related-products',
taskID: 12345,
});
// print the response
console.log(response);// Initialize the client
val client = RecommendClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY")
// Call the API
var response =
client.getRecommendStatus(
indexName = "<YOUR_INDEX_NAME>",
model = RecommendModels.entries.first { it.value == "related-products" },
taskID = 12345L,
)
// print the response
println(response)// Initialize the client
$client = RecommendClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');
// Call the API
$response = $client->getRecommendStatus(
'<YOUR_INDEX_NAME>',
'related-products',
12345,
);
// print the response
var_dump($response);# Initialize the client
# In an asynchronous context, you can use RecommendClient instead, which exposes the exact same methods.
client = RecommendClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
# Call the API
response = client.get_recommend_status(
index_name="<YOUR_INDEX_NAME>",
model="related-products",
task_id=12345,
)
# print the response
print(response)# Initialize the client
client = Algolia::RecommendClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
# Call the API
response = client.get_recommend_status("<YOUR_INDEX_NAME>", "related-products", 12345)
# print the response
puts(response)// Initialize the client
val client = RecommendClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY")
// Call the API
val response = Await.result(
client.getRecommendStatus(
indexName = "<YOUR_INDEX_NAME>",
model = RecommendModels.withName("related-products"),
taskID = 12345L
),
Duration(100, "sec")
)
// print the response
println(response)// Initialize the client
let client = try RecommendClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY")
// Call the API
let response = try await client.getRecommendStatus(
indexName: "<YOUR_INDEX_NAME>",
model: RecommendModels.relatedProducts,
taskID: Int64(12345)
)
// print the response
print(response){
"status": "published"
}{
"message": "Invalid Application-Id or API-Key"
}{
"message": "Invalid Application-Id or API-Key"
}{
"message": "Invalid Application-Id or API-Key"
}{
"message": "Invalid Application-Id or API-Key"
}Recommend API
Check task status
Checks the status of a given task.
GET
/
1
/
indexes
/
{indexName}
/
{model}
/
task
/
{taskID}
curl
curl --request GET \
--url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/related-products/task/1514562690001 \
--header 'accept: application/json' \
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID'// Initialize the client
var client = new RecommendClient(
new RecommendConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);
// Call the API
var response = await client.GetRecommendStatusAsync(
"<YOUR_INDEX_NAME>",
Enum.Parse<RecommendModels>("RelatedProducts"),
12345L
);
// print the response
Console.WriteLine(response);// Initialize the client
final client = RecommendClient(
appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY');
// Call the API
final response = await client.getRecommendStatus(
indexName: "<YOUR_INDEX_NAME>",
model: RecommendModels.fromJson("related-products"),
taskID: 12345,
);
// print the response
print(response);// Initialize the client
client, err := recommend.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
if err != nil {
// The client can fail to initialize if you pass an invalid parameter.
panic(err)
}
// Call the API
response, err := client.GetRecommendStatus(client.NewApiGetRecommendStatusRequest(
"<YOUR_INDEX_NAME>", recommend.RecommendModels("related-products"), 12345))
if err != nil {
// handle the eventual error
panic(err)
}
// print the response
print(response)// Initialize the client
RecommendClient client = new RecommendClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
// Call the API
GetRecommendTaskResponse response = client.getRecommendStatus("<YOUR_INDEX_NAME>", RecommendModels.RELATED_PRODUCTS, 12345L);
// print the response
System.out.println(response);// Initialize the client
const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY').initRecommend();
// Call the API
const response = await client.getRecommendStatus({
indexName: 'indexName',
model: 'related-products',
taskID: 12345,
});
// print the response
console.log(response);// Initialize the client
val client = RecommendClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY")
// Call the API
var response =
client.getRecommendStatus(
indexName = "<YOUR_INDEX_NAME>",
model = RecommendModels.entries.first { it.value == "related-products" },
taskID = 12345L,
)
// print the response
println(response)// Initialize the client
$client = RecommendClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');
// Call the API
$response = $client->getRecommendStatus(
'<YOUR_INDEX_NAME>',
'related-products',
12345,
);
// print the response
var_dump($response);# Initialize the client
# In an asynchronous context, you can use RecommendClient instead, which exposes the exact same methods.
client = RecommendClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
# Call the API
response = client.get_recommend_status(
index_name="<YOUR_INDEX_NAME>",
model="related-products",
task_id=12345,
)
# print the response
print(response)# Initialize the client
client = Algolia::RecommendClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
# Call the API
response = client.get_recommend_status("<YOUR_INDEX_NAME>", "related-products", 12345)
# print the response
puts(response)// Initialize the client
val client = RecommendClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY")
// Call the API
val response = Await.result(
client.getRecommendStatus(
indexName = "<YOUR_INDEX_NAME>",
model = RecommendModels.withName("related-products"),
taskID = 12345L
),
Duration(100, "sec")
)
// print the response
println(response)// Initialize the client
let client = try RecommendClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY")
// Call the API
let response = try await client.getRecommendStatus(
indexName: "<YOUR_INDEX_NAME>",
model: RecommendModels.relatedProducts,
taskID: Int64(12345)
)
// print the response
print(response){
"status": "published"
}{
"message": "Invalid Application-Id or API-Key"
}{
"message": "Invalid Application-Id or API-Key"
}{
"message": "Invalid Application-Id or API-Key"
}{
"message": "Invalid Application-Id or API-Key"
}Deleting a Recommend rule is asynchronous.
When you delete a rule, a task is created on a queue and completed depending on the load on the server.
The API response includes a task ID that you can use to check the status.
Required ACL:
editSettingsAuthorizations
Path Parameters
Available options:
related-products, bought-together, trending-items, looking-similar Unique task identifier. Unique identifier of a task.
A successful API response means that a task was added to a queue.
It might not run immediately.
You can check the task's progress with the task operation and this task ID.
Example:
1514562690001
Last modified on April 30, 2026
Was this page helpful?