Source: https://seerepo.com/docs/api-search
Markdown source: https://seerepo.com/docs/api-search.md
Description: Find parts by name or phrase in every module, and files by path.

# Search the map

`GET https://seerepo.com/api/v1/repos/:repo/search`

Finds parts by name or phrase in every module of the map, and files by their path. Each result says which module it's in. Up to 20.

## Request

| Parameter | Where | Description |
|---|---|---|
| `repo` | path | The repo's id, or owner/name with %2F. |
| `q` | query | At least 2 characters. |

```sh
curl "https://seerepo.com/api/v1/repos/6ad79fd8e89233277ded17c9/search?q=stripe" \
  -H "Authorization: Bearer $SEEREPO_KEY"
```

## Response

| Field | Type | Description |
|---|---|---|
| `data.query` | string | What was searched, as SeeRepo read it. |
| `data.parts[].name` | string | The part's name. |
| `data.parts[].world` | string | The path of the module it's in. |
| `data.parts[].phrase` | string | What it does, in one line. |
| `data.parts[].path` | string | Only if it opens: its path. |
| `data.files[].path` | string | A file whose path matches. |
| `data.more` | boolean | true if there were more than 20. |

### Example

```json
{
  "status": "success",
  "data": {
    "query": "stripe",
    "parts": [
      {
        "name": "Stripe webhook",
        "type": "action",
        "world": "/checkout",
        "worldName": "Checkout",
        "phrase": "Turns the plan on once Stripe confirms.",
        "file": "app/api/stripe/route.ts"
      }
    ],
    "files": [],
    "more": false
  }
}
```

## Authentication

An API key as `Authorization: Bearer sr_…`. See [Authentication](/docs/api#authentication).

## Errors

| Code | `code` | When |
|---|---|---|
| 400 | `bad_query` | Less than 2 characters. |

Besides the ones every endpoint has (401, 404, 429), see [Errors](/docs/api#errors).
