# Request Sources API

Request Sources API lets you submit source lists and monitor their processing status. Use it to automate source-addition requests from coverage workflows.

## Authorization

All endpoints require a token. Send it in either form:

1. `Authorization: Bearer <token>` (recommended)
2. `?token=<token>`

## Request sources

Submit a source-list request with `POST https://api.webz.io/source-api/add-list`.

| Parameter | Description |
| --- | --- |
| `source_type` | Type of requested sources: `news`, `blog`, or `discussions`. |
| `list_name` | Optional list name. The default is the request date and source type. |
| `sources` | Domains, subdomains, or sections to request; up to 100 at once. |

```bash
curl -X POST "https://api.webz.io/source-api/add-list" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "source_type": "news",
    "list_name": "tech feed",
    "sources": ["ynet.co.il", "ynet.co.il/sports"]
  }'
```

```json
{
  "list_id": "6f26c73fd6af4ea5a3f9b3e31030f1f2"
}
```

## Check request status

Retrieve a submitted list with `GET https://api.webz.io/source-api/get-results?list_id=[LIST_ID]`.

| Field | Description |
| --- | --- |
| `list_id` | Unique list identifier. |
| `list_name` | List name. |
| `list_date` | Date the list was requested. |
| `source_count` | Number of sources in the list. |
| `status` | Overall list status. |
| `sources` | Requested sources and their metadata. |

Each `sources` item includes:

| Field | Description |
| --- | --- |
| `source_type` | `domain`, `subdomain`, or `section`. |
| `source` | Requested source. |
| `source_status` | `COVERED`, `ADDED`, `FAILED`, or `RUNNING`. |
| `source_status_info` | Additional failure details, when available. |
| `need_license` | Required license, such as `NLA`, `NCA`, or `CFC`. |
| `domain_rank` | Domain ranking score. |
| `num_docs` | Documents indexed during the previous 30 days; updated daily. |

```bash
curl -X GET "https://api.webz.io/source-api/get-results?list_id=6f26c73fd6af4ea5a3f9b3e31030f1f2" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

