Skip to content

Conversation

@JINO-ROHIT
Copy link
Collaborator

adds serpapi search toolkit , theres a lot more modules, would you like me to add anymore before i add an example and testcase for this?

reference - https://serpapi.com/search-api

fixes #3476

@JINO-ROHIT JINO-ROHIT self-assigned this Dec 2, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 2, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch serpapi

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the Review Required PR need to be reviewed label Dec 2, 2025
@LIHUA919
Copy link
Collaborator

LIHUA919 commented Dec 3, 2025

Hi @JINO-ROHIT, It seems the unit tests are missing.

@JINO-ROHIT
Copy link
Collaborator Author

adds serpapi search toolkit , theres a lot more modules, would you like me to add anymore before i add an example and testcase for this?

reference - https://serpapi.com/search-api

fixes #3476

right i was hoping if something else needs to be added before i add test cases + example

@fengju0213
Copy link
Collaborator

hi!@JINO-ROHIT thanks for this pr!i think the advantage of serpapi lies in their integration with various search engines, allowing them to be invoked using a unified key.so maybe we can add a parameter,let user can use any search engines they want via this parameter,we can start by supporting some commonly used modules,like:GoogleSearch、Yahoo、Yandex、GoogleScholarSearch and YouTube

@JINO-ROHIT
Copy link
Collaborator Author

hi @fengju0213 yeah i think the engine param is already in the PR unless im misunderstanding something, if this looks good then ill proceed to examples and test cases

@fengju0213
Copy link
Collaborator

hi @fengju0213 yeah i think the engine param is already in the PR unless im misunderstanding something, if this looks good then ill proceed to examples and test cases

yeah I noticed you've already added this parameter, but in the proxy logic, we currently only support Google?

@waleedalzarooni waleedalzarooni self-requested a review December 4, 2025 11:12
@JINO-ROHIT
Copy link
Collaborator Author

@fengju0213 sorry for not understanding this well, can you explain what you are referring to as proxy

@fengju0213
Copy link
Collaborator

fengju0213 commented Dec 5, 2025

@fengju0213 sorry for not understanding this well, can you explain what you are referring to as proxy

I mean, although the function parameters support custom configurations, in the implementation logic we currently only support Google, right? Because I see that we only import Google — which means even if users want to configure another engine, they wouldn’t be able to use it?

@JINO-ROHIT
Copy link
Collaborator Author

hi @fengju0213 ah i see what you mean, i think the import is simply poorly named by serpapi, if you change the engine to 'duckduckgo' like this, the results will be from duckduckgo

from serpapi import GoogleSearch
import os

engine = 'duckduckgo'
query = 'whatsup?'

SERPAPI_KEY = os.getenv("SERPAPI_KEY")
params = {
    "engine": engine,
    "q": query,
    "api_key": SERPAPI_KEY,
}

search = GoogleSearch(params)
results = search.get_dict()

@fengju0213
Copy link
Collaborator

hi @fengju0213 ah i see what you mean, i think the import is simply poorly named by serpapi, if you change the engine to 'duckduckgo' like this, the results will be from duckduckgo

from serpapi import GoogleSearch
import os

engine = 'duckduckgo'
query = 'whatsup?'

SERPAPI_KEY = os.getenv("SERPAPI_KEY")
params = {
    "engine": engine,
    "q": query,
    "api_key": SERPAPI_KEY,
}

search = GoogleSearch(params)
results = search.get_dict()

ah i see, i read the source code of the serpapi,these search engines have been repackaged. for clarity in naming, perhaps we can use SerpApiClient?
image

@fengju0213
Copy link
Collaborator

hi @fengju0213 ah i see what you mean, i think the import is simply poorly named by serpapi, if you change the engine to 'duckduckgo' like this, the results will be from duckduckgo

from serpapi import GoogleSearch
import os

engine = 'duckduckgo'
query = 'whatsup?'

SERPAPI_KEY = os.getenv("SERPAPI_KEY")
params = {
    "engine": engine,
    "q": query,
    "api_key": SERPAPI_KEY,
}

search = GoogleSearch(params)
results = search.get_dict()

ah i see, i read the source code of the serpapi,these search engines have been repackaged. for clarity in naming, perhaps we can use SerpApiClient? image

image

All the search engines inherit from this class.

@fengju0213 fengju0213 self-requested a review December 5, 2025 06:04
@JINO-ROHIT
Copy link
Collaborator Author

done! is it okay to suprres the stub warnings by doing this? disable_error_code , serpapi didnt have stubs and i tried adding to the overrides module but it didnt work

@fengju0213
Copy link
Collaborator

done! is it okay to suprres the stub warnings by doing this? disable_error_code , serpapi didnt have stubs and i tried adding to the overrides module but it didnt work

no warries,i will help solve this

@fengju0213
Copy link
Collaborator

@JINO-ROHIT everything looks good,lets add some examples ,then we can merge it

@JINO-ROHIT
Copy link
Collaborator Author

@fengju0213 done! is this a new pre-commit that keeps failing?

@fengju0213
Copy link
Collaborator

@fengju0213 done! is this a new pre-commit that keeps failing?

This is not related to your PR — I’ll fix it.

@JINO-ROHIT
Copy link
Collaborator Author

thanks!

Copy link
Collaborator

@LuoPengcheng12138 LuoPengcheng12138 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JINO-ROHIT JINO-ROHIT merged commit ec3a091 into master Dec 9, 2025
14 checks passed
@JINO-ROHIT JINO-ROHIT deleted the serpapi branch December 9, 2025 17:35
a7m-1st pushed a commit that referenced this pull request Dec 9, 2025
a7m-1st pushed a commit that referenced this pull request Dec 9, 2025
@a7m-1st a7m-1st mentioned this pull request Dec 9, 2025
6 tasks
Comment on lines +1442 to +1445
except ImportError:
return {
"error": "serpapi library not installed. Install with: pip install google-search-results"
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JINO-ROHIT for the PR, regarding the dependencies, perhaps its better to use the decorator as above. I have added the enhancement here:
#3558

Wendong-Fan pushed a commit that referenced this pull request Dec 10, 2025
Co-authored-by: a7m-1st <[email protected]>
Co-authored-by: JINO ROHIT <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review Required PR need to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Integrate SerpAPI search engine

6 participants