# Docker Deep Tech Detector API

Public base URL:

```txt
https://ryszards-mac-mini.tail8a9cf4.ts.net
```

This API scans a website and returns detected technologies.

## Authentication

Send the API key in the `x-api-key` header.

```txt
x-api-key: <your-api-key>
```

The key is read from the server `API_KEY` environment variable.

## Endpoints

### `GET /health`

Use this to verify that the API is running.

Example:

```bash
curl https://ryszards-mac-mini.tail8a9cf4.ts.net/health
```

Example response:

```json
{"ok":true,"service":"tech-detector-api"}
```

### `POST /analyze`

Analyze a website and return detected technologies.

Request body:

```json
{
  "url": "https://www.shopify.com",
  "timeout_seconds": 60
}
```

Fields:

- `url`: required, must be a valid `http` or `https` URL
- `timeout_seconds`: optional, integer between `5` and `180`

Example request:

```bash
curl -X POST https://ryszards-mac-mini.tail8a9cf4.ts.net/analyze \
  -H "content-type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{"url":"https://www.shopify.com","timeout_seconds":60}'
```

Example response shape:

```json
{
  "url": "https://www.shopify.com",
  "scan_type": "full",
  "scanner": "browser_deep_scan",
  "technologies": [
    {
      "name": "Shopify",
      "version": null,
      "confidence": 100,
      "categories": ["Ecommerce"],
      "groups": [],
      "source": "browser_deep_scan"
    }
  ],
  "raw": {}
}
```

## Common Errors

- `401 Unauthorized`: missing or invalid `x-api-key`
- `400 Bad Request`: invalid URL or invalid payload
- `502 Bad Gateway`: scan failed upstream

## Shareable Docs

- HTML docs: `https://ryszards-mac-mini.tail8a9cf4.ts.net/`
- Markdown docs: `https://ryszards-mac-mini.tail8a9cf4.ts.net/api-docs.md`