{"id":21660924,"url":"https://github.com/pedramardakani/api_php_fetch_trailer","last_synced_at":"2026-04-13T23:03:26.379Z","repository":{"id":74024939,"uuid":"397514694","full_name":"pedramardakani/API_PHP_Fetch_Trailer","owner":"pedramardakani","description":"A minimal working example of creating and authenticating a php GET request to an API, and converting the JSON response to a php object.","archived":false,"fork":false,"pushed_at":"2021-08-19T09:35:54.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-03-20T05:30:32.858Z","etag":null,"topics":["api","json","movie","oop","php","trailer","youtube"],"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/pedramardakani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-18T07:39:06.000Z","updated_at":"2021-08-19T09:35:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"414748c1-b76e-46ac-9aa7-a15ad1ac97f3","html_url":"https://github.com/pedramardakani/API_PHP_Fetch_Trailer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pedramardakani/API_PHP_Fetch_Trailer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramardakani%2FAPI_PHP_Fetch_Trailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramardakani%2FAPI_PHP_Fetch_Trailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramardakani%2FAPI_PHP_Fetch_Trailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramardakani%2FAPI_PHP_Fetch_Trailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedramardakani","download_url":"https://codeload.github.com/pedramardakani/API_PHP_Fetch_Trailer/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramardakani%2FAPI_PHP_Fetch_Trailer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31774547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: 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":["api","json","movie","oop","php","trailer","youtube"],"created_at":"2024-11-25T09:39:18.991Z","updated_at":"2026-04-13T23:03:26.345Z","avatar_url":"https://github.com/pedramardakani.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Table of Contents\n\n1.  [Minimal PHP code to retrieve movie trailer links from TMDb API](#orgdcc75b6)\n\n\n\u003ca id=\"orgdcc75b6\"\u003e\u003c/a\u003e\n\n# Minimal PHP code to retrieve movie trailer links from TMDb API\n\n*This example code uses the TMDb API but is not endorsed or certified by TMDb.*\n\n1.  Subscribe to [TMDb](https://www.themoviedb.org/signup) with a valid email address\n\n2.  Get the [API validation](https://developers.themoviedb.org/3/getting-started/introduction) key\n\n3.  Read [terms-of-use](https://www.themoviedb.org/documentation/api/terms-of-use)\n\n4.  [Authenticate](https://developers.themoviedb.org/3/authentication/how-do-i-generate-a-session-id) the api\n\n5.  Use the [manual](https://developers.themoviedb.org/3/movies/get-movie-details)\n\n6.  Add the video ID like this:\n\n    `https://www.youtube.com/watch?v={{video_id}}`\n\n7.  Check if PHP `cURL` is available already `curl --version` if not,\n    just [Configure curl](https://www.php.net/manual/en/book.curl.php) on machine\n\n8.  Use the `cURL` [documentation](https://www.php.net/manual/en/curl.examples-basic.php) to write a simple script\n\n9.  Get the trailer link via TMDb API\n\n10. Embed youtube trailer of the movie like this:\n\n        \u003c?php\n        // A simple example key:\n        $trailer_key = 'G4_ULVw5L04';\n        $trailer_url = 'https://www.youtube.com/embed/' . $trailer_key;\n\n        // Minimal iframe\n        $embed_this = '\u003ciframe src=\"' . $trailer_url . '\"\u003e\u003c/iframe\u003e';\n        ?\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedramardakani%2Fapi_php_fetch_trailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedramardakani%2Fapi_php_fetch_trailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedramardakani%2Fapi_php_fetch_trailer/lists"}