---
title: "Search Dataset"
method: GET
path: "/v2/datasets/{dataset}/search"
tags: ["datasets"]
---

# Search Dataset

`GET /v2/datasets/{dataset}/search`

Search for articles within a news dataset.

Performs search constrained to the dataset's domain.

**Supported Datasets:**
- `nytimes`: New York Times (nytimes.com)
- `washpost`: Washington Post (washingtonpost.com)
- `sfstandard`: SF Standard (sfstandard.com)
- `sacbee`: Sacramento Bee (sacbee.com)
- `sfchronicle`: San Francisco Chronicle (sfchronicle.com)
- `newyorker`: The New Yorker (newyorker.com)
- `theatlantic`: The Atlantic (theatlantic.com)
- `sjmercury`: San Jose Mercury News (mercurynews.com)
- `latimes`: Los Angeles Times (latimes.com)
- `wired`: WIRED (wired.com)
- `scientificamerican`: Scientific American (scientificamerican.com)

**Headers:**
- `Authorization`: Bearer {api_key} - Captain API key for authentication
- `X-Organization-ID`: Organization UUID

**Query Parameters:**
- `q`: Search query (required)
- `limit`: Maximum results to return (default: 10, max: 100)

**Returns:**
List of search results with title, URL, snippet, and date.

**Example:**
```
GET /v2/datasets/nytimes/search?q=artificial+intelligence&limit=5
```

## Path parameters

- `dataset` string, required

## Query parameters

- `q` string, required
- `limit` integer
- `author` string, nullable

## Response `200`

Successful Response

- DatasetSearchResponse — Response for GET /v2/datasets/{dataset}/search
  - `dataset` string, required
  - `error` string, nullable — Error message if search failed
  - `limit` integer
  - `query` string, required
  - `results` DatasetSearchResult[]
    - `author` string, nullable — Article author/byline if available
    - `date` string, nullable — Publication date if available
    - `snippet` string, nullable — Text snippet from the search result
    - `source` string, nullable — Source display name
    - `title` string, required
    - `url` string, required
  - `total_results` integer

## Other responses

- `400` — Invalid dataset or request
- `401` — Missing or invalid API key
- `403` — API key does not belong to organization
- `500` — Internal server error
- `502` — Search service error
- `503` — Search service not configured
- `504` — Search request timed out

---

[API](https://skmtc.dev/runcaptain/apis/api-reference.md) · [All operations](https://skmtc.dev/runcaptain/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runcaptain/api-reference/revisions/fe4649e3f4aa/schema)
