
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
async-web-search
Advanced tools
Async web search library supporting Google, Wikipedia, arXiv, NewsAPI, GitHub, and PubMed data sources.
Async web search library supporting Google Custom Search, Wikipedia, arXiv, NewsAPI, GitHub, and PubMed data sources.
You can search across multiple sources and retrieve relevant, clean results in JSON format or as compiled text.
Set environment variables:
export GOOGLE_API_KEY="your_google_api_key"
export CSE_ID="your_cse_id"
export NEWSAPI_KEY="your_newsapi_key"
pip install async-web-search
from web_search import WebSearch, WebSearchConfig
config = WebSearchConfig(sources=["google", "arxiv", "github", "newsapi", "pubmed"])
results = await WebSearch(config).search("quantum computing")
# results is a list of dicts with keys: url, title, preview, source
for result in results:
print(f"Title: {result['title']}")
print(f"URL: {result['url']}")
print(f"Preview: {result['preview']}")
print(f"Source: {result['source']}")
print("---")
from web_search import WebSearch, WebSearchConfig
config = WebSearchConfig(sources=["google", "arxiv", "github"])
compiled_results = await WebSearch(config).compile_search("quantum computing")
print(compiled_results) # Prints a formatted string with all results
from web_search import GoogleSearchConfig
from web_search.google import GoogleSearch
config = GoogleSearchConfig(
api_key="your_google_api_key",
cse_id="your_cse_id",
max_results=5
)
results = await GoogleSearch(config)._search("quantum computing")
for result in results:
print(result)
from web_search import BaseConfig
from web_search.wikipedia_ import WikipediaSearch
wiki_config = BaseConfig(max_results=5)
results = await WikipediaSearch(wiki_config)._search("deep learning")
for result in results:
print(result)
from web_search import BaseConfig
from web_search.arxiv import ArxivSearch
arxiv_config = BaseConfig(max_results=3)
results = await ArxivSearch(arxiv_config)._search("neural networks")
for result in results:
print(result)
Need to search a data source that isn't bundled with the library? Create a plugin from PluginSearch and pass an instance via WebSearchConfig.plugins.
from web_search import WebSearch, WebSearchConfig
from web_search.base import PluginSearch, SearchResult
class RedditSearch(PluginSearch):
slug = "reddit"
async def _search(self, query: str):
# ...implement Reddit search here...
return [
SearchResult(
url="https://reddit.com/r/MachineLearning/1",
title="AMA about quantum ML",
preview="I recently built a quantum ...",
source=self.slug,
)
]
# Option 1: Register the plugin in WebSearchConfig
config = WebSearchConfig(
sources=["google", "arxiv"],
plugins=[RedditSearch()]
)
results = await WebSearch(config).search("quantum computing")
# Option 2: add plugin after initializing Websearch
ws = WebSearch(config=WebSearchConfig(
sources=["google", "arxiv"],
))
ws.add_plugin(RedditSearch())
results = await ws.search("quantum computing")
PluginSearch are ignored.A FastAPI-based production server is available for teams that want to use async web search as a web service. The server is hosted at https://awebs.veedo.ai and can be run locally as well.
See server/README.md for detailed API documentation, endpoints, and deployment instructions.
We welcome contributions! To contribute:
pytest -v
MIT
FAQs
Async web search library supporting Google, Wikipedia, arXiv, NewsAPI, GitHub, and PubMed data sources.
We found that async-web-search demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.