# Examples

cURL, Python, and JavaScript examples for SearchIn search and poll.

URL: https://osintverse.com/docs/api/examples

Replace `ov_your_api_key` with a secret from [Dashboard → API keys](https://osintverse.com/dashboard/api). Python examples use the [official SDK](https://osintverse.com/docs/python) (`pip install osintverse`).

## Create a search

**cURL**

```bash
curl -X POST "https://apiv1.osintverse.com/v1/search" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ov_your_api_key" \
  -d '{"provider":"leakradar","input_type":"email","query":"user@example.com"}'
```

**Python**

```python
from osintverse import OSINTverse

client = OSINTverse(api_key="ov_your_api_key")
search = client.search.create(
    provider="leakradar",
    input_type="email",
    query="user@example.com",
    wait=True,
)
print(search.status, search.result)
```

**JavaScript**

```js
const response = await fetch("https://apiv1.osintverse.com/v1/search", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": "ov_your_api_key",
  },
  body: JSON.stringify({
    provider: "leakradar",
    input_type: "email",
    query: "user@example.com",
  }),
});

if (!response.ok) {
  throw new Error(await response.text());
}

console.log(await response.json());
```

## Request body

```json
{
  "provider": "leakradar",
  "input_type": "email",
  "query": "user@example.com"
}
```

## Completed response

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "completed",
  "provider": "leakradar",
  "input_type": "email",
  "query": "user@example.com",
  "cost_usd": "1.00",
  "balance_after": "9.00",
  "result": {
    "sources": [
      {
        "name": "leakradar",
        "type": "email",
        "total": 3,
        "total_unlocked": 2,
        "page": 1,
        "page_size": 100,
        "items_returned": 3,
        "auto_unlock_points_consumed": 1
      }
    ],
    "matches": [
      {
        "type": "leak",
        "id": "3f1a9c2b7e",
        "url": "https://example.com/login",
        "username": "user@example.com",
        "username_masked": "u***@example.com",
        "password": "P@ssw0rd123",
        "password_strength": 6,
        "unlocked": true,
        "is_email": true,
        "added_at": "2025-01-15T10:30:00Z",
        "status": "new"
      }
    ]
  },
  "error": null,
  "poll_url": null
}
```

## Poll an async search

**cURL**

```bash
curl "https://apiv1.osintverse.com/v1/search/550e8400-e29b-41d4-a716-446655440000" \
  -H "x-api-key: ov_your_api_key"
```

**Python**

```python
from osintverse import OSINTverse

client = OSINTverse(api_key="ov_your_api_key")
search = client.search.wait("550e8400-e29b-41d4-a716-446655440000")
print(search.status, search.result)
```

FaceCheck completed matches look like:

```json
{
  "score": 97,
  "url": "https://sports.yahoo.com/article/example",
  "thumbnail": "data:image/webp;base64,..."
}
```

See the [search workflow](https://osintverse.com/docs/api/search) for status handling.

## Bulk search

```bash
curl -X POST "https://apiv1.osintverse.com/v1/search/bulk" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ov_your_api_key" \
  -d '{"input_type":"email","queries":["alice@example.com","bob@example.com"],"providers":["leakradar","dehashed"]}'
```

```python
from osintverse import OSINTverse

client = OSINTverse(api_key="ov_your_api_key")
batch = client.search.bulk(
    input_type="email",
    queries=["alice@example.com", "bob@example.com"],
    providers=["leakradar", "dehashed"],
    wait=True,
)
print(batch.summary, len(batch.searches))
```

Limits: 50 queries, 100 jobs (`queries × providers`). Poll any `running` job with `GET /v1/search/:id`, or pass `wait=True` in the [Python SDK](https://osintverse.com/docs/python).
