Metadata-Version: 2.4
Name: insecureweb-client
Version: 0.2.0
Summary: Official Python client to interact with the InsecureWeb API.
Author: Forest
Author-email: jose.alvarez@insecureweb.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.1
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# InsecureWeb Python Client

This is the official Python client to easily interact with the InsecureWeb API.

## Installation

You can install this package easily using pip:

```bash
pip install insecureweb-client
```

## Quickstart

Here is an example of how to use the client to create organizations in bulk. Remember to configure your API Key as an environment variable.

```python
import os
from insecureweb import InsecureWebClient

# 1. Load your API key
my_key = "YOUR_API_KEY_HERE" # We recommend using environment variables (os.getenv) 

# 2. Initialize the client
client = InsecureWebClient(my_key)

# 3. Prepare the data
data = [
    {
        "orgName": "My Test Company",
        "domains": ["mycompany.com"],
        "emails": [],
        "users": [],
        "ips": [],
        "scanServices": ["DARK_WEB"]
    }
]

# 4. Send the request
result = client.create_organizations_bulk(data)
print(result)
```

## Usage Examples

Once the client is initialized, you can easily use the monitoring and scanning engines:

### Dark Web & Typosquatting

```python
# Get Dark Web breaches for your organization
breaches = client.get_dark_web_breaches(organization_id=123456)
print(f"Found {len(breaches)} breaches.")

# Check for Typosquatting (domain impersonation)
typo_threats = client.check_typosquatting(organization_id=123456)
print(f"Found {len(typo_threats)} suspicious domains.")
```

### Live Scan & Vulnerabilities

```python
# Search the Dark Web in real time
live_results = client.live_scan_dark_web(field="domain", search_term="example.com")
print(f"Found {len(live_results)} real-time matches.")

# Launch an infrastructure vulnerability scan
scan = client.register_vulnerability_scan(
    organization_id=123456,
    scan_name="Scheduled SDK Scan",
    targets=["example.com", "8.8.8.8"],
    run_now=True
)
print("Scan successfully registered!")
```

## Features
* Automatic handling of authentication headers (`api-key`).
* API version injection (`v3` and `v2` endpoints supported).
* Smart HTTP response handling and error message extraction.
* Support for empty server responses (HTTP 204).
