# Published News — World News API

> Emit new event whenever recent news are published. Calling this endpoint requires 1 point per page, up to 1000 news. See the docs here

- Key: `world_news_api-published-news`
- Type: Trigger (Polling)
- Version: 0.0.1
- App: World News API (`world_news_api`) — https://pipedream.com/apps/world-news-api.md
- This page (HTML): https://pipedream.com/apps/world-news-api/triggers/published-news
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/world_news_api/sources/published-news/published-news.mjs

## Description

Emit new event whenever recent news are published. Calling this endpoint requires 1 point per page, up to 1000 news. [See the docs here](https://worldnewsapi.com/docs/#Search-News)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `timer` | `$.interface.timer` | Yes | Pipedream will poll the World News API on this schedule |
| `text` | `string` | No | The text to match in the news content. |
| `sourceCountries` | `string[]` | No | List of ISO 3166 country codes from which the news should originate. |
| `language` | `string` | No | The ISO 6391 language code of the news. |
| `minSentiment` | `string` | No | The minimum sentiment of the news. |
| `maxSentiment` | `string` | No | The maximum sentiment of the news. |
| `newsSources` | `string[]` | No | A list of news sources from which the news should originate. |
| `authors` | `string[]` | No | A list of authors of the news. |
| `entities` | `string[]` | No | Filter news by entities (see semantic types). |
| `locationFilter` | `string` | No | Filter news by radius around a certain location. Format is latitude,longitude,radius in kilometers |

## Returns

Events emitted by World News API.

## Run it

**TypeScript**

```ts
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 deployed = await pd.triggers.deploy({
  id: "world_news_api-published-news",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    world_news_api: { authProvisionId: "apn_xxxxxxx" },
    timer: { "intervalSeconds": 900 },
    text: "Text",
  },
  webhookUrl: "https://example.com/webhooks/world-news-api",
})

console.log(deployed.id)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/triggers/deploy \
  -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-published-news",
    "webhook_url": "https://example.com/webhooks/world-news-api",
    "configured_props": {
      "world_news_api": { "authProvisionId": "apn_xxxxxxx" },
      "timer": { "intervalSeconds": 900 },
      "text": "Text"
    }
  }'
```

**MCP**

MCP servers expose World News API actions as on-demand tools.

Published News is an event source, so your application deploys it with the Connect SDK or API and then either receives each event at a webhook URL or retrieves events on demand with the trigger events API.

## Event delivery

Every event is sent to the HTTP endpoint you choose when you deploy the source. Or: no webhook required — your app or agent can fetch recent events from the [trigger events API](https://pipedream.com/docs/connect/api-reference/list-trigger-events.md) instead.

---

- App: https://pipedream.com/apps/world-news-api.md · All apps: https://pipedream.com/apps
