1.2.0 • Published 2 years ago

youtube-suggest v1.2.0

Weekly downloads
277
License
Apache-2.0
Repository
github
Last release
2 years ago

youtube-suggest

get youtube search suggestions for a query, in node.js and the browser

Install - Usage - License: Apache-2.0

npm ci status standard

Install

npm install youtube-suggest

Usage

var youtubeSuggest = require('youtube-suggest')
var assert = require('assert')

youtubeSuggest('query').then(function (results) {
  assert(Array.isArray(results))
  assert(typeof results[0] === 'string')
})

API

youtubeSuggest(query: string, opts?: { locale?: string }): Promise<string[]>

Do a network request for suggestions, returning the suggested completion strings as an array.

Optionally specify an ISO639-1 language code to get completions intended for that locale:

youtubeSuggest('pet', { locale: 'en' }) // returns people named "peter", pet video titles, etc
youtubeSuggest('pet', { locale: 'fr' }) // returns various small things

In Node.js it uses node-fetch. In the browser it uses JSONP.

License

Apache-2.0

1.2.0

2 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

4 years ago

1.0.0

4 years ago