APIs are rough

Written by

in

I decided to create a website to help gardeners make planting decisions like when and what to plant. The plan was to use a weather API to give a forecast and the USDA API to give information on the plants the work in the region the user is in. I wasn’t able to complete it in the end due to some technical issues.

When I began learning how to access APIs I knew it would be a bit tricky. It wound up being harder than I thought. I ran into some problems with formatting the fetch statements and after several grueling hours found out the API docs were wrong and the endpoint I needed was different.
Once that was all figured out it was a matter of handling the data coming in, which caused another problem. I needed to grab the return and pass it to another endpoint and the second endpoint seemed to fail as well. In the end the second endpoint has been throwing a status 200, returning the correct url which shows the data but still won’t allow the data to show up where needed. An odd problem that several people including an instructor couldn’t understand. The fix is still out for investigation.

The rest of the project it was attached to went fairly smooth. I Have a history with HTML and CSS so after a time it all came back to me and I was able to make a nice simple site with a clean look. I used an event listener attached to a checkbox to build my own version of a dark mode feature. When checked it removes background images and reverses all the styles on the page for color. When unchecked it puts back all the original styles and brings back the background image. At the end I decided to add a quick button that opens a mailto link me as a suggestion box.

This project overall challenged my abilities and made me sharpen my rusty skills. This taught me that I need to go ahead and review a few basics that a struggled with while working on this. I look forward to continuing to build my skills.