-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing google_shopping engine from EngineMap #5
Comments
Maybe we can have For example, instead of: import { getJson } from "serpapi";
const response = await getJson("google", {
api_key: API_KEY, // Get your API_KEY from https://serpapi.com/manage-api-key
q: "coffee",
location: "Austin, Texas",
});
console.log(response); have: import { getJson } from "serpapi";
const response = await getJson({
api_key: API_KEY, // Get your API_KEY from https://serpapi.com/manage-api-key
engine: "google",
q: "coffee",
location: "Austin, Texas",
});
console.log(response); |
@pawKer I've updated the library with the Google Shopping API types. However, note that any string can be passed in as the It's only if you're using TypeScript that a warning will appear. @hartator I tried that approach previously. Trade-off is we won't be able to get the nice TypeScript autocomplete. |
Thank you very much @sebastianquek! 🥳 |
Having a Regarding autocompletions, let's drop them if that means this library would have a different way to handle params than other libs. Anyway, types are already creating confusion what's supported or not. Maybe if you really want to keep autocompletions, let's just have every params together from every engines and for params that shared between engines (i.e., |
@hartator Any arbitrary string can be passed in as the engine argument, i.e. One enhancement is to have a polymorphic
I think excluding types is a step backwards. It provides a lot of hints as to what is accepted and it removes a whole class of errors related to sending the wrong params. A library should help users as much as possible, otherwise there's very minimal value in it. We already have the rake task to easily generate the types, so it's a matter of figuring out how to automate that further. |
@hartator I've managed to find a better way
I've raised 2 PRs:
|
Hi,
I was trying to use the
"google_shopping"
engine in thegetJson
function but it looks like it is not in the EngineMap yet.I would just like to know if this is going to be added soon or if I should use the previous version of the library?
The text was updated successfully, but these errors were encountered: