A modern, Composer and PSR-4 compatible PHP library for interfacing with the Wordnik API.
Picnik is a simple PHP client for the Wordnik API, that is Composer and PSR-4 compatible.
Its only dependencies are the GuzzleHttp client and PHP >= 5.4.
The initial goal is to support the
word selection of methods.
methods are implemented.
In order to use the client, you will first need to obtain an API key from Wordnik.
The client is pretty simple to use,
$client = new Picnik\Client; $client->setApiKey('foobar'); $definitions = $client->wordDefinitions('cat') ->limit(1) ->includeRelated(false) ->useCanonical(true) ->get(); var_dump( count($definitions) ); // int(1) var_dump( $definitions->text ) // string(189) "A small carnivorous mammal (Felis catus or F. domesticus) // domesticated since early times as a catcher of rats and mice and as a pet // and existing in several distinctive breeds and varieties."
This library is released under the MIT license. For details, you can refer to the full license document.