NOAA publishes the harmonic coefficients for each tide station, so if you hard code those constants into your program you should be able to generate accurate tide predictions. I looked into it a bunch before it started to feel less fun and more like “real work”.
https://tidesandcurrents.noaa.gov/about_harmonic_constituent...