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

> ## Agent Instructions
> Searchia's JSON API needs no API key and no account. Call POST https://www.searchia.com/api with a JSON body such as {"query":"…","type":"web"}. It is rate-limited to 30 requests per minute per IP and answers 429 with a Retry-After header when over the limit. For terminals and agents, the searchia CLI (npx searchia) wraps the same API.

# CLI

> The searchia terminal client: search from your shell or your agent. No API key, no dependencies.

`searchia` wraps the [JSON API](https://docs.searchia.com/api/introduction.md) for terminals and agents. It has no runtime dependencies and no install scripts. It is MIT-licensed on npm as [`searchia`](https://www.npmjs.com/package/searchia).

## Install

```bash npx theme={null}
npx searchia "your query"
```

```bash npm theme={null}
npm install -g searchia
```

## Usage

```bash theme={null}
searchia <query>                      # web search
searchia search <query>               # web search, for queries that start with a command name
searchia web|images|news|videos|maps <query>
searchia suggest [partial]            # autocomplete
searchia open <query>                 # search and open the first result
```

## Options

| Flag | Description |
| - | - |
| `-t, --type <type>` | `web`, `images`, `news`, `videos` or `maps` (default `web`) |
| `-p, --page <n>` | Result page (default `0`) |
| `-n, --limit <n>` | Most results to print (default `10`) |
| `--engine <name>` | `brave` or `exa` |
| `--safesearch <mode>` | `off`, `moderate` or `strict` |
| `--country <code>` | `all` or a 2-letter ISO code |
| `--json` | Print JSON |
| `--urls` | Print URLs only, one per line |
| `--base-url <url>` | API origin (default `https://www.searchia.com`) |
| `-h, --help` | Show help |
| `-V, --version` | Show the version |

| Environment variable | Effect |
| - | - |
| `SEARCHIA_BASE_URL` | Overrides the default API origin, for example a local instance |
| `NO_COLOR=1` | Turns off colors |

## Exit codes

| Code | Meaning |
| - | - |
| `0` | Success |
| `1` | Usage, network or API error |
| `2` | Rate limited (`429`) |

## Examples

```bash theme={null}
searchia "cloudflare workers"
searchia images "teto kasane" -n 5
searchia news elections --json
searchia suggest sear
searchia "rust async" --urls | head
SEARCHIA_BASE_URL=http://localhost:8787 searchia "test"
```

## Security

* The CLI only makes `http:` and `https:` requests to the configured API origin.
* `open` launches the first result with your system's opener, and only when its address is `http:` or `https:`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.