A simple website and API for downloading and printing geocache information for offline use
If you enjoy geocaching, you might want to go paperless and just bring a smartphone or GPS device with you on your treasure hunt. Alternatively, you might want to have a backup with you on paper if anything goes wrong with your device. I wrote a simple web service that helps you with the second case.
I’ve been actively geocaching for around 14 years now. Most of my finds are in Hungary, where there is a local website for geocaching: geocaching.hu. This website does not have the same caches as the original site, geocaching.com, rather a different set (with some overlap). They also have a very powerful API, which is what I used for this project.
I tend to print geocache details, especially when I go on multi-day hikes. This was especially handy when I was on a 8 day long trip and my phone’s charging port broke on the third day. I had the coordinates of the caches stored on my hiking GPS device and had the descriptions printed, therefore I had no problem finding the caches.
Copying this information from the website — and filtering only the really necessary information — is a cumbersome task. Unsurprisingly, I am not a fan of cumbersome tasks and prefer to automate them as much as possible. This is why I wrote a script in Python to get the required information via the API, which is nice for myself, but does not help others. To allow other members of the Hungarian geocaching community to use the script, I decided to wrap it in a FastAPI environment and create an API as well as a very simple front end for it that even non-technical people can use.
This was my first time using FastAPI as a web/API framework. It was also the first time I’ve deployed a web service, for which I chose Heroku as an environment. This was a great learning opportunity as I had to figure out a lot of things that were brand new to me. However, it works now!
As usual, the code for the project can be found on my GitHub profile.
Cover photo: The GCPAVM geocache. Photo by the Author; CC BY-NC.
Originally published at https://hann.io on February 23, 2021.