youtube-api-client
v1.0.2
Published
A simple client to work with Youtube API.
Downloads
8
Readme
Youtube API Client
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
<!-- to import non-minified version -->
<script src="youtube-api-client.js"></script>
<!-- to import minified version -->
<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 => {
// do what you want with the 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
| | |:---------------------:| | Caue Queiroz |
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