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

# Reports

> Show search, invalid URL, and visit reports, and clear report data.

Reports show how visitors use your knowledge base. All commands take a period. For fields and response details, see the [API reference](https://apidocs.neetokb.com/api/reports/popular-searches.md).

## Popular searches

This command lists the keywords visitors search for, with how often.

```bash theme={"system"}
neetokb reports popular-searches
neetokb reports popular-searches --duration last_30_days
```

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--duration` | `string` | | | Period: all\_time (default), last\_24\_hours, last\_7\_days, this\_week, last\_week, last\_30\_days, this\_month, last\_month, this\_quarter, last\_quarter or custom |
| `--end-date` | `string` | | | End date (ISO 8601); needed with --duration custom |
| `--page` | `int` | | `0` | Page number |
| `--page-size` | `int` | | `0` | Items per page (max 100) |
| `--start-date` | `string` | | | Start date (ISO 8601); needed with --duration custom |

`--duration` takes `all_time` (the default), `last_24_hours`, `last_7_days`, `this_week`, `last_week`, `last_30_days`, `this_month`, `last_month`, `this_quarter`, `last_quarter` or `custom`. With `custom`, pass both `--start-date` and `--end-date`, and the start must not be after the end.

## Failed searches

This command lists the searches that found no article. Use this to decide which articles to write next.

```bash theme={"system"}
neetokb reports failed-searches --duration last_7_days
```

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--duration` | `string` | | | Period: all\_time (default), last\_24\_hours, last\_7\_days, this\_week, last\_week, last\_30\_days, this\_month, last\_month, this\_quarter, last\_quarter or custom |
| `--end-date` | `string` | | | End date (ISO 8601); needed with --duration custom |
| `--page` | `int` | | `0` | Page number |
| `--page-size` | `int` | | `0` | Items per page (max 100) |
| `--start-date` | `string` | | | Start date (ISO 8601); needed with --duration custom |

## Invalid URLs

This command lists visited URLs that do not exist, with how often and where the visitor came from. Use this to decide which redirections to add.

```bash theme={"system"}
neetokb reports invalid-urls
neetokb reports invalid-urls --url /gone
```

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--duration` | `string` | | | Period: all\_time (default), last\_24\_hours, last\_7\_days, this\_week, last\_week, last\_30\_days, this\_month, last\_month, this\_quarter, last\_quarter or custom |
| `--end-date` | `string` | | | End date (ISO 8601); needed with --duration custom |
| `--page` | `int` | | `0` | Page number |
| `--page-size` | `int` | | `0` | Items per page (max 100) |
| `--start-date` | `string` | | | Start date (ISO 8601); needed with --duration custom |
| `--url` | `string` | | | Only include this URL |

## Visits

This command shows the visits to the knowledge base for each day, oldest first. It is not paginated.

```bash theme={"system"}
neetokb reports visits --duration this_month
```

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--duration` | `string` | | | Period: all\_time (default), last\_24\_hours, last\_7\_days, this\_week, last\_week, last\_30\_days, this\_month, last\_month, this\_quarter, last\_quarter or custom |
| `--end-date` | `string` | | | End date (ISO 8601); needed with --duration custom |
| `--start-date` | `string` | | | Start date (ISO 8601); needed with --duration custom |

## Clear report data

These commands delete report data. They cannot be undone. With no period, they delete everything of that kind. They return the number of rows deleted, which is 0 when nothing matched. They need the Manage articles permission.

```bash theme={"system"}
neetokb reports clear popular-searches --duration last_month
neetokb reports clear failed-searches
neetokb reports clear invalid-urls --url /gone
```

Each command takes the same period flags as its report, and `clear invalid-urls` also takes `--url`.

### Clear popular searches

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--duration` | `string` | | | Period: all\_time (default), last\_24\_hours, last\_7\_days, this\_week, last\_week, last\_30\_days, this\_month, last\_month, this\_quarter, last\_quarter or custom |
| `--end-date` | `string` | | | End date (ISO 8601); needed with --duration custom |
| `--start-date` | `string` | | | Start date (ISO 8601); needed with --duration custom |

### Clear failed searches

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--duration` | `string` | | | Period: all\_time (default), last\_24\_hours, last\_7\_days, this\_week, last\_week, last\_30\_days, this\_month, last\_month, this\_quarter, last\_quarter or custom |
| `--end-date` | `string` | | | End date (ISO 8601); needed with --duration custom |
| `--start-date` | `string` | | | Start date (ISO 8601); needed with --duration custom |

### Clear invalid URLs

| Flag | Type | Required | Default | Description |
| - | - | - | - | - |
| `--duration` | `string` | | | Period: all\_time (default), last\_24\_hours, last\_7\_days, this\_week, last\_week, last\_30\_days, this\_month, last\_month, this\_quarter, last\_quarter or custom |
| `--end-date` | `string` | | | End date (ISO 8601); needed with --duration custom |
| `--start-date` | `string` | | | Start date (ISO 8601); needed with --duration custom |
| `--url` | `string` | | | Only include this URL |


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