Trefle is a free plants database API to get scientific data about different plants. Here this API lets you query data about almost any specific plant and you can fetch some important characteristics and scientific data about it. It returns data in JSON format that you can use anywhere you like. When you make an API call, it return the data like genus, common name, scientific name, family, kingdom, slug, and some other additional parameters. You can see all this data in JSON and then use it anywhere you like. The plants data can be used in gardening mobile apps or web applications.
There is a long list of known and unknown plants on this planet. And there are some websites there that provides a database for that. But, there are very few services that provide you API for the plants data. And if you are developer and want that data for your apps then you can rely on this plants database API by Trefle. There is an endpoint defined in the API docs that you can use to send the API requests . The formatted data it returns is very useful. However, this API is still in beta so it may not show complete data now. But after the beta phase is over, it will be so much better.
Free Plants Database API to get Scientific Data About Plants:
If you have ever used an API before then it will be quite easy to use this one. You can make the API calls either from command line using cURL or you can use any internet browser to do the same. You can copy the JSON data and then simply use that anywhere you like. For using this API the first thing you need to do is get an API key.
Go to the homepage of Trefle and then simply sign up for a free account. After that, copy the API key and then go through the API docs once for more technical details.
Now create the API call URL and then simply add the token in it. After that, either use cURL or paste the URL in the browser to get the response. Below are few examples that you can try.
To search a plant by its name, use the following syntax of the API.
To query a specific family:
To query a specific genus, use the following API call URL.
Note: To get the Plant_ID, you will first have to query it in database using the first API URL that I have mentioned.
In the above examples, you can see how this plants API works. You can easily see the JSON responses that it produces. And you can easily use that JSON data in your apps or other programming works. And if you want data in other formats then you can do that. There are plenty of tools to convert JSON to CSV, XML, etc.
Trefle is really useful plants database API that you can use right now. There is a very simple way to send requests to the AI endpoints and retrieve data. And the database is huge right now and expanding. Also, this API is currently in beta stage so there are some minor downtimes and incomplete parameters. But they will be fixed as soon is enters the stable state.