Depends on what catalog system your local library is using. Many use the open source Evergreen ILS. It has a very robust API that I've used quite a bit for discovery.
There are some others, just one example.
Point being though is that every library system is different.
AI can help with that too! Have it pwn the library's public endpoints to get access to their catalog.