<!-- AUTO-GENERATED from the capability registry — regenerate: npm run generate:registry -->

# `web_search` — Orange Slice capability

> Outcome-priced capability. One price for the answer, whichever providers it took.
> Everything we expose, with prices: https://orangeslice.ai/llms.txt

Searches the web and emits one result per line. One credit, billed only when the search returns something. This is the discovery primitive — reach for it when you have no company or identifier to start from.

## Price

**$0.002, charged per hit**

Billed only when the answer is found. A miss costs nothing.

The price is a property of the outcome, not of the work behind it. Whichever
vendor serves this call, and whatever it costs us, the number above is the number
quoted before the run and charged after it.


## Call it

**CLI**

```bash
orangeslice search web --query "VP Sales" --domain linkedin.com

# pipe a column of queries in, one per line:
cat companies.ndjson | orangeslice search web --domain linkedin.com
```

**HTTP**

```bash
curl -X POST 'https://orangeslice.ai/api/v1/run' \
  -H 'Authorization: Bearer $ORANGESLICE_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"capability":"web_search","input":{"query":"<string>"}}'
```

**SDK**

```ts
await services.web.search({ query: "…" });
```

## Inputs

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `domain` | string | No | Restrict results to one domain, e.g. 'linkedin.com' |
| `page` | number | No | Page number, 1-indexed |
| `query` | string | Yes | What to search for. Do not use a site: operator — pass `domain` instead |
| `tbs` | string | No | Time filter: qdr:h, qdr:d, qdr:w, qdr:m, qdr:y for the last hour through year |

Inputs may also be piped as NDJSON, one JSON object per line.

## Output

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "results": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "snippet": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "displayedLink": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "title",
          "link",
          "snippet",
          "displayedLink"
        ],
        "additionalProperties": false
      }
    },
    "currentPage": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "totalResults": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "hasNextPage": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "results",
    "currentPage",
    "totalResults",
    "hasNextPage"
  ],
  "additionalProperties": false
}
```

The field that carries the answer is `results`. It is
`null` — or empty — when nothing was found, which is how a miss is told from a
hit without knowing anything else about this entry.

## Before you run

- **Price it first.** `orangeslice search web --dry-run` returns the
  exact dollar cost and spends nothing.
- **Large runs need approval.** Above the spend-gate threshold a run exits **7**
  until it carries a plan token, and only a dry run mints one.
- **Scopes:** enrich
- **Permitted uses:** research, export

## Exit codes

`0` ok · `2` bad input · `3` auth · `4` not found · `5` provider ·
`6` rate limited · `7` spend gate, nothing billed · `8` timeout ·
`9` a third-party account needs connecting
