{"id":22787563,"url":"https://github.com/aharen/omdbapi","last_synced_at":"2025-04-15T23:39:12.255Z","repository":{"id":43484757,"uuid":"29675183","full_name":"aharen/OMDbAPI","owner":"aharen","description":"PHP class to communicate with OMDbAPI.com API by Brian Fritz","archived":false,"fork":false,"pushed_at":"2023-12-12T13:12:45.000Z","size":28,"stargazers_count":11,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-29T21:45:52.210Z","etag":null,"topics":["episodes","movie","omdb-api","php","series"],"latest_commit_sha":null,"homepage":null,"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/aharen.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,"governance":null}},"created_at":"2015-01-22T11:17:07.000Z","updated_at":"2024-08-03T21:13:04.000Z","dependencies_parsed_at":"2023-12-12T14:30:14.288Z","dependency_job_id":"8e811d07-0ab3-4f2d-a7a5-8e91e56fe611","html_url":"https://github.com/aharen/OMDbAPI","commit_stats":{"total_commits":26,"total_committers":7,"mean_commits":"3.7142857142857144","dds":0.5384615384615384,"last_synced_commit":"d07cc3ce2eeec2f062c3ec6f223a776bc09a8873"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aharen%2FOMDbAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aharen%2FOMDbAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aharen%2FOMDbAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aharen%2FOMDbAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aharen","download_url":"https://codeload.github.com/aharen/OMDbAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229313594,"owners_count":18053714,"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":["episodes","movie","omdb-api","php","series"],"created_at":"2024-12-12T00:58:13.671Z","updated_at":"2024-12-12T00:58:14.200Z","avatar_url":"https://github.com/aharen.png","language":"PHP","funding_links":["https://www.patreon.com/posts/api-is-going-10743518"],"categories":[],"sub_categories":[],"readme":"# OMDbAPI\nPHP class to communicate with OMDbAPI.com API by Brian Fritz\n\n## How to Use\n\nInclude the file \n\n```\ncomposer require aharen/omdbapi\n\n```\n\nOr update your composer.json file accordingly\n\n```\nrequire {\n    \"aharen/omdbapi\" : \"2.0.*\"\n}\n\n```\n\n### Initiating\n\nSince the API will be going private ([read about it](https://www.patreon.com/posts/api-is-going-10743518)) \u0026 would be requiring the API key, a small change has been made to how the API will be initiated and how the Poster API will be used.\n\n```php\nuse aharen\\OMDbAPI();\n\n$omdb = new OMDbAPI($api_key, $image_host, $assoc);\n\n```\n\nThe first parameter will be the API Key, the secound is the host to use (false = omdbapi, true = poster api, false by default) \u0026 third is assoc (true = assoc on, false = assoc off, false by default)\n\n### Search OMDb API\n\nRequires search keyword and accepts type (movie, series or episode) \u0026 year\n\n\n```php\nuse aharen\\OMDbAPI;\n\n$omdb = new OMDbAPI();\n\n$omdb-\u003esearch($keyword, $type, $year);\n\n```\n\nExample usage\n\n\n```php\n$omdb-\u003esearch('spider');\n\n```\n\nOutput\n\n```php\nstdClass Object\n(\n    [code] =\u003e 200\n    [message] =\u003e OK\n    [data] =\u003e stdClass Object\n        (\n            [0] =\u003e stdClass Object\n                (\n                    [Title] =\u003e Spider-Man\n                    [Year] =\u003e 2002\n                    [imdbID] =\u003e tt0145487\n                    [Type] =\u003e movie\n                )\n\n            [1] =\u003e stdClass Object\n                (\n                    [Title] =\u003e The Amazing Spider-Man\n                    [Year] =\u003e 2012\n                    [imdbID] =\u003e tt0948470\n                    [Type] =\u003e movie\n                )\n\n            [2] =\u003e stdClass Object\n                (\n                    [Title] =\u003e Spider-Man 2\n                    [Year] =\u003e 2004\n                    [imdbID] =\u003e tt0316654\n                    [Type] =\u003e movie\n                )\n\n            [3] =\u003e stdClass Object\n                (\n                    [Title] =\u003e Spider-Man 3\n                    [Year] =\u003e 2007\n                    [imdbID] =\u003e tt0413300\n                    [Type] =\u003e movie\n                )\n\n            [4] =\u003e stdClass Object\n                (\n                    [Title] =\u003e The Amazing Spider-Man 2\n                    [Year] =\u003e 2014\n                    [imdbID] =\u003e tt1872181\n                    [Type] =\u003e movie\n                )\n\n            [5] =\u003e stdClass Object\n                (\n                    [Title] =\u003e Along Came a Spider\n                    [Year] =\u003e 2001\n                    [imdbID] =\u003e tt0164334\n                    [Type] =\u003e movie\n                )\n\n            [6] =\u003e stdClass Object\n                (\n                    [Title] =\u003e Spider\n                    [Year] =\u003e 2002\n                    [imdbID] =\u003e tt0278731\n                    [Type] =\u003e movie\n                )\n\n            [7] =\u003e stdClass Object\n                (\n                    [Title] =\u003e Spider-Man\n                    [Year] =\u003e 1994–1998\n                    [imdbID] =\u003e tt0112175\n                    [Type] =\u003e series\n                )\n\n            [8] =\u003e stdClass Object\n                (\n                    [Title] =\u003e Kiss of the Spider Woman\n                    [Year] =\u003e 1985\n                    [imdbID] =\u003e tt0089424\n                    [Type] =\u003e movie\n                )\n\n            [9] =\u003e stdClass Object\n                (\n                    [Title] =\u003e The Spectacular Spider-Man\n                    [Year] =\u003e 2008–2009\n                    [imdbID] =\u003e tt0976192\n                    [Type] =\u003e series\n                )\n\n        )\n\n)\n\n```\n\nUsage examples\n\n```php\n// search for all 'series' that contain 'spider' in the title\n$omdb-\u003esearch('spider', 'series');\n\n// search for all 'series' that contain 'spider' in the title and is from '2014'\n$omdb-\u003esearch('spider', 'series', '2014');\n\n```\n### Associative mode\n\nYou can also use this library in associative mode, resulting in arrays instead of stdClass\ninstances, passing the second constructor argument to true:\n\n```\n// Associative mode (results will be associative arrays)\n$omdb = new OMDbAPI(null, true);\n```\n\n### Fetch movie details\n\nFetch details of a movie, series or episode. details can be fetched by either IMDB ID or the Title\n\nUsage example\n\n```php\n// get details for IMDB ID 'tt0338013'\n$omdb-\u003efetch('i', 'tt0338013');\n\n// get details for title 'eternal sunshine'\n$omdb-\u003efetch('t', 'eternal sunshine');\n```\n\nOutput for both of the above queires\n\n```php\nstdClass Object\n(\n    [code] =\u003e 200\n    [message] =\u003e OK\n    [data] =\u003e stdClass Object\n        (\n            [Title] =\u003e Eternal Sunshine of the Spotless Mind\n            [Year] =\u003e 2004\n            [Rated] =\u003e R\n            [Released] =\u003e 19 Mar 2004\n            [Runtime] =\u003e 108 min\n            [Genre] =\u003e Drama, Romance, Sci-Fi\n            [Director] =\u003e Michel Gondry\n            [Writer] =\u003e Charlie Kaufman (story), Michel Gondry (story), Pierre Bismuth (story), Charlie Kaufman (screenplay)\n            [Actors] =\u003e Jim Carrey, Kate Winslet, Gerry Robert Byrne, Elijah Wood\n            [Plot] =\u003e When their relationship turns sour, a couple undergoes a procedure to have each other erased from their memories. But it is only through the process of loss that they discover what they had to begin with.\n            [Language] =\u003e English\n            [Country] =\u003e USA\n            [Awards] =\u003e Won 1 Oscar. Another 64 wins \u0026 62 nominations.\n            [Poster] =\u003e http://ia.media-imdb.com/images/M/MV5BMTY4NzcwODg3Nl5BMl5BanBnXkFtZTcwNTEwOTMyMw@@._V1_SX300.jpg\n            [Metascore] =\u003e 89\n            [imdbRating] =\u003e 8.4\n            [imdbVotes] =\u003e 533,088\n            [imdbID] =\u003e tt0338013\n            [Type] =\u003e movie\n            [Response] =\u003e True\n        )\n\n)\n```\n\n### Fetching episodes details\n\nYou can also use the `fetch` third parameter to add extra parameters, for instance:\n\n```php\n//                 Dexter (TV show)\n$omdb-\u003efetch('i', 'tt0773262', ['Season' =\u003e 1])\n```\n\nThis will add the `Season=1` parameter\n\n## Credits\n\nUnit Tests \u0026 Associative Mode by [@Gregwar](https://github.com/Gregwar) (Cheers)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faharen%2Fomdbapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faharen%2Fomdbapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faharen%2Fomdbapi/lists"}