> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.aventure.vc/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.aventure.vc/_mcp/server.

# Search the live web

POST https://api.aventure.vc/v1/search/web
Content-Type: application/json

Runs a live web search through SerpAPI, returns a stored result when a fresh version exists, and durably records fresh results in the source-document store.

Reference: https://docs.aventure.vc/api-reference/a-venture-api/search/web

## Authentication

- `Authorization` header (bearer token, required) — User bearer token: Supabase or Clerk session JWT, Clerk OAuth access token, or Clerk personal API key
- `X-API-Key` header (required) — Admin API key for system-to-system write operations
- `X-Client-Secret` header (required) — Client secret for read-only service-to-service access (no writes)

## Request

### Body (application/json)

- `search` (string, required) — Search text sent to the upstream web search provider
- `bypassCache` (boolean, optional, default: false) — Skip cache lookup and refresh from the search provider
- `cacheKey` (string, optional, nullable) — Stable lookup text for cache keying when generated search text varies between runs
- `language` (string, optional, nullable) — Search language code
- `region` (string, optional, nullable) — Search region code
- `resultLimit` (integer, optional, nullable) — Maximum number of normalized results to keep
- `source` (string, optional, nullable) — Optional caller identity for source-document attribution and abuse triage. Any non-blank string up to 64 characters is accepted and persisted with the resolved request context.

## Response

### 200

OK

- `document` (object, required) — Source-document ledger row backing this result
  - `cacheHitCount` (integer, required)
  - `createdAt` (datetime, required)
  - `documentType` (string, required)
  - `id` (string, required) — Document id
  - `provider` (string, required)
  - `sourceKey` (string, required) — Canonical fetch identity: canonical URL, query hash, or dataset + external id
  - `expiresAt` (datetime, optional, nullable)
  - `httpStatus` (integer, optional, nullable)
  - `lastAccessedAt` (datetime, optional, nullable)
  - `providerRequestId` (string, optional, nullable)
  - `rawByteCount` (long, optional, nullable)
  - `rawCharset` (string, optional, nullable)
  - `rawMediaType` (string, optional, nullable)
  - `upstreamContentEncoding` (string, optional, nullable)
- `result` (list of object, required) — Normalized result items in provider rank order
  - `relevanceScore` (double, required)
  - `snippet` (string, required)
  - `title` (string, required)
  - `url` (string, required)
- `search` (object, required) — Web search request represented by this result
  - `search` (string, required) — Search text sent to the upstream web search provider
  - `bypassCache` (boolean, optional, default: false) — Skip cache lookup and refresh from the search provider
  - `cacheKey` (string, optional, nullable) — Stable lookup text for cache keying when generated search text varies between runs
  - `language` (string, optional, nullable) — Search language code
  - `region` (string, optional, nullable) — Search region code
  - `resultLimit` (integer, optional, nullable) — Maximum number of normalized results to keep
  - `source` (string, optional, nullable) — Optional caller identity for source-document attribution and abuse triage. Any non-blank string up to 64 characters is accepted and persisted with the resolved request context.

## Examples

**Request**

```json
{
  "search": "OpenAI latest funding news"
}
```

**Response**

```json
{
  "document": {
    "cacheHitCount": 1,
    "createdAt": "2024-01-15T09:30:00Z",
    "documentType": "string",
    "id": "string",
    "provider": "string",
    "sourceKey": "string",
    "expiresAt": "2024-01-15T09:30:00Z",
    "httpStatus": 1,
    "lastAccessedAt": "2024-01-15T09:30:00Z",
    "providerRequestId": "string",
    "rawByteCount": 1,
    "rawCharset": "string",
    "rawMediaType": "string",
    "upstreamContentEncoding": "string"
  },
  "result": [
    {
      "relevanceScore": 1.1,
      "snippet": "string",
      "title": "string",
      "url": "string"
    }
  ],
  "search": {
    "search": "OpenAI latest funding news",
    "bypassCache": false,
    "cacheKey": "OpenAI",
    "language": "en",
    "region": "us",
    "resultLimit": 5,
    "source": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.aventure.vc/v1/search/web"

payload = { "search": "OpenAI latest funding news" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.aventure.vc/v1/search/web';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"search":"OpenAI latest funding news"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.aventure.vc/v1/search/web"

	payload := strings.NewReader("{\n  \"search\": \"OpenAI latest funding news\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.aventure.vc/v1/search/web")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"search\": \"OpenAI latest funding news\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.aventure.vc/v1/search/web")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"search\": \"OpenAI latest funding news\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.aventure.vc/v1/search/web', [
  'body' => '{
  "search": "OpenAI latest funding news"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.aventure.vc/v1/search/web");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"search\": \"OpenAI latest funding news\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["search": "OpenAI latest funding news"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.aventure.vc/v1/search/web")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```