Encountering a rate limit exceeded error from the Google Books API while using this demo:
To reproduce, open the developer console in Chrome and perform some searches. The rate limit errors will be displayed in the console.
[],"lazyUpdate":null},"status":403,"statusText":"OK","url":"https://www.googleapis.com/books/v1/volumes?q=test","ok":false,"name":"HttpErrorResponse","message":"Http failure response for https://www.googleapis.com/books/v1/volumes?q=test: 403 OK","error":{"error":{"errors":[{"domain":"usageLimits","reason":"userRateLimitExceededUnreg","message":"User Rate Limit Exceeded. Please sign up","extendedHelp":"https://code.google.com/apis/console"}],"code":403,"message":"User Rate Limit Exceeded. Please sign up"}}}
This is the search functionality code (Link to the stackblitz book.service):
onSearch(query: string) {
this.bookStore.query = query;
this.query$.pipe(
filter(Boolean),
debounceTime(500),
distinctUntilChanged(),
tap(async (query: string) => {
const bo: Observable<Book[]> = this.searchAPI(query);
const books: Book[] = await bo.toPromise();
this.bookStore.reset();
this.bookStore.postA(books);
})
)
.subscribe();
However, this Akita demo does not encounter the same issue:
If anyone knows what could be causing the rate limit exceeded error despite setting debounce time to 500 milliseconds, please share your insights.