Address Auto-complete and Geocoding with Radar.com API

Hello fmsoup community! I’ve mostly been out of FileMaker development for years, but I still like to tinker with it on occasion. Recently I’ve been using the radar.com API in Appsmith for address auto-complete and geocoding, and I wanted to see if I could build the same thing in FileMaker.

Here’s a simple demo app that shows how to use the free radar.com API to create an address auto-complete. Just paste in your API token and start typing an address to see matching results.
Radar Address Auto-Complete.fmp12 (528 KB)

It will autocomplete matching results based on the user's location, or you can optionally specify a different center for the search.
2024-01-07 19.50.42

The radar.com API is easy to use and has a generous free plan. I don’t have any affiliation with them, I just found their API recently and thought it was a lot easier to integrate than Google Maps.


Additionally, this demo shows how to:

  • request an array of records from an API and save the response to a global variable (to be accessed outside the script, later)
  • keep calling that API as the user is typing, and pass the user's text as a URL param
  • Parse a JSON array without looping scripts (JSONGetElement() in a calc field)
  • Relate each record in the response to a record in FileMaker (cartesian join)
  • Display the JSON in a portal (select a result from the auto complete addresses)

This was fun! I kind of miss FileMaker. :slight_smile: How ya'll doing?

4 Likes

Here's the Appsmith version that inspired me to try this in FileMaker:

1 Like

Good to see you here @greenflux.

The thing I like about this tool is that it is clever about using your current location. I only needed to enter six characters to get an exact match for my address!

A lot of tools require the user to provide data to them to get them started. Beginning with the country code then the postcode / zip. That is effective but it's not how most humans think.

3 Likes

Thanks for sharing this, @greenflux , it's fun to play with. I'm located in Bangkok, Thailand and sadly it's not really usable as intended. However, entering part of my U.S. address it finds it immediately and precisely, with surprisingly few characters entered.

Addresses in Thailand can be a bit tricky, but I even entered a precise address on a main business district road and it could not resolve anything remotely useful. Radar sees locations here, but doesn't resolve working addresses, at least in my few attempts. Having lived in Bahrain for nearly three years, I can guess it would be even worse there due to the really unconventional (to me) address formats. Google maps doesn't work well there either for many addresses, but does get the main roads and buildings pretty well.

It seems likely that Radar would be best suited where addresses are formatted in a consistent and sort of "normal" manner, and where they have the greatest demand. This is NOT a criticism, just an observation. Again, thank you for sharing it. I'll play with it a bit more and see if different input strategies helps it find its way here in BKK.

1 Like

Not sure this is totally applicable here, but was wondering if anyone still uses MapQuest. It used to be free, but apparently you have to pay now.

Below is an app that used to work for free, but no longer does.

1 Like

Very clever, especially if your address entry is primarily locally. It appears to prioritize responses based on distance from your current location, until it gets enough specificity to create a match in another geography. Works great for the current client application, but I'd need to see if there is a flag to disable the current location flag for other solutions that are nationwide.

1 Like

I think if you update your API keys, you will likely get back into the free plan - 15,000 transaction per month and .45¢ per transaction after that.

Thanks! Yes, the Radar API defaults to your current location, but it also has an option to pass in a different location for the center of the search. They also have a map embed API, so you can let the user pick the search center by selecting a point on the map.

I hadn't used their API in a couple years so I don't think a new API key would fix anything based on what you wrote.

Can you get it to work for free?

Let me know.

Thanks.

I made some search for french side of this subject and found a free solution at API Adresse | adresse.data.gouv.fr where there is a free API Adresse.

Pour la France, on dispose gratuitement du site API Adresse | adresse.data.gouv.fr avec l'API Adresse.

PS : n'employez pas de variables globales dans l'utilisation de l'instruction Insérer depuis URL.

I just wrote a similar script to auto-fill addresses in an Airtable base. Their IDE is actually pretty decent. I hadn't used it before and was impressed with the editor. It has syntax highlighting, auto-complete, IntelliSense tooltips, collapsable code, etc.