# youtube-search

> Search for youtube videos

Latest version **1.1.6** (published 2021-01-29) · BSD license · 0 weekly downloads

## Install

```sh
npm install youtube-search
pnpm add youtube-search
yarn add youtube-search
bun add youtube-search
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2021-01-29 |
| First published | 2013-10-09 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 (+24 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 116 |
| Author | Max Gfeller |
| Maintainers | maxgfeller |
| Keywords | youtube, search, api |

## Links

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

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [xml2js](https://npm.io/package/xml2js.md) ~0.2.8

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.1.6 (latest) — 2021-01-29
- 1.1.5 — 2021-01-29
- 1.1.4 — 2018-12-29
- 1.1.3 — 2018-10-01
- 1.1.2 — 2018-10-01
- 1.1.1 — 2018-05-18
- 1.1.0 — 2018-03-22
- 1.0.11 — 2018-03-21
- 1.0.10 — 2017-06-15
- 1.0.9 — 2017-03-17
- 1.0.8 — 2017-01-23
- 1.0.7 — 2016-12-30
- 1.0.6 — 2016-07-11
- 1.0.5 — 2016-07-11
- 1.0.4 — 2015-07-08
- … 18 more at https://npm.io/package/youtube-search/versions

## README

# youtube-search

[![build status](https://secure.travis-ci.org/MaxGfeller/youtube-search.png)](http://travis-ci.org/MaxGfeller/youtube-search)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Easily search for videos on Youtube using their v3 API.

## Options

You can pass a lot of optional parameters as the second parameter, they are
documented [here](https://developers.google.com/youtube/v3/docs/search/list).

## Rate limiting

Google enforces a rate limit on the Youtube Data API. You will probably need to
register your application for a key and supply this key in the `opts`.

## JavaScript Usage

```javascript
var search = require('youtube-search');

var opts = {
  maxResults: 10,
  key: 'yourkey'
};

search('jsconf', opts, function(err, results) {
  if(err) return console.log(err);

  console.dir(results);
});
```

## TypeScript Usage

A TypeScript definition file is included so that 'youtube-search' can be used
easily from TypeScript.

```typescript
import * as youtubeSearch from "youtube-search";

var opts: youtubeSearch.YouTubeSearchOptions = {
  maxResults: 10,
  key: "yourkey"
};

youtubeSearch("jsconf", opts, (err, results) => {
  if(err) return console.log(err);

  console.dir(results);
});
```

## Tests

To run the tests you need a [Youtube v3 API key](https://console.developers.google.com/apis/credentials):

```bash
API_KEY=<your-api-key> npm test
```

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