Project: Incorporating Kindwise's Plant API

The process of connecting a plant identifier to this website.

By Tykwon Gavins

Project Duration: October 8, 2024 - October 20, 2024

Budget: Free (but it will need to periodically be renewed and adjusted)

Table of Contents

  1. Executive Summary
  2. Project Overview
  3. Project Analysis
  4. Preliminary research and evalution
  5. Project Milestones
  6. Breakthroughs or realizations that steered me to completion
  7. Challenges
  8. Project impediments, foreseen or not
  9. Solutions
  10. How I adapted this project accordingly
  11. Visual Data
  12. Photos, surveys, and figures
  13. Results
  14. Conclusion
  15. Next...

This was the integration of plant-identifying software into our website, using kindwise.com’s database, definitions, and diagnoses. It is, in several ways, the culmination of our coding instruction in Change Food for Good’s introductory course.

This program is a handy preliminary or supplementary means of identifying unfamiliar plants or health issues, which can be great for inexperienced growers like myself. Though useful and fun, it should not be relied upon exclusively.

An Application Programming Interface (API) allows disparate pieces of software (like two different websites) to collaborate to conduct functions and relay information. In this case, we students each coded an API to access Kindwise’s generous plant identifying service through our own websites.

We enlisted this API for its availability, free trials, and relative ease (though not simplicity) of implementation. As previously stated, access to an application like this is a helpful tool for growers, and useful for anyone seeking to learn more about their local flora. There also exists the potential to help improve Kindwise’s database with any corrections or further information one may have. At the start of our course, I used an alumni's API to check the health of apple trees in my neighborhood. It has already served not only to sate my own curiosity, but (to my surprise) may also help some of my local librarians better tend their plants!

The main vice of this API is its relatively small count of free-use tokens, and how readily they can be expended. A user spends one each time they click the Submit button, whether they’ve received/awaited a result or not. But this fault presents fun opportunity to find ways to limit user click inputs through Javascript, which I’d love to eventually explore.

Kindwise’s service also offers insect and fungus identifiers, which I’m thrilled to later incorporate thanks to my own curiosity.

an infected apple tree a few minutes away from my dwelling
During our first week of class, I got to use an alumni's plant identifier on an apple tree near my neighborhood. Its yield was much smaller than the year before (2023.) The identifier believed it to have a fungal infection.

To employ this API, we of course first needed a page to connect it to! Throughout our months in this course, we crafted portfolio sites (like the one you see here.) The API resides on our Plant ID pages.

The next step was to create a free Kindwise account, note our ID keys, and include all of the relevant information to make the API call functional. To list a few, that includes the js script source and all of the many properties, values, and variables that the sites need to properly intercommunicate.

With over 200 lines of code, it was quite an undertaking, even with our instructors’ help. But it was equally important to create lines of comments to know the importance of each segment, and troubleshoot it all until it worked. Any time this API runs through its supply of tokens, I’ll have to make a new key and change the code accordingly, but that should be far simpler than building the API was to begin with.

In effect, any rudimentary knowledge we gained throughout this course and needed for this task was a milestone. That’s all of the html (and css) we used to build these sites in the first place, knowledge of javascript variables, functions, and property-value pairs, and comprehension of what an API is. But the largest steps towards this integration were likely...

The primary challenge of this project was troubleshooting my code. With so many lines of content, there are many potential errors. While course alumnis guided us and provided framework, all of that had to be adapted to the way we chose to name, classify, and arrange elements on our site. It ultimately took the help of two instructors and a close friend who worked as a back-end web developer to fully resolve, and by the time I did, I had already expended nearly half of my free use tokens.
As is sometimes the case in coding, the issue was comically minute, too.

While it isn't yet a problem, I will eventually have to create a new key and adjust the code of the plant identifier page accordingly. Those free tokens will vanish especially fast once I adjoin other APIs (insect and mushroom,) since they all share the same account.

I've also realized that my code doesn't remove the results from previous submissions when one makes consecutive API calls with different results, and want to resolve that. Perhaps there exists a function to not only hide a previous API result, but also store it until a visitor leaves the page or even offer it as a document.

Despite the breadth and density of code, the biggest issue was minor—I used back ticks (`) instead of single or double quotes for a few items in my html file, which invalidated them! There are still refinements to make, but it is thankfully functional.

[Coming Soon]

Though I have some improvements to make to the page and its code, I'm very happy with Kindwise's API. It gives me new ways to enjoy my many outdoor photos of plants, and even the chance to potentially learn about ones my friends in other countries see. Through it, I've learned that an apple tree in my neighborhood may be suffering a fungal infection.

On November 27, 2024, I even used it to check on some plants at one of my local libraries. The species identification seems accurate, and I'm all the more excited to add additional APIs and pages over the coming months.

Getting this API to function fully was careful work, but fun and thoroughly worthwhile. I welcome the need to periodically refresh my account, since it gives further incentive to periodically improve this website. Kindwise's database and experience seems impressive!

Look for insect and fungus APIs to join this website in the near future!

Have you ways to bolster this project?