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

# API overview

> Build investigations and security workflows with the Infrawatch public API

The Infrawatch API is a JSON REST API for infrastructure search, enrichment,
external-surface workflows, browser evidence, rules, and intelligence reports.

## Base URL

```text theme={null}
https://api.infrawatch.com/api/v1
```

Endpoint pages show paths relative to this URL.

## Authenticate

Create and manage API keys in
[API access](https://app.infrawatch.com/accounts/api-access), then send the key
in `X-API-Key`:

<CodeGroup>
  ```bash cURL theme={null}
  curl --get "https://api.infrawatch.com/api/v1/search/hosts" \
    --header "X-API-Key: <your-api-key>" \
    --data-urlencode "q=ip:1.1.1.1" \
    --data "limit=1"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.infrawatch.com/api/v1/search/hosts",
      headers={"X-API-Key": "<your-api-key>"},
      params={"q": "ip:1.1.1.1", "limit": 1},
      timeout=10,
  )
  response.raise_for_status()
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = new URL(
    "https://api.infrawatch.com/api/v1/search/hosts?q=ip%3A1.1.1.1&limit=1",
  );
  const response = await fetch(url, {
    headers: { "X-API-Key": "<your-api-key>" },
  });

  if (!response.ok) {
    throw new Error(`Infrawatch request failed: ${response.status}`);
  }

  console.log(await response.json());
  ```
</CodeGroup>

Authentication and access are derived from the key. Keep keys in server-side
secret storage and never expose them in client-side code.

<CardGroup cols={2}>
  <Card title="Authentication" icon="https://mintcdn.com/infrawatch/gCEz_Bv1hOrMPG8n/images/products/api-key.svg?fit=max&auto=format&n=gCEz_Bv1hOrMPG8n&q=85&s=49c5d983ed791bc581341b0b4e858551" href="/api-reference/authentication" width="32" height="32" data-path="images/products/api-key.svg">
    Create a key, choose scopes, set the header, and handle authentication
    errors.
  </Card>

  <Card title="Complete the quickstart" icon="https://mintcdn.com/infrawatch/gCEz_Bv1hOrMPG8n/images/products/quickstart.svg?fit=max&auto=format&n=gCEz_Bv1hOrMPG8n&q=85&s=4796cb60f8da0e66c70db7544cc9aecd" href="/quickstart" width="32" height="32" data-path="images/products/quickstart.svg">
    Create a scoped key, run a host search, and inspect the response.
  </Card>
</CardGroup>

## Choose an API

<CardGroup cols={2}>
  <Card icon="https://mintcdn.com/infrawatch/gCEz_Bv1hOrMPG8n/images/products/search.svg?fit=max&auto=format&n=gCEz_Bv1hOrMPG8n&q=85&s=e80dbe9b7724f88ce870e69cb367b435" href="/use-cases" title="Search and enrichment" width="32" height="32" data-path="images/products/search.svg">
    Search hosts, services, DNS, and OSINT; discover subdomains; validate
    InfraQL; run bulk lookup; count and aggregate results.
  </Card>

  <Card icon="https://mintcdn.com/infrawatch/gCEz_Bv1hOrMPG8n/images/products/esi.svg?fit=max&auto=format&n=gCEz_Bv1hOrMPG8n&q=85&s=ebc334425db0ee423bdf03e1348a066c" href="/external-surface/overview" title="External Surface Intelligence" width="32" height="32" data-path="images/products/esi.svg">
    Manage project inventory, services, and the lifecycle of externally visible
    findings.
  </Card>

  <Card icon="https://mintcdn.com/infrawatch/gCEz_Bv1hOrMPG8n/images/products/browser.svg?fit=max&auto=format&n=gCEz_Bv1hOrMPG8n&q=85&s=b7f8c2832dcea371e0d6e34d76cc1403" href="/platform/remote-browser" title="Remote Browser" width="32" height="32" data-path="images/products/browser.svg">
    Run isolated browser sessions and collect screenshots, network events, and
    replay evidence.
  </Card>

  <Card icon="https://mintcdn.com/infrawatch/gCEz_Bv1hOrMPG8n/images/products/rules.svg?fit=max&auto=format&n=gCEz_Bv1hOrMPG8n&q=85&s=7e3cb3f0ad32cc0e44ddfc18a2bba0e8" href="/scanning/rules/writing-rules" title="Rules" width="32" height="32" data-path="images/products/rules.svg">
    Author detection rules, manage tags, and inspect rule observations and
    activity.
  </Card>

  <Card icon="https://mintcdn.com/infrawatch/hFIgmGIh7O3VGQHG/images/products/reports.svg?fit=max&auto=format&n=hFIgmGIh7O3VGQHG&q=85&s=3f8b076d5f975d979b40765807982f25" href="/platform/reports" title="Reports" width="32" height="32" data-path="images/products/reports.svg">
    Retrieve published intelligence reports, facets, and extracted indicators.
  </Card>
</CardGroup>

## Errors

Errors use a stable JSON envelope:

```json theme={null}
{
  "error": {
    "code": "invalid_request",
    "message": "The request is invalid.",
    "request_id": "019c4f5f-4b50-7c6f-a759-b0da72a53c69"
  }
}
```

* Use `code` for program logic.
* Show `message` to an operator.
* Retain `request_id` for support.
* Back off when the API returns `429` or a retryable `503`.

## Versioning

Public endpoints are versioned in the URL where applicable. Backward-compatible
fields and enum values can be added over time, so clients should ignore values
they do not yet recognize.

<CardGroup cols={2}>
  <Card icon="https://mintcdn.com/infrawatch/gCEz_Bv1hOrMPG8n/images/products/data-dictionary.svg?fit=max&auto=format&n=gCEz_Bv1hOrMPG8n&q=85&s=7610d618bf3603732c6f9102b62101df" href="/data-dictionary" title="Data Dictionary" width="32" height="32" data-path="images/products/data-dictionary.svg">
    Browse public search fields, types, operators, and meanings.
  </Card>

  <Card icon="https://mintcdn.com/infrawatch/gCEz_Bv1hOrMPG8n/images/products/use-cases.svg?fit=max&auto=format&n=gCEz_Bv1hOrMPG8n&q=85&s=038f2239f51bdde5dd89ff8ef00d88e9" href="/use-cases" title="Analyst workflows" width="32" height="32" data-path="images/products/use-cases.svg">
    Follow practical IP, service, DNS, bulk-enrichment, and aggregation recipes.
  </Card>
</CardGroup>
