This package provides a unified interface to perform web searches across multiple popular search engines.
- Supports Google, Bing, DuckDuckGo, Yahoo, and Baidu search engines
- Simple, consistent API for all supported search engines
- Configurable number of results
To install the package, use pip:
pip install multi_search_engine
Here's a basic example of how to use the package:
from multi_engine_search import search
# Perform a Google search
results = search("Python programming", num_results=5)
# Perform a Bing search (requires API key)
bing_results = search("Machine learning", num_results=10, search_engine="bing", api_key="your_bing_api_key")
# Perform a DuckDuckGo search
ddg_results = search("Privacy", search_engine="duckduckgo")
# Perform a Google search
results = search("Python programming", num_results=5)
# Perform a Bing search (requires API key)
bing_results = search("Machine learning", num_results=10, search_engine="bing", api_key="your_bing_api_key")
# Perform a DuckDuckGo search
ddg_results = search("Privacy", search_engine="duckduckgo")search(query, num_results=10, search_engine="google")
Performs a web search using the specified search engine.
query(str): The search query.num_results(int, optional): The number of results to return. Defaults to 10.search_engine(str, optional): The search engine to use. Options are "google", "bing", "duckduckgo", "yahoo", and "baidu". Defaults to "google".
A list of search results. The exact format may vary depending on the search engine used.
ValueError: If an unsupported search engine is specified.
- Bing
- DuckDuckGo
- Yahoo
- Baidu
Contributions are welcome! Please feel free to submit a Pull Request.