{"id":43397099,"url":"https://github.com/cp6/php-youtube-api","last_synced_at":"2026-02-02T14:39:04.583Z","repository":{"id":56957942,"uuid":"396199641","full_name":"cp6/php-youtube-api","owner":"cp6","description":"Just a PHP YouTube API wrapper for searching videos and getting channel/video/playlist data.","archived":false,"fork":false,"pushed_at":"2023-04-25T11:49:25.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-07T21:00:24.514Z","etag":null,"topics":["youtube","youtube-api"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/cp6.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":"2021-08-15T03:13:53.000Z","updated_at":"2021-10-14T04:46:26.000Z","dependencies_parsed_at":"2022-08-21T04:40:19.890Z","dependency_job_id":null,"html_url":"https://github.com/cp6/php-youtube-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cp6/php-youtube-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cp6%2Fphp-youtube-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cp6%2Fphp-youtube-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cp6%2Fphp-youtube-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cp6%2Fphp-youtube-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cp6","download_url":"https://codeload.github.com/cp6/php-youtube-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cp6%2Fphp-youtube-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29013179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T12:48:30.580Z","status":"ssl_error","status_checked_at":"2026-02-02T12:46:38.384Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["youtube","youtube-api"],"created_at":"2026-02-02T14:39:03.886Z","updated_at":"2026-02-02T14:39:04.575Z","avatar_url":"https://github.com/cp6.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP YouTube API wrapper\n\nJust a PHP YouTube API wrapper for searching videos and getting channel/video/playlist data and information.\n\n## Usage\n\n```shell\ncomposer require corbpie/yt-api\n```\n\nPut your YouTube API key at line 9 of ```src/YTAPI.php```\n\nUse the class with:\n\n```php\nrequire_once('vendor/autoload.php');\n\nuse Corbpie\\YouTubeApiClass\\YTAPI;\n\n$yt = new YTAPI();\n```\n\n## Searching videos\n\n**Search a channel**\n\nThis will gets 25 videos from the NBA channel with the query \"Jordan\" sorted by view count\n\n```php\n$yt-\u003esetChannelId('UCWJ2lWNubArHWmf3FIHbfcQ');\n$yt-\u003egetVideoSearch('Jordan', 'viewCount', 25);\n```\n\n**Search everywhere**\n\nJust dont set channelId to search all of YouTube (Not a channel specific)\n\n```php\n$yt-\u003egetVideoSearch('Jordan', 'viewCount', 25);\n```\n\n**Get latest videos from a channel**\n\nGet 25 videos sorted by date published (recent -\u003e oldest)\n\n```php\n$yt-\u003esetChannelId('UCWJ2lWNubArHWmf3FIHbfcQ');\n$yt-\u003egetVideoSearch('', 'date', 25);\n```\n\n\n**Order types:**\n\n* date\n* rating\n* relevance\n* title\n* videoCount\n* viewCount\n\n```results``` amount is capped at max 50.\n\n## Video information\n\n```php\n$yt-\u003esetVideoId('1fjhIWJSxfw');\n$yt-\u003egetVideoData();\n```\n\n## Channel information\n\n```php\n$yt-\u003esetChannelId('UCWJ2lWNubArHWmf3FIHbfcQ');\n$yt-\u003egetChannelData();\n```\n\nGet channel playlists (Requires channelId to have been set):\n\n```php\n$call-\u003egetChannelPlaylistsData(50);\n```\n\n## Playlist videos\n\n```php\n$yt-\u003esetPlaylistId('UCWJ2lWNubArHWmf3FIHbfcQ');\n$yt-\u003egetPlaylistsData();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcp6%2Fphp-youtube-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcp6%2Fphp-youtube-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcp6%2Fphp-youtube-api/lists"}