World News API ACTION
Search News
Search and filter news. See the docs here. Calling this endpoint requires 1 point
- Action
- Read only
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's World News API account once, then configure and run Search News from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "world_news_api-search-news",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
world_news_api: { authProvisionId: "apn_xxxxxxx" },
text: "Text",
sourceCountries: ["Source Countries"],
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "world_news_api-search-news",
"configured_props": {
"world_news_api": { "authProvisionId": "apn_xxxxxxx" },
"text": "Text",
"sourceCountries": ["Source Countries"]
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "world_news_api",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "world_news_api-search-news",
arguments: {
text: "Text",
sourceCountries: ["Source Countries"],
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
text Text | string | The text to match in the news content. Optional |
sourceCountries Source Countries | string[] | List of ISO 3166 country codes from which the news should originate. Optional |
language Language | string | The ISO 6391 language code of the news. Optional |
minSentiment Minimum Sentiment | string | The minimum sentiment of the news. Optional |
maxSentiment Maximum Sentiment | string | The maximum sentiment of the news. Optional |
earliestPublishedDate Earliest Published Date | string | The news must have been published after this date. YYYY-MM-DD HH:MM:SS format Optional |
latestPublishedDate Latest Published Date | string | The news must have been published before this date. YYYY-MM-DD HH:MM:SS format Optional |
newsSources News Sources | string[] | A list of news sources from which the news should originate. Optional |
authors Authors | string[] | A list of authors of the news. Optional |
entities Entities | string[] | Filter news by entities (see semantic types). Optional |
locationFilter Location Filter | string | Filter news by radius around a certain location. Format is latitude,longitude,radius in kilometers Optional |
sort Sort | string | Sort the news by a certain field. Optional |
sortDirection Sort Direction | string | Sort the news in ascending or descending order. Optional |
offset Offset | integer | The number of news to skip in range. (0-1000) Optional |
number Number | integer | The number of news to return in range. (0-100) Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- world_news_api-search-news
- Version
- 0.0.2
- App
- World News API
- Authentication
- API key
- Read-only
- Yes
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗