This major release of Trefle brings a lot of new exciting features, such as distributions, farming fields and blazing fast search.
What changed ?
📦 Endpoints versioning
In order to avoid making breaking changes like this one in the future, API routes are now versionned. So the endpoint
/api/species is now
/api/v1/species. This let you the possibility to update when you're ready for the next releases.
📄 The data scructure changes
One of the biggest struggles we noticed was the pagination. Parsing the pagination links in the response headers was really painful, even if it's a stardard.
To solve this, we decided to include pagination links directly in the JSON response.
Now, all API calls wraps a
data field, along with a
links field, for pagination links, and optionally a
meta fields, for high level informations such as counts.
🔧 Plant and species fields names changes
We removed and added a lot of fields. Most of USDA fields, such as
propagation or products uses were removed, as they were too inaccurates.
You can get:
✂️ The filters and sort parameter changes
In order to avoid any name collision in parameters, filters are now scoped in the
filter parameter. This means that
common_name=mint is now
You now also can exclude null values from results with the
📐 Ranges and orders
You can now query the range of values between two values with the
For example, to query only species with a minimum height between 5 and 20 centimeters:
Filtering on ranges also allow to set only minimum or maximum values. For example:
/api/v1/species?range[maximum_height_cm]=5only return species higher than 5 cm
/api/v1/species?range[maximum_height_cm]=,5only return species lower than 5 cm
🖼 Better plants/species images
Images were fully reviewed, and are now splitted into categories: flower, leaf, habit, fruit, bark and other.
🌍 Species distributions
We began to collect plant locations (ex: France) and establishments (ex: Native) per zone, and they're now included in the
You can also filter species by distribution zones or by establishment.
For example, to get plants native from Tibet:
🔍 Blazing fast search engine
A new search endpoint for plants and species is available:
This search was designed to respond in milliseconds, and is ready for input autocomplete or "as you type" queries. You can see it in action on the landing page.
🧰 Error reporting and data collection
This means a lot to us, as we want our data to be everyone's, and believe strongly in the power of the community.
📕 Adoption of better standards
All units are following the International System of Units (SI), so we replaced feets by centimeters, inches by millimeters and so on. Temperatures are in celcuis and kelvin degrees for now, as the conversion is more complex than for standard units.
Scientific names now follows the Binomial nomenclature. For the species, it represents its genus and its species within the genus, resulting in a single worldwide name for each organism. The scientific name of an infraspecific taxons (ranks below species, such as subspecies, forms, varieties...) is a combination of the name of a species and an infraspecific epithet. A connecting term is used to denote the rank. See IAPT recommendation.
Distribution zones for plants/species are following the World Geographical Scheme for Recording Plant Distributions (WGSRPD).
📦 JSON responses when listing plants and species are more complete
We added some fields in the response, such as an image url or the genus and family names, and embedded synonyms.
For example, when listing plants:
📋 Synonyms separation
Synonyms are no longer returned in the species or plants response, and are now included as an array in the response.
📐 Species fields scales changes
"Scale-like" fields, such as "light" or "soil adaptation" are no longer with values like 'Low', 'Medium' and 'High', but are now on a scale from 0 to 10.
📋 Common names split
Common names have been reviewed, and are now grouped by language.