vkollin/trefle-php-client

Trefle API client

v0.1.0 2023-04-23 11:49 UTC

This package is auto-updated.

Last update: 2024-04-23 14:08:20 UTC


README

This is a client for trefle.io.

Installation

composer require vkollin/trefle-php-client

Usage

$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();

Implemented endpoints

Species

Plants

Genus

Families

DivisionOrders

DivisionClasses

Divisions

Subkingdoms

Kingdoms