{"id":21292037,"url":"https://github.com/johnnythetank/angular-youtube-api-factory","last_synced_at":"2026-03-06T01:01:25.258Z","repository":{"id":57179416,"uuid":"45784536","full_name":"JohnnyTheTank/angular-youtube-api-factory","owner":"JohnnyTheTank","description":"AngularJS Factory for Youtube JSON REST API requests","archived":false,"fork":false,"pushed_at":"2017-12-01T08:20:02.000Z","size":55,"stargazers_count":20,"open_issues_count":1,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-17T04:51:40.592Z","etag":null,"topics":["angular","angular-factory","angularjs","api","factory","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohnnyTheTank.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-08T14:48:17.000Z","updated_at":"2023-01-23T12:39:42.000Z","dependencies_parsed_at":"2022-09-11T06:50:37.353Z","dependency_job_id":null,"html_url":"https://github.com/JohnnyTheTank/angular-youtube-api-factory","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyTheTank%2Fangular-youtube-api-factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyTheTank%2Fangular-youtube-api-factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyTheTank%2Fangular-youtube-api-factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyTheTank%2Fangular-youtube-api-factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnnyTheTank","download_url":"https://codeload.github.com/JohnnyTheTank/angular-youtube-api-factory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225741250,"owners_count":17516895,"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","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":["angular","angular-factory","angularjs","api","factory","youtube","youtube-api"],"created_at":"2024-11-21T13:47:17.157Z","updated_at":"2026-03-06T01:01:25.177Z","avatar_url":"https://github.com/JohnnyTheTank.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"**angular-youtube-api-factory** is an angularjs module with a youtube api factory.\n\n[![npm version](https://badge.fury.io/js/angular-youtube-api-factory.svg)](https://badge.fury.io/js/angular-youtube-api-factory)\n[![Bower version](https://badge.fury.io/bo/angular-youtube-api-factory.svg)](https://badge.fury.io/bo/angular-youtube-api-factory)\n\nAuthor: Jonathan Hornung ([JohnnyTheTank](https://github.com/JohnnyTheTank))\n\n## Usage\n\n1. Install via either [bower](http://bower.io/), [npm](https://www.npmjs.com/) or downloaded files:\n    1. `bower install --save angular-youtube-api-factory`\n    2. `npm install --save angular-youtube-api-factory`\n    3. download [angular-youtube-api-factory.zip](https://github.com/JohnnyTheTank/angular-youtube-api-factory/zipball/master)\n2. Include dependencies in your HTML.\n    1. When using bower:\n    ```html\n    \u003cscript src=\"bower_components/angular-youtube-api-factory/dist/angular-youtube-api-factory.min.js\"\u003e\u003c/script\u003e\n    ```\n    2. When using npm:\n    ```html\n    \u003cscript src=\"node_modules/angular-youtube-api-factory/dist/angular-youtube-api-factory.min.js\"\u003e\u003c/script\u003e\n    ```\n    3. when using downloaded files\n    ```html\n    \u003cscript src=\"angular-youtube-api-factory.min.js\"\u003e\u003c/script\u003e\n    ```\n3. Add **`jtt_youtube`** to your application's module dependencies\n  \n    ```JavaScript\n    angular.module('app', ['jtt_youtube']);\n    ```\n4. Use the factory `youtubeFactory`\n\n    ```JavaScript\n    angular.module('app')\n        .controller('appController', function($scope, youtubeFactory){\n        \n            youtubeFactory.getVideosFromSearchByParams({\n                q: 'fcbayern',\n                key: '\u003cYOUR_API_KEY\u003e'\n            }).then(function (data) {\n                console.info('videos from search by query', data);\n            });\n            \n        });\n    ```\n\n\n### factory methods\n\n#### getVideo\n```js\n//docs: https://developers.google.com/youtube/v3/docs/videos/list\nyoutubeFactory.getVideoById({\n    videoId: \"\u003cVIDEO_ID\u003e\",\n    part: \"\u003cYOUR_PART\u003e\", // (optional) default: 'id,snippet,contentDetails,statistics'\n    key: \"\u003cYOUR_API_KEY\u003e\",\n}).then(function (_data) {\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n#### getVideos\n```js\n//docs: https://developers.google.com/youtube/v3/docs/channels/list\nyoutubeFactory.getVideosFromChannelById({\n    channelId: \"\u003cCHANNEL_ID\u003e\", // converter: http://johnnythetank.github.io/youtube-channel-name-converter/\n    q: \"\u003cSEARCH_STRING\u003e\", // (optional) search string\n    location: \"\u003cSEARCH_LOCATION\u003e\", // (optional) The parameter value is a string that specifies latitude/longitude coordinates e.g. '37.42307,-122.08427'.\n    locationRadius: \"\u003cLOCATION_RADIUS\u003e\", // (optional) valid values e.g. '1500m', '5km', '10000ft', and '0.75mi' | default: '5000m'\n    order: \"\u003cORDER_TYPE\u003e\", // (optional) valid values: 'date', 'rating', 'relevance', 'title', 'videoCount', 'viewCount' | default: 'date'\n    maxResults: \"\u003cMAX_RESULTS\u003e\", // (optional) valid values: 0-50 | default: 5\n    publishedAfter: \"\u003cPUBLISHED_AFTER\u003e\", // (optional) RFC 3339 formatted date-time value (1970-01-01T00:00:00Z)\n    publishedBefore: \"\u003cPUBLISHED_AFTER\u003e\", // (optional) RFC 3339 formatted date-time value (1970-01-01T00:00:00Z)\n    regionCode: \"\u003cREGION_CODE\u003e\", // (optional) ISO 3166-1 alpha-2 country code\n    relevanceLanguage: \"\u003cRELEVANCE_LANGUAGE\u003e\", // (optional) ISO 639-1 two-letter language code\n    safeSearch: \"\u003cSAFE_SEARCH\u003e\", // (optional) valid values: 'moderate','none','strict' | defaut: 'moderate'\n    maxResults: \"\u003cMAX_RESULTS\u003e\", // (optional) valid values: 0-50 | default: 5\n    videoEmbeddable: \"\u003cVIDEO_EMBEDDABLE\u003e\", // (optional) valid values: 'true', 'any' | default: 'true'\n    videoLicense: \"\u003cVIDEO_LICENSE\u003e\", // (optional) valid values: 'any','creativeCommon','youtube'\n    videoSyndicated: \"\u003cVIDEO_SYNDICATED\u003e\", // (optional) restrict a search to only videos that can be played outside youtube.com. valid values: 'any','true' | default: 'any'\n    fields: \"\u003cFIELDS\u003e\", // (optional) Selector specifying which fields to include in a partial response\n    nextPageToken: \"\u003cNEXT_PAGE_TOKEN\u003e\", // (optional) either 'nextPageToken' or 'prevPageToken'\n    prevPageToken: \"\u003cPREV_PAGE_TOKEN\u003e\", // (optional) either 'nextPageToken' or 'prevPageToken'\n    part: \"\u003cPART\u003e\", // (optional) default: 'id,snippet'\n    key: \"\u003cYOUR_API_KEY\u003e\",\n}).then(function (_data) {\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n```js\n//docs: https://developers.google.com/youtube/v3/docs/search/list\nyoutubeFactory.getVideosFromSearchByParams({\n    q: \"\u003cSEARCH_STRING\u003e\", // (optional) search string\n    location: \"\u003cSEARCH_LOCATION\u003e\", // (optional) The parameter value is a string that specifies latitude/longitude coordinates e.g. '37.42307,-122.08427'.\n    locationRadius: \"\u003cLOCATION_RADIUS\u003e\", // (optional) valid values e.g. '1500m', '5km', '10000ft', and '0.75mi' | default: '5000m'\n    order: \"\u003cORDER_TYPE\u003e\", // (optional) valid values: 'date', 'rating', 'relevance', 'title', 'videoCount', 'viewCount' | default: 'date'\n    maxResults: \"\u003cMAX_RESULTS\u003e\", // (optional) valid values: 0-50 | default: 5\n    publishedAfter: \"\u003cPUBLISHED_AFTER\u003e\", // (optional) RFC 3339 formatted date-time value (1970-01-01T00:00:00Z)\n    publishedBefore: \"\u003cPUBLISHED_AFTER\u003e\", // (optional) RFC 3339 formatted date-time value (1970-01-01T00:00:00Z)\n    regionCode: \"\u003cREGION_CODE\u003e\", // (optional) ISO 3166-1 alpha-2 country code\n    relevanceLanguage: \"\u003cRELEVANCE_LANGUAGE\u003e\", // (optional) ISO 639-1 two-letter language code\n    safeSearch: \"\u003cSAFE_SEARCH\u003e\", // (optional) valid values: 'moderate','none','strict' | defaut: 'moderate'\n    maxResults: \"\u003cMAX_RESULTS\u003e\", // (optional) valid values: 0-50 | default: 5\n    videoEmbeddable: \"\u003cVIDEO_EMBEDDABLE\u003e\", // (optional) valid values: 'true', 'any' | default: 'true'\n    videoLicense: \"\u003cVIDEO_LICENSE\u003e\", // (optional) valid values: 'any','creativeCommon','youtube'\n    videoSyndicated: \"\u003cVIDEO_SYNDICATED\u003e\", // (optional) restrict a search to only videos that can be played outside youtube.com. valid values: 'any','true' | default: 'any'\n    fields: \"\u003cFIELDS\u003e\", // (optional) Selector specifying which fields to include in a partial response\n    nextPageToken: \"\u003cNEXT_PAGE_TOKEN\u003e\", // (optional) either 'nextPageToken' or 'prevPageToken'\n    prevPageToken: \"\u003cPREV_PAGE_TOKEN\u003e\", // (optional) either 'nextPageToken' or 'prevPageToken'\n    part: \"\u003cPART\u003e\", // (optional) default: 'id,snippet'\n    key: \"\u003cYOUR_API_KEY\u003e\",\n}).then(function (_data) {\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n```js\n//docs: https://developers.google.com/youtube/v3/docs/playlists/list\nyoutubeFactory.getVideosFromPlaylistById({\n    playlistId: \"\u003cPLAYLIST_ID\u003e\",\n    maxResults: \"\u003cMAX_RESULTS\u003e\", // (optional) valid values: 0-50 // default: 5\n    nextPageToken: \"\u003cNEXT_PAGE_TOKEN\u003e\", // (optional) either 'nextPageToken' or 'prevPageToken'\n    prevPageToken: \"\u003cPREV_PAGE_TOKEN\u003e\", // (optional) either 'nextPageToken' or 'prevPageToken'\n    part: \"\u003cPART\u003e\", // (optional) default: 'id,snippet'\n    key: \"\u003cYOUR_API_KEY\u003e\",\n}).then(function (_data) {\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n\n#### getChannel\n```js\n// docs: https://developers.google.com/youtube/v3/docs/search/list\nyoutubeFactory.getChannelById({\n    channelId: \"\u003cCHANNEL_ID\u003e\", // converter: http://johnnythetank.github.io/youtube-channel-name-converter/\n    nextPageToken: \"\u003cNEXT_PAGE_TOKEN\u003e\", // (optional) either 'nextPageToken' or 'prevPageToken'\n    prevPageToken: \"\u003cPREV_PAGE_TOKEN\u003e\", // (optional) either 'nextPageToken' or 'prevPageToken'\n    part: \"\u003cPART\u003e\", // (optional) default: 'id,snippet'\n    key: \"\u003cYOUR_API_KEY\u003e\",\n}).then(function (_data) {\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n\n## Youtube Data JSON API\n* Docs: https://developers.google.com/youtube/v3/docs/\n* API Explorer: https://developers.google.com/apis-explorer/#p/youtube/v3/\n* Youtube Username to Channel ID Converter: http://johnnythetank.github.io/youtube-channel-name-converter/\n\n## More angular-api-factories\n[bandsintown](https://github.com/JohnnyTheTank/angular-bandsintown-api-factory) - [dailymotion](https://github.com/JohnnyTheTank/angular-dailymotion-api-factory) - [facebook](https://github.com/JohnnyTheTank/angular-facebook-api-factory) - [flickr](https://github.com/JohnnyTheTank/angular-flickr-api-factory) - [footballdata](https://github.com/JohnnyTheTank/angular-footballdata-api-factory) - [github](https://github.com/JohnnyTheTank/angular-github-api-factory) - [openweathermap](https://github.com/JohnnyTheTank/angular-openweathermap-api-factory) - [tumblr](https://github.com/JohnnyTheTank/angular-tumblr-api-factory) - [vimeo](https://github.com/JohnnyTheTank/angular-vimeo-api-factory) - [wikipedia](https://github.com/JohnnyTheTank/angular-wikipedia-api-factory) - **youtube**\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnythetank%2Fangular-youtube-api-factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnnythetank%2Fangular-youtube-api-factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnythetank%2Fangular-youtube-api-factory/lists"}