{"id":20774634,"url":"https://github.com/svenkatreddy/ytjs","last_synced_at":"2026-04-18T15:38:19.387Z","repository":{"id":16069852,"uuid":"18814230","full_name":"svenkatreddy/YTjs","owner":"svenkatreddy","description":"Youtube API v3 Universal Javascript Library for nodeJS, AMD and browser which provides easy API","archived":false,"fork":false,"pushed_at":"2021-04-29T19:14:24.000Z","size":30,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T07:41:23.090Z","etag":null,"topics":["browser","data-api","node","v3","youtube","youtube-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svenkatreddy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-15T20:12:00.000Z","updated_at":"2017-01-27T23:21:06.000Z","dependencies_parsed_at":"2022-08-31T14:02:17.686Z","dependency_job_id":null,"html_url":"https://github.com/svenkatreddy/YTjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/svenkatreddy/YTjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenkatreddy%2FYTjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenkatreddy%2FYTjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenkatreddy%2FYTjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenkatreddy%2FYTjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svenkatreddy","download_url":"https://codeload.github.com/svenkatreddy/YTjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenkatreddy%2FYTjs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268675568,"owners_count":24288300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","data-api","node","v3","youtube","youtube-api"],"created_at":"2024-11-17T12:30:11.002Z","updated_at":"2026-04-18T15:38:14.353Z","avatar_url":"https://github.com/svenkatreddy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"YTjs\n====\n\nYoutube API v3 Universal Javascript Library for nodeJS, AMD and browser which provides easy API\n\nNo Jquery needed.\n\n\n## How to get Youtube API Key\n\n[Click here](http://help.dimsemenov.com/kb/wordpress-royalslider-tutorials/wp-how-to-get-youtube-api-key)\n\n\n## Node JS \n\nExample\n    \n    var youtube = require('ytjs')(\"API KEY\");\n    \n    youtube.getdata({ videoId: \"TlgqWeuhJj4\"},function(err, result){\n        if(err) {\n          console.log(err);\n          return false;\n        }\n        console.log(result);\n    });\n\n\n## Browser\n\ninclude yt.js\n\n    \u003cscript type=\"text/javascript\" src=\"yt.js\" \u003e\u003c/script\u003e\n\nInitalize the library and get Data\n\n    var youtube  = $youtube(\"API KEY\");\n\n     youtube.getdata({ videoId: \"TlgqWeuhJj4\" },function(err, result){\n        if(err) {\n          console.log(err);\n          return false;\n        }\n        console.log(result);\n     });\n            \n    youtube.getdata({ videoId: \"PMr2NRPdpH4\"}, function(err, result){\n        if(err) {\n          console.log(err);\n          return false;\n        }\n        console.log(result);\n    });\n\n\nMethods Available\n\n1. getdata\n2. search\n3. getComments\n4. getRelatedVideos\n    \n\n### get video data (getdata)\n\n    youtube.getdata({ videoId: \"TlgqWeuhJj4\" },function(err, result){\n        if(err) {\n          console.log(err);\n          return false;\n        }\n        console.log(result);\n     });\n\n### Searching for Videos (search)\n    \n    youtube.search({keyword: \"rihanna love\", fullResults: 1, order: \"relevance\"}, function(err, data){\n        if(err) {\n          console.log(err);\n          return false;\n        }\n        console.log(data);\n    });\n\n### Comments (getComments)\n\n    youtube.getComments({videoId: \"PMr2NRPdpH4\"}, function(err, data){\n        if(err) {\n          console.log(err);\n          return false;\n        }\n        console.log(data);\n    });   \n    \n### Related videos (getRelatedVideos)\n\n    youtube.getRelatedVideos({videoId: \"PMr2NRPdpH4\"}, function(err, data){\n        if(err) {\n          console.log(err);\n          return false;\n        }\n        console.log(data);\n    });       \n\n## Options\n\n\n### getdata\n\n1. videoId : youtube video id\n2. part: \"snippet,statistics,contentDetails\"  // you can pass either of three orcombination or all\n\n\n#### output format (getdata)\n\nYou can get wide variety of data from `getdata` method and always youtube original data can be referred in `raw`\n\n    \"title\":\n    \"description\":\n    \"rating\":\n    \"views\":\"\",\n    \"publishedAt\":\n    \"dthumbnail\":\n    \"mthumbnail\":\n    \"hthumbnail\":\n    \"sthumbnail\":\n    \"categoryId\":\n    \"channelTitle\":\n    \"videoId\":\"\",\n    \"duration\":\n    \"mins\":\n    \"hr\":\n    \"secs\":\n    \"dimension\":\n    definition\":\n    caption\":\n    licensedContent\":\n    \"viewCount\":\n    \"likeCount\":\n    \"dislikeCount\":\n    \"favoriteCount\":\n    \"commentCount\":\n    \"kind\":\n    \"channelId\":\n    \"thumbnails\":{}\n    \"tags\":{}\n    \"liveBroadcastContent\":\"none\"\n    \"localized\":{}\n    \"projection\":\n    \"raw\":{}\n    \n\n### search\n\n1. keyword : keyword for search\n2. order: \"relevance\"  // date, rating, viewCount, videoCount, title\n3. type : \"basic\" // \"detailed\" will provide additional information for each search video\n4. navigate : \"next\" // would render next set of results as youtube only allows 50 videos at a time\n\n\n#### output format (search)\n\nYou can get wide variety of data from `search` method. Results of search will be returned in `videos` array and always youtube original data can be referred in `raw`\n\n    \"videos\" : []\n    nextPageToken:\n    prevPageToken:\n    kind:\n    \n### comments\n\n```\nyoutube.getComments({videoId: \"PMr2NRPdpH4\"}, function(err, data){\n    if(err) {\n      console.log(err);\n      return false;\n    }\n    console.log(data);\n    nextComments();\n});\n\n// next set of comments\nfunction nextComments() {\n    youtube.getComments({videoId: \"PMr2NRPdpH4\", navigate: \"next\"}, function(err, data){\n        if(err) {\n          console.log(err);\n          return false;\n        }\n        console.log(data);\n    });\n}\n\n```        \n\n\n### output format  (getComments)\n\nYou can get wide variety of data from `getComments` method. Results of comments will be returned in `items` array and always youtube original data can be referred in `raw`\n\n`items` array item usually have different values such as `textDisplay`, `authorDisplayName`, `authorProfileImageUrl`, `likeCount` etc\n\n    items : []\n    nextPageToken:\n    prevPageToken:\n    resultsPerPage:\n    raw:\n\n\n### Related videos (getRelatedVideos)\n\n    youtube.getRelatedVideos({videoId: \"PMr2NRPdpH4\"}, function(err, data){\n        if(err) {\n          console.log(err);\n          return false;\n        }\n        console.log(data);\n    });    \n\n### output format  (getRelatedVideos)\n\nYou can get wide variety of data from `getRelatedVideos` method. Results of related videos will be returned in `videos` array and always youtube original data can be referred in `raw`\n\n    \"videos\" : []\n    nextPageToken:\n    prevPageToken:\n    kind:\n\n### debug mode\n\nDebug mode will print details to your console. you can enable debug mode during intialization by passing `true`\n\n    var youtube  = $youtube(\"API KEY\", true);\n\n## Implemented Features\n\n[ x ] get Video Data\n\n[ x ] search for videos\n\n[ x ] get Comments\n\n[ x ] npm module\n\n[ x ] related videos\n\n## Upcoming Plan\n\n[ ] Please open an issue\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvenkatreddy%2Fytjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvenkatreddy%2Fytjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvenkatreddy%2Fytjs/lists"}