# Web Traffic API

Traffic estimates for any website: monthly visits, global and category rank, engagement, where the traffic comes from, which countries and keywords drive it, and how much of it now arrives from AI assistants.

**Pricing:** $0.00025 per domain

**Endpoint:** `POST /v1/data/similarweb/traffic/run`

**Auth:** `Authorization: Bearer mk_live_...`

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `domains` | array | Yes | Domains or website URLs to look up. Hostnames are normalised, lowercased and deduplicated. Up to 200 per request. |
| `maxResults` | integer | No | Stop after this many domains have been looked up. Each domain costs one row, so this caps the bill as well as the output. 0 or omitted means every domain you sent. |

## Example

`?wait=true` holds the request open until the run finishes (up to 60s) and returns the rows inline — one request, no polling.

```bash
curl -X POST "https://api.mindcase.co/v1/data/similarweb/traffic/run?wait=true" \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params":{"domains":["..."]}}'
```

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/v1/data/similarweb/traffic/run",
    params={"wait": "true"},
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {
    "domains": [
        "..."
    ]
}},
)
rows = resp.json()["data"]
```

## Longer runs

If the run is still going at the 60s ceiling you get back `{ job_id, status: "running" }` instead of rows (same if the result is over 100 rows — those come back `truncated`). Poll with that `job_id`:

```bash
# 1) check status
curl https://api.mindcase.co/v1/jobs/JOB_ID \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"

# 2) when status == completed, fetch the rows
curl https://api.mindcase.co/v1/jobs/JOB_ID/results \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"
```

Full API reference (auth, jobs, balance, SDKs, MCP): https://mindcase.co/skills.md

## Response columns

| Field | Display name | Type |
|-------|--------------|------|
| `domain` | Domain | text |
| `siteName` | Site Name | text |
| `title` | Title | text |
| `description` | Description | text |
| `category` | Category | text |
| `globalRank` | Global Rank | number |
| `categoryRank` | Category Rank | number |
| `countryRank` | Country Rank | number |
| `topCountry` | Top Country | text |
| `monthlyVisits` | Monthly Visits | number |
| `snapshotMonth` | Snapshot Month | text |
| `bounceRate` | Bounce Rate | number |
| `pagesPerVisit` | Pages Per Visit | number |
| `avgVisitDuration` | Avg Visit Duration | number |
| `trafficSources` | Traffic Sources | object |
| `visitsByMonth` | Visits By Month | object |
| `topCountries` | Top Countries | object_array |
| `topKeywords` | Top Keywords | object_array |
| `topAiSources` | Top AI Sources | object_array |
| `aiVisits` | AI Visits | number |
| `aiTrafficShare` | AI Traffic Share | number |
