vkollin/trefle-php-client

Trefle API client

Maintainers

Package info

github.com/vkollin/trefle.io-php

pkg:composer/vkollin/trefle-php-client

Statistics

Installs: 231

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

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

This package is auto-updated.

Last update: 2026-03-23 18:38: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