# NewsBot3000 Scraper & Aggregator (`regnull/newsbot3000-data-actor`) Actor

Access real-time news from NPR, AP, CSM, and CNN. Articles are AI-summarized with importance scores, keywords, and categories. Supports filtering by date, source, and category, plus semantic search to find similar stories. Ideal for news monitoring and media research.

- **URL**: https://apify.com/regnull/newsbot3000-data-actor.md
- **Developed by:** [Leo](https://apify.com/regnull) (community)
- **Categories:** AI, News, Developer tools
- **Stats:** 6 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## NewsBot3000 Data Access Actor

This Apify actor provides comprehensive access to news articles, topics, keywords, and daily summaries from the NewsBot3000 MongoDB database.

### Features

- **Get Stories**: Fetch news articles with filtering by date, source, category, keyword, and importance
- **Get Topics**: Retrieve topic clusters with their associated stories
- **Get Keywords**: Access extracted keywords with analysis and Wikipedia data
- **Get Daily Summaries**: Retrieve AI-generated daily news summaries
- **Search Stories**: Full-text search across headlines and summaries
- **Similar Stories**: Find semantically similar articles using vector search
- **Keyword-based Retrieval**: Get stories associated with specific keywords

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `action` | string | `get_stories` | The action to perform (see Actions below) |
| `startDate` | string | null | Start date filter (ISO format: YYYY-MM-DD) |
| `endDate` | string | null | End date filter (ISO format: YYYY-MM-DD) |
| `source` | string | null | Filter by news source (NPR, Associated Press, CSM, CNN) |
| `category` | string | null | Filter by category (e.g., "World", "Politics") |
| `keyword` | string | null | Search/filter keyword |
| `minImportance` | integer | null | Minimum importance score (1-10) |
| `maxImportance` | integer | null | Maximum importance score (1-10) |
| `limit` | integer | 100 | Maximum results to return (1-1000) |
| `skip` | integer | 0 | Number of results to skip (pagination) |
| `sortBy` | string | `updated` | Sort field (updated, importance, headline) |
| `sortOrder` | string | `desc` | Sort order (asc, desc) |
| `storyId` | string | null | Story ID for single-story operations |
| `topicId` | string | null | Topic ID for single-topic operations |
| `includeEmbeddings` | boolean | false | Include vector embeddings in response |
| `similarityThreshold` | float | 0.8 | Min similarity for similar stories (0.0-1.0) |
| `mongoUri` | string | null | MongoDB connection URI (or use MONGO\_URI env var) |

### Available Actions

#### `get_stories`

Fetch news articles with various filters.

```json
{
  "action": "get_stories",
  "startDate": "2024-01-01",
  "endDate": "2024-01-31",
  "source": "NPR",
  "category": "Politics",
  "limit": 50
}
```

#### `get_story_by_id`

Fetch a single story by its MongoDB ObjectId.

```json
{
  "action": "get_story_by_id",
  "storyId": "65abc123def456789012345"
}
```

#### `get_topics`

Fetch topic clusters with their associated stories.

```json
{
  "action": "get_topics",
  "startDate": "2024-01-01",
  "limit": 20
}
```

#### `get_topic_by_id`

Fetch a single topic with all its stories.

```json
{
  "action": "get_topic_by_id",
  "topicId": "65abc123def456789012345"
}
```

#### `get_keywords`

Fetch extracted keywords with analysis data.

```json
{
  "action": "get_keywords",
  "keyword": "Ukraine",
  "limit": 100
}
```

#### `get_daily_summaries`

Fetch AI-generated daily news summaries.

```json
{
  "action": "get_daily_summaries",
  "startDate": "2024-01-01",
  "endDate": "2024-01-31"
}
```

#### `search_stories`

Full-text search across headlines and summaries.

```json
{
  "action": "search_stories",
  "keyword": "climate change",
  "limit": 50
}
```

#### `get_stories_by_keyword`

Get stories associated with a specific keyword (uses vector search if available).

```json
{
  "action": "get_stories_by_keyword",
  "keyword": "artificial intelligence",
  "startDate": "2024-01-01",
  "endDate": "2024-01-31",
  "limit": 30
}
```

#### `get_similar_stories`

Find semantically similar stories using vector embeddings.

```json
{
  "action": "get_similar_stories",
  "storyId": "65abc123def456789012345",
  "similarityThreshold": 0.85,
  "limit": 10
}
```

### Output Structure

#### Story Object

```json
{
  "id": "65abc123def456789012345",
  "headline": "Article Headline",
  "link": "https://example.com/article",
  "source": "NPR",
  "updated": "2024-01-15T10:30:00",
  "summary": {
    "title": "Summary Title",
    "summary": "AI-generated summary text...",
    "time": "2024-01-15T10:00:00",
    "importance": 8,
    "keywords": ["keyword1", "keyword2"],
    "category": "World/Europe",
    "categories": ["World", "Europe"],
    "language": "en"
  },
  "topic_id": "65def456abc789012345678"
}
```

#### Topic Object

```json
{
  "id": "65def456abc789012345678",
  "updated": "2024-01-15T12:00:00",
  "source": "multiple",
  "short_name": "Ukraine Peace Talks",
  "summary": {
    "title": "Topic Title",
    "summary": "Topic summary...",
    "importance": 9,
    "keywords": ["Ukraine", "peace", "negotiations"],
    "category": "World"
  },
  "story_ids": ["65abc...", "65bcd..."],
  "stories": [/* full story objects */]
}
```

#### Keyword Object

```json
{
  "id": "65ghi789jkl012345678901",
  "keyword": "Ukraine",
  "analyzed": "2024-01-15T08:00:00",
  "analysis": {
    "proper_noun": true,
    "obscure": false,
    "is_person": false,
    "is_place": true,
    "is_thing": false,
    "is_abstract": false,
    "is_organization": false
  },
  "wikipedia": {
    "summary": "Ukraine is a country in Eastern Europe...",
    "url": "https://en.wikipedia.org/wiki/Ukraine",
    "image_url": "https://upload.wikimedia.org/..."
  }
}
```

#### Daily Summary Object

```json
{
  "id": "65jkl012mno345678901234",
  "date": "2024-01-15T00:00:00",
  "title": "Daily News Summary",
  "overall_summary": "<p>Today's top stories include...</p>",
  "top_keywords": ["Ukraine", "Economy", "Climate"],
  "key_story_titles": ["Story 1", "Story 2"],
  "sentiment": "Mixed"
}
```

### Environment Variables

| Variable | Description |
|----------|-------------|
| `MONGO_URI` | MongoDB connection string (alternative to input parameter) |

### Local Development

```bash
## Install dependencies
pip install -r requirements.txt

## Run locally with Apify CLI
apify run

## Or run directly
python main.py
```

### Deployment

```bash
## Login to Apify
apify login

## Push to Apify platform
apify push
```

### Data Sources

This actor accesses data from the NewsBot3000 platform, which aggregates news from:

- NPR (text.npr.org)
- Associated Press (apnews.com)
- Christian Science Monitor (csmonitor.com)
- CNN Lite (lite.cnn.com)

### License

MIT License

# Actor input Schema

## `action` (type: `string`):

The type of data to fetch

## `startDate` (type: `string`):

Start date for filtering (ISO format: YYYY-MM-DD)

## `endDate` (type: `string`):

End date for filtering (ISO format: YYYY-MM-DD)

## `source` (type: `string`):

Filter by news source

## `category` (type: `string`):

Filter by category (e.g., 'World', 'Politics', 'Technology')

## `keyword` (type: `string`):

Search keyword for filtering stories or keyword lookup

## `minImportance` (type: `integer`):

Minimum importance score (1-10)

## `maxImportance` (type: `integer`):

Maximum importance score (1-10)

## `limit` (type: `integer`):

Maximum number of results to return

## `skip` (type: `integer`):

Number of results to skip (for pagination)

## `sortBy` (type: `string`):

Field to sort results by

## `sortOrder` (type: `string`):

Sort order

## `storyId` (type: `string`):

MongoDB ObjectId of a specific story (for get\_story\_by\_id and get\_similar\_stories)

## `topicId` (type: `string`):

MongoDB ObjectId of a specific topic (for get\_topic\_by\_id)

## `includeEmbeddings` (type: `boolean`):

Include vector embeddings in the response (increases data size)

## `similarityThreshold` (type: `number`):

Minimum similarity score for similar stories search (0.0-1.0)

## `mongoUri` (type: `string`):

MongoDB connection URI (can also be set via MONGO\_URI environment variable)

## Actor input object example

```json
{
  "action": "get_stories",
  "source": "",
  "limit": 100,
  "skip": 0,
  "sortBy": "updated",
  "sortOrder": "desc",
  "includeEmbeddings": false,
  "similarityThreshold": 0.8
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("regnull/newsbot3000-data-actor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("regnull/newsbot3000-data-actor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call regnull/newsbot3000-data-actor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=regnull/newsbot3000-data-actor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/EPe0LGraSYHaDN9A5/builds/cL7adXsU0CmKUJoDz/openapi.json
