GithubHelp home page GithubHelp logo

thorn117 / youtube-search-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from damonwonghv/youtube-search-api

0.0 0.0 0.0 26 KB

Get Youtube Search result without any login or api key

License: MIT License

JavaScript 100.00%

youtube-search-api's Introduction

Youtube Search API

Youtube Search API is an API for getting Youtube search results.

Installation

npm install youtube-search-api

Usage (import)

const youtubesearchapi = require("youtube-search-api");

GetListByKeywords (Promise)

youtubesearchapi.GetListByKeyword("<keywords>",[playlist boolean],[limit number],[options JSONArray])

GetListByKeywords Result

{items:[],nextPage:{nextPageToken:"xxxxxxxx",nextPageContext:{}}}

"items" is the array from youtube, "nextPage" needs to pass when going to the next page. If playlist arg is true, will return type:'playlist' but the videos:[] property will not return the whole videos in the list, need to call GetPlaylistData to get real playlist's videos. Item with Video type will return isLive=[true/false] to identify live video or not.

Options added, this version only support return result type, e.g. [{type:'video'}].

Parameters

Parameter Type Value
keywords String up to you
playlist boolean true/false
limit number integer
options JSON Array [{type:"video/channel/playlist/movie"}]

NextPage (Promise)

youtubesearchapi.NextPage(<nextPage from GetListByKeywords result>,[playlist boolean],[limit number])

NextPage Result

{items:[],nextPage:{nextPageToken:"xxxxxxxx",nextPageContext:{}}}

Item with Video type will return isLive=[true/false] to identify live video or not.

Playlist with ID (Promise)

youtubesearchapi.GetPlaylistData(<Playlist Id>,[limit number])

Playlist Result

{items:[],metadata:{}}

Get Suggest Data (Promise)

youtubesearchapi.GetSuggestData([limit number])

Suggest Data Result

{
  items: [];
}

Item with Video type will return isLive=[true/false] to identify live video or not.

Get Channel by channel Id (Promise)

youtubesearchapi.GetChannelById(<channel ID>)

Channel Data Results

[[{ title: "[title]", content: [Object] }]];

Will return tabs in array format.

Get Video Details with suggestion

GetVideoDetails

youtubesearchapi.GetVideoDetails(<video ID>)

Get Video Details Results

{
  title: "",
  isLive: [true/false],
  channel: ",
  description: ",
  suggestion: [
    {id: "",
      type: 'video',
      thumbnail: [],
      title: "",
      channelTitle: "",
      shortBylineText: "",
      length: [Object],
      isLive: [true/false]
    } ...
  ]
}

Will return video details in Json format.

Message

If you want to work with me to fix bug or implement new idea. You are available to send me some new idea of this project.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

TODO

  1. Web app with show case
  2. Support front-end (Vue, React) (Still on going ...)
  3. Typescript version

Bug fixed

Update

  1. Get List By Keywords support options with type

License

MIT

youtube-search-api's People

Contributors

drivenode avatar damonwonghv avatar jacobpretorius avatar thorn117 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.