> ## Documentation Index
> Fetch the complete documentation index at: https://doc.agentfirst.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk processing

> Make massively parallel requests.

## Batch jobs

Each service has a batch endpoint that accepts a JSON array of up to **1,000 requests** in a `POST`
body:

```shell theme={null}
curl -X POST 'https://api.agentfirst.dev/ai/batches' \
-H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
  "prompts": [
    "Where can I buy a vintage guitar?",
    "Help me find guitar repair shops nearby.",
    "Do any local stores sell vinyl records?",
    "[Additional prompts here]"
  ],
  "country": "US",
  "subdivision": "TN"
}'
```

> [accordion] View search example
>
> ```shell theme={null}
> curl -X POST 'https://api.agentfirst.dev/search/batches' \
> -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
> -H 'Content-Type: application/json' \
> -d '{
>   "terms": ["musical instruments"],
>   "country": "US"
> }'
> ```

> [accordion] View browser example
>
> ```shell theme={null}
> curl -X POST 'https://api.agentfirst.dev/browser/batches' \
> -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
> -H 'Content-Type: application/json' \
> -d '{
>   "urls": [
>     "https://guitars.com/",
>     "https://cartervintage.com/",
>     "https://musiccityvintageguitars.com/",
>     "[Additional URLs here]"
>   ],
>   "country": "US",
>   "city": "Nashville"
> }'
> ```

[Search](https://doc.agentfirst.dev/endpoints/search.md#search-parameters), [AI](https://doc.agentfirst.dev/endpoints/ai.md#chat-parameters), or
[browsing](https://doc.agentfirst.dev/endpoints/browser.md#rest-parameters) and
[geotargeting parameters](https://doc.agentfirst.dev/endpoints/geotargeting.md) can be included in the body. In response,
the API will provide a job identifier and confirmation of the request count:

```json theme={null}
{
  "id": "b3829f53-abc9-4e62-8a65-2d9359d586d6",
  "count": 37
}
```

The job status can be requested any time thereafter by passing back the ID:

```shell theme={null}
curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
'https://api.agentfirst.dev/ai/batches'\
'?id=b3829f53-abc9-4e62-8a65-2d9359d586d6'
```

> [accordion] View search example
>
> ```shell theme={null}
> curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
> 'https://api.agentfirst.dev/search/batches'\
> '?id=a0482596-c2ad-445a-a435-727002156a20'
> ```

> [accordion] View browser example
>
> ```shell theme={null}
> curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
> 'https://api.agentfirst.dev/browser/batches'\
> '?id=cfde9b46-f599-49ab-844e-9b2461285284'
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.