# Search Extract

> Search the web, rerank results, and extract structured data in one call — 6 credits per call.

Source: http://localhost:3000/docs/endpoints/search-extract

## Search + Extract: `POST /v1/search-extract/`

Search, rerank and extract structured fields from the top hits. Cost: 6 credits.

```bash
curl -X POST https://api.hushsearch.io/v1/search-extract/ \
  -H "X-API-Key: hs_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "open-source vector databases",
  "schema_fields": [
    "name",
    "license",
    "language"
  ]
}'
```

**POST** `/v1/search-extract/` — **6 credits per call**

Runs a [Web Search](http://localhost:3000/docs/endpoints/search) pipeline, reranks hits, then performs parallel [Structured Extraction](http://localhost:3000/docs/endpoints/structured-extract) across the top URLs and merges fields into a single JSON object with source citations.

## Request

```json
{
  "query": "best vector databases 2026",
  "schema_fields": ["name", "vendor", "pricing_model"],
  "prompt": "Extract product comparison fields",
  "num_results": 5,
  "max_urls": 3
}
```

| Field | Type | Required | Description |
|---|---|---|---|
| `query` | string | Yes | Search query |
| `schema_fields` | list or JSON schema | No | Fields to extract from each page |
| `prompt` | string | No | Custom extraction instruction |
| `num_results` | int | No | SearXNG results to fetch (default 5) |
| `max_urls` | int | No | Max URLs to extract (default 3) |

## Response

```json
{
  "query": "best vector databases 2026",
  "data": {
    "name": "pgvector",
    "vendor": "PostgreSQL community",
    "pricing_model": "open source"
  },
  "sources": [
    { "url": "https://example.com/pgvector", "title": "pgvector overview" }
  ],
  "credits_used": 6,
  "credits_remaining": 94,
  "response_time_ms": 4200
}
```

## Notes

- Requires `GROQ_API_KEY` for LLM extraction; missing fields return `null`.
- Citation coverage is enforced when sources are available.
- Async variant: submit a `multi_extract` job via [Async Jobs](http://localhost:3000/docs/endpoints/jobs) with `ground_query`.
