Implementation:CrewAIInc CrewAI Serply News Search Tool
| Knowledge Sources | |
|---|---|
| Domains | Tools, News_Search |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
SerplyNewsSearchTool searches for news articles using the Serply.io news API with configurable result limits and regional proxy locations.
Description
The SerplyNewsSearchTool extends BaseTool and queries the Serply.io news endpoint at https://api.serply.io/v1/news/. It accepts a limit parameter (10-100 results) and a proxy_location from a set of supported country codes (US, CA, IE, GB, FR, DE, SE, IN, JP, KR, SG, AU, BR). The _run method builds a GET request with URL-encoded query parameters, parses the JSON response for an "entries" array, and for each entry follows the link via requests.get to resolve the final redirect URL. Results are formatted as strings containing title, resolved link, source, and publication date.
Usage
Use this tool when a CrewAI agent needs to search for and retrieve current news articles with source attribution and publication dates for research and monitoring workflows.
Code Reference
Source Location
- Repository: CrewAI
- File: lib/crewai-tools/src/crewai_tools/tools/serply_api_tool/serply_news_search_tool.py
- Lines: 1-101
Signature
class SerplyNewsSearchToolSchema(BaseModel):
search_query: str = Field(..., description="Mandatory search query you want to use to fetch news articles")
class SerplyNewsSearchTool(BaseTool):
name: str = "News Search"
description: str = "A tool to perform News article search with a search_query."
args_schema: type[BaseModel] = SerplyNewsSearchToolSchema
search_url: str = "https://api.serply.io/v1/news/"
proxy_location: str | None = "US"
limit: int | None = 10
env_vars: list[EnvVar] # SERPLY_API_KEY
def _run(self, **kwargs: Any) -> Any:
...
Import
from crewai_tools import SerplyNewsSearchTool
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| search_query | str | Yes | Search query to find news articles |
| limit | int | No | Maximum number of results to return (10-100, default 10) |
| proxy_location | str | No | Country code for regional results (default "US") |
Outputs
| Name | Type | Description |
|---|---|---|
| _run() returns | str | Formatted news results with title, resolved link, source, and publication date |
Usage Examples
Basic Usage
from crewai_tools import SerplyNewsSearchTool
tool = SerplyNewsSearchTool(limit=5, proxy_location="US")
result = tool._run(search_query="artificial intelligence breakthroughs")