Find the right API

Hi all!
I’m newbee here, I’m reading some documentation but I can’t understand which API is the best for my purpose. I have a database with some apartments created by me and I need to find the closest ones to the user’s query (the user can search by street name or address), also I need to print the results in a vector map.

Can you tell which APIs are the best? Are there any useful tutorial?

Closest in straight line or closest by driving?
Taxi cars dispatcher sounds like a similar case: Taxi cars dispatcher | Tutorials, Use Cases | Maps SDK for Web (v6) | TomTom Developer Portal

Closest in straight line. To be clear I don’t need navigation infos, I only need to display on a map the closest apartments that I have in my database.

I’m using geocoding right now but it give me this error:
Access to XMLHttpRequest at ‘https://api.tomtom.com/search/2/geocode/{query}.JSON?{key}’ from origin ‘http://localhost:8000’ has been blocked by CORS policy: Request header field x-requested-with is not allowed by Access-Control-Allow-Headers in preflight response.

{query} and {key} are replaced with my actual query and key

Distance in straight line can be calculated with Turf.js