'Alternatives for Places API Autocomplete for Expo React Native

I am developing an app on with react native, expo, and firebase, and I need to use an api to autocomplete locations when a user types them, but the places API is incredibly expensive. I wanted to know if there were any free or at least far cheaper alternatives to the react-native-google-places-autocomplete package? Ideally it would work with expo and firebase. Any help would be largely appreciated, thank you!



Solution 1:[1]

I would suggest you to fork the react-native-google-places-autocomplete package and replace the api calls to Google with another service. Or just write your own code for it.

  • Add cooldown before sending API requests and don't query before 4 letters are typed for example to massively reduce api calls.

Alternative API services:

Here geocoding autocomplete https://developer.here.com/documentation/examples/rest/geocoding_suggestions

  • Free first 30k searches per month

LocationIQ https://locationiq.com/docs#autocomplete

  • Free 5k requests per day

Mapbox geocoding https://docs.mapbox.com/api/search/geocoding/#forward-geocoding

  • Free 100k per month

And probably lots of other alternatives that I have not found yet.

Solution 2:[2]

I have found an API for this. here is the link to that API https://www.bigdatacloud.com/geocoding-apis/reverse-geocode-to-city-api

monthly 50K requests are free and additional 50K costs only $2 per month.

a package for react-native is react-native-geocoder

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mathias Haugsbø
Solution 2 Engr.Aftab Ufaq