Youtube API Client
![Coverage Status](https://coveralls.io/repos/github/cauequeiroz/youtube-api-client/badge.svg?branch=master)
A simple client to work with the Youtube API.
Installation
$ npm install youtube-api-client --save
How to use
ES6
import YoutubeAPI from 'youtube-api-client';
const youtube = new YoutubeAPI({
apiKey: 'YOUR_TOKEN_HERE'
});
youtube.getSearchResultsFor('Five Finger Death Punch');
CommonJS
const youtube = require('youtube-api-client');
const youtube = new YoutubeAPI({
apiKey: 'YOUR_TOKEN_HERE'
});
youtube.getSearchResultsFor('Asking Alexandria');
UMD in Browser
<script src="youtube-api-client.js"></script>
<script src="youtube-api-client.min.js"></script>
After that the library will be available to the Global as YoutubeAPI
. Follow an example:
const youtube = new YoutubeAPI({
apiKey: 'YOUR_TOKEN_HERE'
});
youtube.getSearchResultsFor('Angra');
Methods
Follow the methods that the library provides.
getSearchResultsFor(query)
Search for youtube videos with provided query.
Arguments
Argument | Type | Options |
---|
query | string | 'Any search query' |
Example
youtube.getSearchResultsFor('Pink Floyd')
.then(result => {
});
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details