MadimetjaShika / vuetify-google-autocomplete

A Vuetify ready Vue.js autosuggest component for the Google Places API.

Home Page:https://madimetjashika.github.io/vuetify-google-autocomplete/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rate limiting API calls

kg-bot opened this issue · comments

commented

Right now it will query google API on each letter which is going to reach API limit pretty soon, I was working on this today, testing only and it reached over 3000 requests for ~100-200 searches, I can't even imagine what would this do to our bill in production.

It would be a nice idea indeed if one has a way to provide a function that handles the API request itself, or add an option to debounce the API requests.

The pricing per session vs per call is not really new, its since 2018.
We get charged per api instead of per session (different token per each call), this is costing us thousands of dollars a month...

This is definitely an issue. Even session pricing have to be implemented in js call. Please have a look for example here for more info:
https://blog.woosmap.com/implement-and-optimize-autocomplete-with-google-places-api

Ideally we would use session token plus debouncing
Debounce time could be passed as prop.

I got charged tens of dollars of credit just by testing this yesterday few times. Strange thing is that internet states that autocomplete widget handles sessiontoken automatically... However that doesn't seem to be the case in billing afterwards :(

I made an attempt at implementing a location autocomplete box myself using vuetify's v-combobox and this was relatively simple and resulted in a quite small component. See the gist at https://gist.github.com/dschreij/06ac09c3ac9be4be4d25849f08eb3121
It implements session tokens (to my best knowledge) in that multiple requests reuse the same session token, until a places details call is made.

I've also found this lengthy proof that suggest that session billing is actually probably working quite perfectly out of the box with Autocomplete Widget.
https://www.tfzx.net/article/3932373.html

#99 (comment)
this looks great thanks for sharing.