Skip to content
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

Type error occurs when 'google_images' is used for the engine value of the getJson function. #16

Open
qwerq123456 opened this issue Jun 14, 2023 · 2 comments

Comments

@qwerq123456
Copy link

I use getJson function with engine value 'google_images' like below

const params = {
      api_key: process.env.SERPAPI_SECRET_KEY,
      q: query,
    } satisfies GoogleParameters;
const response = await getJson('google_images', params);

It works well but there is type error Argument of type '"google_images"' is not assignable to parameter of type 'keyof EngineMap'.

Can you add google_images in EngineMap?

@rolandtolnay
Copy link

Got the same error also on not finding GoogleImagesParameters after copying the code export from the Playground

@zyc9012
Copy link
Collaborator

zyc9012 commented Jul 26, 2023

@qwerq123456 @rolandtolnay

We've removed engine-specific types for the new 2.0.0 release, as it's not practical to update this library every time we have engine updates in our service. The online documentation should be the only reference for valid parameters.

Please check if upgrading to 2.0.0 fixes that error. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants