---
title: "Web Search API reference: POST /v1/web-search"
description: "Request fields, response fields, errors and code samples for the Web Search endpoint. 2 credits / search."
url: https://1lookup.dev/docs/api/web-search
---

# Web Search

Ranked web results for a query or question, with optional answer passages from each page.

POST /v1/web-search

2 credits / search Bulk supported New Global

```
curl -X POST https://api.1lookup.dev/v1/web-search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"EU AI Act guidance for general purpose AI","limit":"10","include_content":"off"}'
```

```
{
  "success": true,
  "data": {
    "status": "completed"
  },
  "meta": {
    "credits_used": 2,
    "credits_remaining": 999,
    "cached": false,
    "request_id": "req_8f3a2c1e9b7d"
  }
}
```

## Authorization

`Authorization` string<bearer> required

Your API key as a Bearer token. Live keys start with `1lk_live_`. Test keys start with `1lk_test_` and return this endpoint's sample response without spending credits. See [authentication](https://1lookup.dev/docs/authentication).

## Body

Send the fields as a JSON object with `Content-Type: application/json`.

`query` string required

Query. Example: `EU AI Act guidance for general purpose AI`

`limit` enum<string> required

Results. One of: 10, 5, 20\. Example: `10`

`include_content` enum<string> required

Answer passages. One of: off, on. Example: `off`

`fresh` boolean

Skip the 7-day cache and run a new lookup. Charged as a normal lookup.

`reference` string

Your own identifier, echoed back in meta and shown in lookup history.

## Response

A `200` response carries the result in `data` and the cost of the call in `meta`.

`success` boolean

true when the lookup ran.

`meta.credits_used` number

Credits charged for this call.

`meta.credits_remaining` number

Your balance after the call.

`meta.cached` boolean

true when the result came from the 7-day cache.

`meta.request_id` string

Quote this when you contact support.

## Errors

A failed request returns `success: false` with an `error` object, and is never charged. The full list is on the [errors](https://1lookup.dev/docs/errors) page.

| HTTP | Code                  | Meaning                                                            |
| ---- | --------------------- | ------------------------------------------------------------------ |
| 401  | unauthorized          | The key is missing, malformed or revoked.                          |
| 402  | insufficient\_credits | Your credits are used up and pay as you go is off or at its limit. |
| 422  | invalid\_input        | A field is missing or malformed. The field property names it.      |
| 429  | rate\_limited         | Too many requests for this key. Wait for the Retry-After interval. |
| 500  | internal\_error       | Something failed on our side. Safe to retry.                       |
| 503  | source\_unavailable   | An upstream source did not answer in time. Safe to retry.          |

## Billing

2 credits / search. Charged when the lookup runs and returns a result. Errors are never charged, and repeating the same input within 7 days is served from cache at no charge.

[Product overview and use cases ](https://1lookup.dev/products/web-search)
