I love APIs. I like the power an API gives you, whether it be to simply return some useful data, or to trigger a complex series of actions behind the scenes.
My initial need for an API was to access a service that could quickly get the data I needed before I started my commute in the morning - I found myself wrangling with a bunch of different phone apps and services. It was difficult to get the results I wanted using what was currently available.
So, I decided to try designing my own API to do all the heavy lifting for me. Initially it was a lot of work. In most cases, I’ve needed to dig into website assests that never intended to see the light of day - parsing JSON data and HTML in order to construct some useful JSON out it.
And I’m happy to say… the hard work is paying off!
Once an API is deployed, there are a number of immediate benefits:
the API endpoints are callable from anywhere in the world with an internet connection
sending a request to an API endpoint can be a simple request, but the tasks it triggers can be intricate and complex, especially if you’re API is calling out to a service like AWS Lambda to perform some heavy compute instruction
I’ve created:
custom GUI frontends for my APIs: https://git.sr.ht/~aaronkelly/accomplice
I’ve used a bunch of different API frameworks; flask, node.js, AWS API Gateway… I have to say I find flask the easiest to use!
It’s taking me some time find a killer solution for testing an API that’s been deployed.
I’m currently using https://assertible.com/, which for the moment is good as separate, always-on service that runs in the cloud.
However I have just found https://github.com/sanathp/statusok, and I think this tool could become part of my CI/CD pipeline - it’s open-source and very simple.
[[Using AWS API Gateway]]