vkollin / trefle-php-client
Trefle API客户端
v0.1.0
2023-04-23 11:49 UTC
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.5
Requires (Dev)
- phpunit/phpunit: ^10.1
- slevomat/coding-standard: ^8.11
- squizlabs/php_codesniffer: ^3.7
- vimeo/psalm: ^5.9
README
这是一个trefle.io的客户端。
安装
composer require vkollin/trefle-php-client
使用方法
$trefleClient = TrefleClient::create('your-token'); // get a specific species $sunflowerSpecies = $trefleClient->getSpecies('helianthus-annuus')->getSpecies(); // get a specific plant $sunflowerPlant = $trefleClient->getPlant('helianthus-annuus')->getPlant(); // search for species matching a query $searchRequest = (new SearchRequest())->setQuery('oak')->setLimit(5); $searchResults = $trefleClient->searchSpecies($searchRequest)->getSpecies();