> ## 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.

export const apiEndpoint = 'api.agentfirst.dev';

## 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"
}'
```

<AccordionGroup>
  <Accordion icon="terminal" title="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>

  <Accordion icon="terminal" title="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"
    }'
    ```
  </Accordion>
</AccordionGroup>

<Link href="search#search-parameters">Search</Link>, <Link href="ai#chat-parameters">AI</Link>, or
<Link href="browser#rest-parameters">browsing</Link> and
<Link href="geotargeting">geotargeting parameters</Link> 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'
```

<AccordionGroup>
  <Accordion icon="terminal" title="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>

  <Accordion icon="terminal" title="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'
    ```
  </Accordion>
</AccordionGroup>
