I thought geocoding with an API (Mapbox) was an all-you-can-eat buffet. Until I got the bill for $612.60. (I assume it's in US dollars.)
If you're working on a real estate website using your board's RESO API, it's more than likely to be missing key details. One being coordinates (longitude and latitude) to help you actually map listings on a… map. This also helps with "near" searches – what homes got listed within 2km of ________?
(Unless you're using a service like Repliers API which does come with it, you're on your own to figure this out.)
I replicated PropTx's listings (read here: https://developer.ampre.ca/docs/replication) and using Lovable I set off geocoding bots to give every street address a longitude and latitude so my app can locate them on a map. The problem: the replication process yields over 1 million rows of data. My geocoding bots were taking forever to get it done (estimated over a month to complete). After a week, it had only completed geocoding 12% of the addresses.
So I asked my AI coding agent to find a faster way to do this. And it suggested Mapbox. It told me it would take mere hours to complete. Sign me up!
Surely enough, an hour or so later, all addresses in over a million rows of data got geocoded. Then I got the bill. $612.60.
And here's the 'hindsight is 20/20' lesson learned so you can avoid what I just did.
Don't assume something is free, even if you don't have to input a credit card to get started. Mapbox offers a generous 100,000 API calls per month. I didn't realize this until afterwards, and I didn't think that unleashing a function to geocode over a million addresses would turn what I thought was an all-you-can-eat experience into something more attuned to fine dining.
Condo listings have common addresses since multiple units are selling in the same building. Combine those addresses so geocoding several sales in the same building doesn't happen. You only need to geocode the address once.
There are a lot of free options available. After this attempt, I had my Hermes + Claude setup figure out a way to geocode addresses and it was able to do this in a few hours at no cost. I reduced the total number of addresses to less than half due to consolidating sales with common addresses.
Can I dine-n-dash this one? 😅
