# niconico-search-api

> Niconico Search API wrapper with typescript support.

Latest version **1.0.1** (published 2021-04-03) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install niconico-search-api
pnpm add niconico-search-api
yarn add niconico-search-api
bun add niconico-search-api
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-04-03 |
| First published | 2020-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.2 KB |
| Known vulnerabilities | 0 (+25 in 2 direct dependencies) |
| Install scripts | no |
| Author | blackrose514 |
| Maintainers | blackrose514 |
| Keywords | niconico, api, typescript |

## Links

- npm: https://www.npmjs.com/package/niconico-search-api
- Repository: https://github.com/blackrose514/niconico-search-api
- Homepage: https://github.com/blackrose514/niconico-search-api#readme
- Issues: https://github.com/blackrose514/niconico-search-api/issues
- npm.io page: https://npm.io/package/niconico-search-api

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.21.0
- [fast-xml-parser](https://npm.io/package/fast-xml-parser.md) ^3.17.4

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-04-03
- 1.0.0 — 2021-04-03
- 0.2.3 — 2020-11-28
- 0.2.2 — 2020-11-27
- 0.2.1 — 2020-11-26
- 0.2.0 — 2020-11-24
- 0.1.0 — 2020-11-19

## README

## Installation

```bash
npm install niconico-search-api
```

## Usage

```js
import search from "niconico-search-api"

const { data, meta } = await search({
  q: "東方自作アレンジ",
  targets: ["tagsExact"],
  fields: ["title", "viewCounter", "contentId"],
  sort: "-viewCounter",
  limit: 20,
})
```

## Methods

- search (params: [SearchParams](#params)) : Promise\<[SearchAPIResponse](#response)\>

#### Params

| params   | Type             | Note                                                         |
| -------- | ---------------- | ------------------------------------------------------------ |
| q        | string           |
| targets  | string[]         |
| fields?  | string[] or "\*" | Fields to include in response data. <br>"\*" --> all fields. |
| filters? | object           |
| sort     | string           | e.g. "-viewCouner", "+lastCommentTime" etc                   |
| offset?  | number           | Default: 0 / Max: 100000                                     |
| limit?   | number           | Default: 10 / Max: 100                                       |
| context? | string           | Max: 40 characters                                           |

## Response

```js
meta: {
  id: string
  status: number
  totalCount: number
}
data: ResponseData
```

```ts
// ResponseData (all)
[
  {
    contentId: string
    title: string
    description: string
    viewCounter: number
    mylistCounter: number
    lengthSeconds: number
    thumbnailUrl: string
    startTime: string
    lastResBody: string
    commentCounter: number
    lastCommentTime: string
    categoryTags: string
    tags: string
    genre: string
  },
  //...
]
```

## API Docs

https://site.nicovideo.jp/search-api-docs/snapshot

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/niconico-search-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
