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

# Machine Viewer

> Search and explore infected machine data, file trees, and extracted information via API key

The Machine Viewer module provides access to infected machine records stored in the OsintCat breach database.
Search machines by name, retrieve device details, browse file trees, and download archived logs — all via API key.

<Note>
  All Machine Viewer API endpoints use `X-API-KEY` header authentication.
  Searching machines costs **1 credit** per search.
</Note>

***

## Global Statistics

```bash theme={null}
GET https://www.osintcat.net/api/machine_viewer/stats
```

Returns total infected machine and file counts.

<ParamField header="X-API-KEY" type="string" required>
  Your API key
</ParamField>

**Response**

```json theme={null}
{
  "total_machines": 412000,
  "total_files": 18500000
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://www.osintcat.net/api/machine_viewer/stats" \
       -H "X-API-KEY: YOUR_API_KEY"
  ```

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

  url = "https://www.osintcat.net/api/machine_viewer/stats"
  headers = {"X-API-KEY": "YOUR_API_KEY"}

  response = requests.get(url, headers=headers)
  print(response.json())
  ```

  ```javascript Node.js theme={null}
  fetch('https://www.osintcat.net/api/machine_viewer/stats', {
      headers: { 'X-API-KEY': 'YOUR_API_KEY' }
  }).then(r => r.json()).then(console.log);
  ```
</CodeGroup>

***

## Search Machines

```bash theme={null}
GET https://www.osintcat.net/api/machine_viewer/search
```

Search for infected machines by hostname or username. Costs **1 credit** per search.

<ParamField query="query" type="string" required>
  The search term (hostname, username, UUID, etc.)
</ParamField>

<ParamField header="X-API-KEY" type="string" required>
  Your API key
</ParamField>

**Response**

```json theme={null}
{
  "query": "ZAEZBCAOHJNF",
  "total": 1,
  "machines": [
    {
      "id": "742e1f66-f449-4a6c-80d5-8f5eb8e9c2b5",
      "name": "ZAEZBCAOHJNF",
      "file_count": 15,
      "total_size": 772597,
      "imported_at": "2026-03-03T00:00:00"
    }
  ]
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://www.osintcat.net/api/machine_viewer/search?query=ZAEZBCAOHJNF" \
       -H "X-API-KEY: YOUR_API_KEY"
  ```

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

  url = "https://www.osintcat.net/api/machine_viewer/search"
  params = {"query": "ZAEZBCAOHJNF"}
  headers = {"X-API-KEY": "YOUR_API_KEY"}

  response = requests.get(url, params=params, headers=headers)
  print(response.json())
  ```

  ```javascript Node.js theme={null}
  fetch('https://www.osintcat.net/api/machine_viewer/search?query=ZAEZBCAOHJNF', {
      headers: { 'X-API-KEY': 'YOUR_API_KEY' }
  }).then(r => r.json()).then(console.log);
  ```
</CodeGroup>

***

## Get Machine Info

```bash theme={null}
GET https://www.osintcat.net/api/machine_viewer/machines/{machine_id}/info
```

Returns full device identity, extracted email addresses, and Discord tokens.

<ParamField path="machine_id" type="string" required>
  The UUID of the machine (from Search response)
</ParamField>

<ParamField header="X-API-KEY" type="string" required>
  Your API key
</ParamField>

**Response**

```json theme={null}
{
  "machine": {
    "id": "742e1f66-f449-4a6c-80d5-8f5eb8e9c2b5",
    "name": "ZAEZBCAOHJNF",
    "file_count": 15,
    "total_size": 772597,
    "imported_at": "2026-03-03T00:00:00"
  },
  "emails": ["user@example.com", "admin@test.org"],
  "tokens": ["MTA5NDI3MzI2NTQ2NDAyNTYy.XXXXX.YYYYY"]
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://www.osintcat.net/api/machine_viewer/machines/742e1f66-.../info" \
       -H "X-API-KEY: YOUR_API_KEY"
  ```

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

  machine_id = "742e1f66-f449-4a6c-80d5-8f5eb8e9c2b5"
  url = f"https://www.osintcat.net/api/machine_viewer/machines/{machine_id}/info"
  headers = {"X-API-KEY": "YOUR_API_KEY"}

  response = requests.get(url, headers=headers)
  print(response.json())
  ```
</CodeGroup>

***

## Get File Tree

```bash theme={null}
GET https://www.osintcat.net/api/machine_viewer/machines/{machine_id}/files/treeview
```

Returns a nested directory/file tree for a machine.

<ParamField path="machine_id" type="string" required>
  The UUID of the machine
</ParamField>

**Response**

```json theme={null}
{
  "machine": "ZAEZBCAOHJNF",
  "total_files": 15,
  "tree": [
    {
      "name": "passwords",
      "type": "directory",
      "children": [
        { "name": "chrome.txt", "type": "file", "id": "abc123", "size": 1024 }
      ]
    }
  ]
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://www.osintcat.net/api/machine_viewer/machines/742e1f66-.../files/treeview" \
       -H "X-API-KEY: YOUR_API_KEY"
  ```

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

  machine_id = "742e1f66-f449-4a6c-80d5-8f5eb8e9c2b5"
  url = f"https://www.osintcat.net/api/machine_viewer/machines/{machine_id}/files/treeview"
  headers = {"X-API-KEY": "YOUR_API_KEY"}

  response = requests.get(url, headers=headers)
  print(response.json())
  ```
</CodeGroup>

***

## Get File Info & Content

```bash theme={null}
GET https://www.osintcat.net/api/machine_viewer/files/{file_id}/info
```

Returns metadata and text content of a single file. The `file_id` comes from the file tree response.

<ParamField path="file_id" type="string" required>
  The UUID of the file (from File Tree response)
</ParamField>

**Response**

```json theme={null}
{
  "id": "abc123",
  "filename": "chrome.txt",
  "path": "passwords/chrome.txt",
  "size": 1024,
  "content": "URL: https://example.com\nUsername: user@gmail.com\nPassword: ..."
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://www.osintcat.net/api/machine_viewer/files/abc123/info" \
       -H "X-API-KEY: YOUR_API_KEY"
  ```

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

  file_id = "abc123"
  url = f"https://www.osintcat.net/api/machine_viewer/files/{file_id}/info"
  headers = {"X-API-KEY": "YOUR_API_KEY"}

  response = requests.get(url, headers=headers)
  print(response.json())
  ```
</CodeGroup>

***

## Download Single File

```bash theme={null}
GET https://www.osintcat.net/api/machine_viewer/files/{file_id}/download
```

Downloads the raw content of a single file as `application/octet-stream`.

<ParamField path="file_id" type="string" required>
  The UUID of the file
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -O -J "https://www.osintcat.net/api/machine_viewer/files/abc123/download" \
       -H "X-API-KEY: YOUR_API_KEY"
  ```

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

  file_id = "abc123"
  url = f"https://www.osintcat.net/api/machine_viewer/files/{file_id}/download"
  headers = {"X-API-KEY": "YOUR_API_KEY"}

  response = requests.get(url, headers=headers)
  with open("file.txt", "wb") as f:
      f.write(response.content)
  ```
</CodeGroup>

***

## Download Machine Archive

```bash theme={null}
GET https://www.osintcat.net/api/machine_viewer/machines/{machine_id}/download
```

Downloads all files for a machine as a `.zip` archive.

<ParamField path="machine_id" type="string" required>
  The UUID of the machine
</ParamField>

Returns `application/zip` named `{machine_name}_export.zip`.

<CodeGroup>
  ```bash cURL theme={null}
  curl -O -J "https://www.osintcat.net/api/machine_viewer/machines/742e1f66-.../download" \
       -H "X-API-KEY: YOUR_API_KEY"
  ```

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

  machine_id = "742e1f66-f449-4a6c-80d5-8f5eb8e9c2b5"
  url = f"https://www.osintcat.net/api/machine_viewer/machines/{machine_id}/download"
  headers = {"X-API-KEY": "YOUR_API_KEY"}

  response = requests.get(url, headers=headers)
  with open("machine_export.zip", "wb") as f:
      f.write(response.content)
  print(f"Downloaded {len(response.content)} bytes")
  ```

  ```javascript Node.js theme={null}
  const fs = require('fs');
  const https = require('https');

  const machine_id = '742e1f66-f449-4a6c-80d5-8f5eb8e9c2b5';
  const url = `https://www.osintcat.net/api/machine_viewer/machines/${machine_id}/download`;

  const file = fs.createWriteStream('machine_export.zip');
  https.get(url, { headers: { 'X-API-KEY': 'YOUR_API_KEY' } }, res => {
      res.pipe(file);
      file.on('finish', () => file.close(() => console.log('Downloaded!')));
  });
  ```
</CodeGroup>
