> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Search

> Search the web and get full content from results

Search lets you search the web and, in the same call, read the full content of the results.

* Choose where to search: the web, images, or both
* Read every result as Markdown or any other [format](/features/scrape.md#scrape-formats)
* Keep results to the sites and the time range you want

For details, see the [Search Endpoint API Reference](/api-reference/endpoint/search.md).

> [!NOTE]
>
> If a request fails, see [Errors](/api-reference/errors.md) for the error codes and what to do about each one.

## Performing a Search with ScreenshotRender

### /search endpoint

Used to search the web and, optionally, read the results.

### Installation

```bash Python
pip install screenshotrender
```

```bash Node
npm install screenshotrender
```

### Basic Usage

```python Python
from screenshotrender import ScreenshotRender

screenshotrender = ScreenshotRender(api_key="sr-YOUR-API-KEY")

results = screenshotrender.search("open source vector databases", limit=3)

for result in results.web or []:
    print(result.title, result.url)
```

```js Node
import ScreenshotRender from "screenshotrender";

const screenshotrender = new ScreenshotRender({ apiKey: "sr-YOUR-API-KEY" });

const results = await screenshotrender.search("open source vector databases", { limit: 3 });

for (const result of results.web ?? []) {
  console.log(result.title, result.url);
}
```

```bash cURL
curl -s -X POST "https://www.screenshotrender.com/api/v1/search" \
  -H "Authorization: Bearer $SCREENSHOTRENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "open source vector databases",
    "limit": 3
  }'
```

### Response

SDKs return the data object directly. cURL returns the payload exactly as shown below.

```json Response
{
  "success": true,
  "data": {
    "web": [
      {
        "url": "https://medium.com/@michael.hannecke/comparison-of-5-open-source-vector-databases-89fcce12578f",
        "title": "Comparison of 5 Open Source Vector Databases | by Michael Hannecke",
        "description": "Comprehensive comparison of Milvus, Qdrant, Weaviate, Chroma, and FAISS vector databases with Python examples, detailed pros/cons, ...",
        "position": 1
      },
      {
        "url": "https://redis.io/blog/best-open-source-vector-databases-comparison/",
        "title": "Comparing the best open source vector databases (2026)",
        "description": "# Comparing the best open source vector databases\nOpen source vector databases come in two flavors: specialized tools that handle vectors and nothing else, or u...",
        "position": 2
      },
      {
        "url": "https://www.zenml.io/blog/vector-databases-for-rag",
        "title": "We Tried and Tested 10 Best Vector Databases for RAG Pipelines",
        "description": "# We Tried and Tested 10 Best Vector Databases for RAG Pipelines\n## TL;DR for Top Vector Databases for RAG Pipelines\n- [Weaviate](https://weaviate.io/): An open...",
        "position": 3
      }
    ]
  },
  "creditsUsed": 2
}
```

`limit` is the number of results for each source, 10 by default and up to 100.

## Search result types

Set `sources` to choose where to search. Each source comes back as its own list in `data`.

| Source | Results in | Each result has |
| - | - | - |
| `web` (default) | `data.web` | `url`, `title`, `description`, `position` |
| `images` | `data.images` | `title`, `imageUrl`, `imageWidth`, `imageHeight`, `url`, `position` |

```bash cURL
curl -s -X POST "https://www.screenshotrender.com/api/v1/search" \
  -H "Authorization: Bearer $SCREENSHOTRENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "golden gate bridge",
    "sources": ["web", "images"],
    "limit": 2
  }'
```

```json Response
{
  "success": true,
  "data": {
    "web": [
      {
        "url": "https://en.wikipedia.org/wiki/Golden_Gate_Bridge",
        "title": "Golden Gate Bridge",
        "description": "| Golden Gate Bridge |\n|-|\n| [![](https://thumb.wikimedia.org/wikipedia/commons/thumb/b/bf/Golden_Gate_Bridge_as_seen_from_Battery_East.jpg/330px-Golden_Gate_Br...",
        "position": 1
      },
      {
        "url": "https://www.goldengate.org/",
        "title": "Golden Gate Bridge, Highway and Transportation District | Golden Gate",
        "description": "## [Visiting the Bridge](https://www.goldengate.org/bridge/visiting-the-bridge/)\nEach year the Golden Gate Bridge attracts more than 10 million visitors to take...",
        "position": 2
      }
    ],
    "images": [
      {
        "title": "Golden Gate Bridge | San Francisco Travel",
        "imageUrl": "https://www.sftravel.com/sites/default/files/styles/hero/public/2024-06/golden-gate-bridge-bay-sunse...",
        "imageWidth": 1920,
        "imageHeight": 1080,
        "url": "https://www.sftravel.com/things-to-do/attractions/iconic-sf/golden-gate-bridge",
        "position": 1
      },
      {
        "title": "Golden Gate Bridge - Wikipedia",
        "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/b/bf/Golden_Gate_Bridge_as_seen_from_Battery_East.jpg...",
        "imageWidth": 5388,
        "imageHeight": 3368,
        "url": "https://en.wikipedia.org/wiki/Golden_Gate_Bridge",
        "position": 2
      }
    ]
  },
  "creditsUsed": 4
}
```

## Domain and time filters

Keep results to some sites with `includeDomains`. Use `tbs` to keep results from a recent time range, like `qdr:m` for the past month.

```bash cURL
curl -s -X POST "https://www.screenshotrender.com/api/v1/search" \
  -H "Authorization: Bearer $SCREENSHOTRENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "release notes",
    "includeDomains": ["nodejs.org"],
    "tbs": "qdr:m",
    "limit": 3
  }'
```

## Search with Content Scraping

Add `scrapeOptions` to read every result page in the same call. It takes the same options as [Scrape](/features/scrape.md): formats, `onlyMainContent`, `waitFor` and the rest.

```python Python
from screenshotrender import ScreenshotRender

screenshotrender = ScreenshotRender(api_key="sr-YOUR-API-KEY")

results = screenshotrender.search(
    "open source vector databases",
    limit=2,
    scrape_options={"formats": ["markdown"]},
)

for result in results.web or []:
    print(result.url, len(result.markdown or ""), "characters")
```

```js Node
import ScreenshotRender from "screenshotrender";

const screenshotrender = new ScreenshotRender({ apiKey: "sr-YOUR-API-KEY" });

const results = await screenshotrender.search("open source vector databases", {
  limit: 2,
  scrapeOptions: { formats: ["markdown"] },
});

for (const result of results.web ?? []) {
  console.log(result.url, result.markdown?.length, "characters");
}
```

```bash cURL
curl -s -X POST "https://www.screenshotrender.com/api/v1/search" \
  -H "Authorization: Bearer $SCREENSHOTRENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "open source vector databases",
    "limit": 2,
    "scrapeOptions": { "formats": ["markdown"] }
  }'
```

### Response with Scraped Content

```json Response
{
  "success": true,
  "data": {
    "web": [
      {
        "url": "https://medium.com/@michael.hannecke/comparison-of-5-open-source-vector-databases-89fcce12578f",
        "title": "Comparison of 5 Open Source Vector Databases | by Michael Hannecke",
        "description": "Comprehensive comparison of Milvus, Qdrant, Weaviate, Chroma, and FAISS vector databases with Python examples, detailed pros/cons, ...",
        "position": 1,
        "markdown": "[Sitemap](https://medium.com/sitemap/sitemap.xml)\n\n[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNav...",
        "metadata": {
          "title": "Comparison of 5 Open Source Vector Databases | by Michael Hannecke | Medium",
          "description": "Comprehensive comparison of Milvus, Qdrant, Weaviate, Chroma, and FAISS vector databases with Python examples, detailed...",
          "language": "en",
          "sourceURL": "https://medium.com/@michael.hannecke/comparison-of-5-open-source-vector-databases-89fcce12578f",
          "url": "https://medium.com/@michael.hannecke/comparison-of-5-open-source-vector-databases-89fcce12578f",
          "statusCode": 200,
          "contentType": "text/html; charset=utf-8",
          "proxyUsed": "basic",
          "cacheState": "miss"
        }
      },
      {
        "url": "https://www.reddit.com/r/ChatGPTCoding/comments/14112ol/open_source_vector_databases/",
        "title": "Open source vector databases? : r/ChatGPTCoding",
        "description": "I am looking for an open source vector database that I could run on a Windows machine to be an extended memory for my local gpt based app.\n\nWhat vector ...",
        "position": 2
      }
    ]
  },
  "creditsUsed": 3
}
```

A result whose page could not be read comes back without content, like the second result above, and costs nothing to read.

## Cost Implications

* Each source costs 2 credits for every 10 results (or part of 10). Searching the web and images with `limit: 2` costs 4 credits.
* With `scrapeOptions`, each result that came back with content also costs what a [scrape](/billing.md#credit-costs) of it costs: 1 credit a page, 5 with `json`, `question` or `highlights`.
* The response's `creditsUsed` is the exact cost of the call. The search above cost 3 credits: 2 for the results, 1 for the page that was read.
