Skip to main content
POST
/
v1
/
agents
/
batch
Agent Batch
curl --request POST \
  --url https://sdk.nimbleway.com/v1/agents/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "inputs": [
    {
      "params": {
        "keyword": "iphone 15"
      }
    },
    {
      "params": {
        "keyword": "iphone 16"
      }
    },
    {
      "params": {
        "keyword": "iphone 17"
      }
    }
  ],
  "shared_inputs": {
    "agent": "amazon_serp"
  }
}
'
import requests

url = "https://sdk.nimbleway.com/v1/agents/batch"

payload = {
"inputs": [{ "params": { "keyword": "iphone 15" } }, { "params": { "keyword": "iphone 16" } }, { "params": { "keyword": "iphone 17" } }],
"shared_inputs": { "agent": "amazon_serp" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: [
{params: {keyword: 'iphone 15'}},
{params: {keyword: 'iphone 16'}},
{params: {keyword: 'iphone 17'}}
],
shared_inputs: {agent: 'amazon_serp'}
})
};

fetch('https://sdk.nimbleway.com/v1/agents/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://sdk.nimbleway.com/v1/agents/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
[
'params' => [
'keyword' => 'iphone 15'
]
],
[
'params' => [
'keyword' => 'iphone 16'
]
],
[
'params' => [
'keyword' => 'iphone 17'
]
]
],
'shared_inputs' => [
'agent' => 'amazon_serp'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://sdk.nimbleway.com/v1/agents/batch"

payload := strings.NewReader("{\n \"inputs\": [\n {\n \"params\": {\n \"keyword\": \"iphone 15\"\n }\n },\n {\n \"params\": {\n \"keyword\": \"iphone 16\"\n }\n },\n {\n \"params\": {\n \"keyword\": \"iphone 17\"\n }\n }\n ],\n \"shared_inputs\": {\n \"agent\": \"amazon_serp\"\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://sdk.nimbleway.com/v1/agents/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": [\n {\n \"params\": {\n \"keyword\": \"iphone 15\"\n }\n },\n {\n \"params\": {\n \"keyword\": \"iphone 16\"\n }\n },\n {\n \"params\": {\n \"keyword\": \"iphone 17\"\n }\n }\n ],\n \"shared_inputs\": {\n \"agent\": \"amazon_serp\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sdk.nimbleway.com/v1/agents/batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {\n \"params\": {\n \"keyword\": \"iphone 15\"\n }\n },\n {\n \"params\": {\n \"keyword\": \"iphone 16\"\n }\n },\n {\n \"params\": {\n \"keyword\": \"iphone 17\"\n }\n }\n ],\n \"shared_inputs\": {\n \"agent\": \"amazon_serp\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "batch_id": "4b0a90bf-c951-42e4-95b3-a95a65ba69fc",
  "batch_size": 1,
  "tasks": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "state": "pending",
      "output_url": "string",
      "created_at": "2024-01-15T10:30:00Z",
      "modified_at": "2024-01-15T10:35:00Z",
      "account_name": "string",
      "input": null,
      "batch_id": "4b0a90bf-c951-42e4-95b3-a95a65ba69fc",
      "status_code": 200,
      "api_type": "extract"
    }
  ]
}
{
"status": "failed",
"msg": "Invalid request parameters",
"error": "PARAMETERS_FAILED_JSON_SCHEMA_VALIDATION_ERROR",
"details": {
"schema_validation_errors": [
{
"instancePath": "",
"schemaPath": "#/required",
"keyword": "required",
"params": {
"missingProperty": "search_engine"
},
"message": "must have required property 'search_engine'"
}
]
}
}
{
"status": "failed",
"msg": "trial expired"
}
{
"status": "failed",
"msg": "Rate limit exceeded"
}
{
"success": "false",
"task_id": "1ed1dbeb-8f34-4fd1-bb2d-a72bacae2ef3",
"message": "can't download the query response - please try again"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for executing a batch of agent requests

inputs
AgentBatchInputsPayload · object[]
required
shared_inputs
AgentPayload · object
required

Request body model for the /agent/run endpoint

Response

Agent Batch Created

Response when a batch of extract tasks is created successfully.

batch_id
string

Unique identifier for the batch.

batch_size
number

Number of tasks in the batch.

tasks
object[]

List of created tasks.