项目作者: webdevel

项目描述 :
YouTube Search Google API for Node.js. Search for YouTube videos, channels, playlists and live events via Google API for Node.js.
高级语言: JavaScript
项目地址: git://github.com/webdevel/youtube-search-google-api.git
创建时间: 2017-10-28T22:28:53Z
项目社区:https://github.com/webdevel/youtube-search-google-api

开源协议:MIT License

下载


Youtube Search Google API

Build Status
Coverage Status
Version
License
Downloads
Dependencies

YouTube Search Google API for Node.js. Search for YouTube videos, channels, playlists and live events via Google API for Node.js.

Installing

This module is designed to be usable via server-side for Node.js or in a browser client-side.

  1. npm install youtube-search-google-api

Configuration

There are 2 HTTP clients provided request and xhr. They handle the server-side and client-side respectively.

Browser Support

For Browserify, add a browser field to your package.json:

  1. "browser": {
  2. "request": "xhr"
  3. }

For Webpack, add a resolve.alias field to your configuration:

  1. "resolve": {
  2. "alias": {
  3. "request$": "xhr"
  4. }
  5. }

Usage

Authorization via Google API Key or OAuth 2.0 token is required by Google. More information regarding Google authentication can be found at Calling the API. All other parameters are optional.

  1. import { YouTube, SearchRequest } from 'youtube-search-google-api'
  2. const youtube = new YouTube()
  3. youtube.search(new SearchRequest(
  4. {
  5. query: {
  6. key: 'AlzaSydu39i6-bseHDgCfG_SNE_hQwuGdc53Vws',
  7. maxResults: 50,
  8. order: 'viewCount',
  9. type: 'video',
  10. publishedAfter: '2017-10-01T00:00:00Z',
  11. q: 'pumpkin|halloween+dog -cat'
  12. }
  13. }, function(error, response, body) {
  14. // Handle the response...
  15. }))

Dependencies

This module depends on the following.

Contributing

Please read Contributing. Feel free to submit pull requests, issues and comments! Thank you. Participants will be added to the list of Contributors.

Alternatives

There is also a light weight alternative to this module Youtube Search.

License

YouTube Search Goggle API is Free and Open Source Software. It is licensed by the MIT License.