{"id":20084074,"url":"https://github.com/mettle/big-huge-thesaurus-client","last_synced_at":"2025-05-06T01:31:41.004Z","repository":{"id":44618833,"uuid":"163967349","full_name":"mettle/big-huge-thesaurus-client","owner":"mettle","description":"PHP Wrapper for the Big Huge Labs Thesaurus API","archived":false,"fork":false,"pushed_at":"2022-02-04T09:21:01.000Z","size":18,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-17T19:06:12.243Z","etag":null,"topics":[],"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/mettle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-03T11:59:24.000Z","updated_at":"2023-11-06T14:50:50.000Z","dependencies_parsed_at":"2022-09-01T04:52:48.770Z","dependency_job_id":null,"html_url":"https://github.com/mettle/big-huge-thesaurus-client","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mettle%2Fbig-huge-thesaurus-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mettle%2Fbig-huge-thesaurus-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mettle%2Fbig-huge-thesaurus-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mettle%2Fbig-huge-thesaurus-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mettle","download_url":"https://codeload.github.com/mettle/big-huge-thesaurus-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252604322,"owners_count":21775082,"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":[],"created_at":"2024-11-13T15:50:15.294Z","updated_at":"2025-05-06T01:31:40.752Z","avatar_url":"https://github.com/mettle.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BigHugeThesaurusClient\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE.md)\n[![Total Downloads][ico-downloads]][link-downloads]\n\nPHP Wrapper for the [Big Huge Labs Thesaurus API](http://words.bighugelabs.com/).\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require mettle/big-huge-thesaurus-client\n```\n\n## Usage\n\n``` php\n$API_KEY = 'Get an api key @ https://words.bighugelabs.com/api.php';\n\n$client = new Mettleworks\\BigHugeThesaurusClient\\BigHugeThesaurusClient($API_KEY);\n$response = $client-\u003elookup('love');\n```\n\nThe response object is an instance of `ThesaurusResponse`, an object that wraps the original response and adds a few convenience methods. You can optionally pass an argument to each method to indicate if you want only nouns (`noun`), verbs (`verb`), adjectives (`adjective`) or adverbs (`adverb`) otherwise they will return all results combined. The signature of the methods is the following:\n\n```php\n/**\n * Get the synonyms from the response\n */\n$response-\u003egetSynonyms($type = null): array\n\n/**\n * Get the antonyms from the response\n */\n$response-\u003egetAntonyms($type = null): array\n\n/**\n * Get the similar terms from the response\n */\n$response-\u003egetSimilarTerms($type = null): array\n\n/**\n * Get related terms from the response\n */\n$response-\u003egetRelatedTerms($type = null): array\n\n/**\n * Cast response to array (returns the original response)\n */ \n$response-\u003etoArray(): array\n\n/**\n * Cast response to JSON\n */\n$response-\u003etoJson()\n```\n\nThe client throws specific exceptions when an error occurs. Those errors are documented on the [Big Huge Thesaurus Api Page](https://words.bighugelabs.com/api.php).\n\n```php\ntry {\n    $response = $client-\u003elookup('love');\n} catch (NotFoundException $ex) {\n    // Not Found\n} catch (UsageExceededException $ex) {\n    // Usage exceeded\n} catch (InactiveKeyException $ex) {\n    // Key not active\n} catch (MissingWordsException $ex) {\n    // No words provided\n} catch (NotWhitelistedException $ex) {\n    // IP address blocked\n}\n```\n\nAdditionally if an error occurs outside the listed ones, the original Guzzle Exception is thrown.\n \n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email maurizio@mettle.io instead of using the issue tracker.\n\n## Credits\n\n- [Maurizio Bonani](https://github.com/mauricius)\n- [Grant Janecek](https://github.com/grantjanecek)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/mettle/big-huge-thesaurus-client.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/mettle/big-huge-thesaurus-client.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/mettle/big-huge-thesaurus-client\n[link-downloads]: https://packagist.org/packages/mettle/big-huge-thesaurus-client\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmettle%2Fbig-huge-thesaurus-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmettle%2Fbig-huge-thesaurus-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmettle%2Fbig-huge-thesaurus-client/lists"}