# New York Times News Scraper (`khadinakbar/scrape-nytimes-news`) Actor

Scrape NYT headlines, summaries, authors, keywords and images from public RSS feeds and optional official NYT Developer APIs. Honest metadata — no paywall bypass. MCP-ready.

- **URL**: https://apify.com/khadinakbar/scrape-nytimes-news.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** News, AI, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 article founds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## New York Times News Scraper — Headlines, Summaries & RSS Metadata

Media monitors and AI agents extract one structured New York Times **dataset row** per article — headline, summary, authors, keywords, image, publish time, and canonical URL — from public RSS sections, with optional official Developer API search and public Open Graph URL enrich. Built for monitoring workflows on Apify with API, schedules, and MCP.

The New York Times is a trademark of its owner. This independent Actor is not affiliated with, associated with, or endorsed by The New York Times Company.

### Best fit for this Actor

- Build a daily briefing from public NYT Home, Business, Technology, Politics, and related RSS sections.
- Keep only articles that match keyword or recency filters before the primary event charge.
- Enrich known nytimes.com article URLs from public Open Graph and meta tags when HTML is reachable.
- Optionally add free NYT Article Search or Top Stories API metadata when an owner `NYT_API_KEY` is configured.

When you need multi-publisher Google News coverage across many outlets from one keyword, continue with [Google News Scraper](https://apify.com/khadinakbar/google-news-scraper). When you need Bloomberg section headlines from Bloomberg’s public news index, continue with [Bloomberg News Scraper](https://apify.com/khadinakbar/bloomberg-news-scraper).

### Practical scenario

A PR analyst selects sections `Business` and `Technology`, sets `maxItems` to `25`, and leaves keyword filters empty. The dataset returns article rows with headline, summary, authors, publish time, keywords, image, and canonical URL. They export CSV for the morning brief and schedule the same input. When they later want only AI-related stories, they add `searchKeywords: ["AI"]` so non-matching feed items drop before the `article-found` charge. Empty keyword matches finish `SUCCEEDED` with `VALID_EMPTY` and no article event. Missing sources that need an API key finish with outcome `CONFIG_ERROR` so charges stay tied to real rows.

### Quick start input

```json
{
  "sections": ["HomePage", "Business"],
  "maxItems": 10
}
```

### Input reference

| Field | Type | What it controls |
|---|---|---|
| `sections` | array | NYT RSS sections such as HomePage, Business, Technology, Politics. Prefill HomePage + Business. |
| `searchKeywords` | array | Optional contains-match on headline, summary, or keywords. |
| `articleUrls` | array | Optional nytimes.com URLs for public OG/meta enrich. |
| `searchQuery` | string | Optional Article Search API query. Needs owner `NYT_API_KEY`. |
| `topStoriesSections` | array | Optional Top Stories API sections. Needs owner key. |
| `sinceHours` | integer | Optional recency window in hours. `0` keeps all current feed items. |
| `maxItems` | integer | Cap 1–500. Default 50, prefill 10. |
| `proxyConfiguration` | object | Optional Apify proxy. RSS usually works without one. |

### What data you receive

One dataset item is one public NYT article metadata row.

```json
{
  "title": "In China, A.I. Is Moving Forward While the Economy Lags Behind",
  "summary": "As Xi Jinping arrives in the United States this week…",
  "url": "https://www.nytimes.com/2026/09/20/business/china-ai-economy.html",
  "canonicalUrl": "https://www.nytimes.com/2026/09/20/business/china-ai-economy.html",
  "authors": ["Li Yuan"],
  "publishedAt": "<iso8601>",
  "section": "Technology",
  "keywords": ["Artificial Intelligence", "China"],
  "imageUrl": "https://static01.nyt.com/images/example.jpg",
  "textAvailability": "RSS_SUMMARY",
  "sourceMode": "rss",
  "bodyText": null,
  "scrapedAt": "<iso8601>"
}
```

| Field | Meaning |
|---|---|
| `title` / `summary` | Headline and public RSS/API/OG summary |
| `url` / `canonicalUrl` | Canonical nytimes.com article link |
| `authors` / `publishedAt` | Byline and publish time when exposed |
| `section` / `keywords` | Section label and topic tags |
| `imageUrl` / `imageCredit` | Lead image and credit when present |
| `textAvailability` / `sourceMode` | Provenance: RSS summary, API abstract, public snippet, or paywalled marker |
| `bodyText` | Reserved null field; subscription full text stays out of this product |

`OUTPUT` and `RUN_SUMMARY` in the default key-value store hold `outcome`, `itemsPushed`, and `chargedEventCounts`. Download the dataset as JSON, CSV, Excel, or HTML.

### Use through the API

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~scrape-nytimes-news/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sections":["HomePage","Business"],"maxItems":10}'
```

### Use with AI agents through Apify MCP

> Scrape NYT Technology and Business RSS for up to 10 articles matching AI. Return title, url, summary, authors, publishedAt, keywords, textAvailability, and sourceMode. Read OUTPUT.outcome and itemsPushed. Treat VALID\_EMPTY as a real empty match set.

Connect via <https://mcp.apify.com>. Cost signal: about `$0.003` per saved article plus platform usage.

### Connect the workflow

- When you need multi-publisher keyword news across many outlets, continue with [Google News Scraper](https://apify.com/khadinakbar/google-news-scraper).
- When you need Bloomberg section headlines, continue with [Bloomberg News Scraper](https://apify.com/khadinakbar/bloomberg-news-scraper).

### Pricing

This Actor uses Pay per event plus Apify platform usage. The live Pricing tab is the current source of truth for billing details.

| Event | Price |
|---|---:|
| `apify-actor-start` | $0.00005 |
| `article-found` (primary) | $0.003 |

Invalid input and empty matches skip the `article-found` event. Platform usage for compute and optional proxy is billed to the run user.

### Scope and responsible use

This product surfaces public RSS and API metadata for lawful monitoring, research, and agent workflows. Subscription-only full article body stays outside scope. Users remain responsible for complying with New York Times terms and any commercial licensing needs for their redistribution or training use case.

### Design note

In my testing, public NYT RSS was the reliable path: rich titles, summaries, bylines, media, and keywords over plain HTTP without a browser. I found the top-level Sports feed chronically empty, so Sports maps to the live Baseball RSS while Baseball, Soccer, Tennis, and Golf stay selectable directly. I designed official Developer APIs as optional and metadata-only — useful for search, never a full-text substitute. Charging after a durable dataset write keeps empty and config-miss outcomes honest for Store health.

### Support

Open the Actor Issues tab on Apify for bugs and feature requests.

# Changelog

This Actor's version history is a separate document: https://apify.com/khadinakbar/scrape-nytimes-news/changelog.md

# Actor input Schema

## `sections` (type: `array`):

New York Times public RSS sections to scrape (headlines, summaries, authors, images, keywords). Select one or more. Defaults to HomePage and Business. This returns public feed metadata — not full paywalled article body text.

## `searchKeywords` (type: `array`):

Optional case-insensitive keywords. Keep only articles whose headline, summary, or keywords contain at least one term (e.g. \['Fed','AI']). Leave empty to keep all items from selected sections.

## `articleUrls` (type: `array`):

Optional list of nytimes.com article URLs. Each URL is enriched from public Open Graph / meta tags only (title, summary, image). Does not bypass the NYT paywall or return subscription-only full text.

## `searchQuery` (type: `string`):

Optional keyword search via the official NYT Article Search API (metadata/abstract only). Requires owner-configured NYT\_API\_KEY. Do not use site search scraping — robots.txt disallows /search. Leave empty to skip.

## `topStoriesSections` (type: `array`):

Optional Top Stories API sections (home, business, technology, …). Returns official API abstracts/URLs. Requires owner NYT\_API\_KEY. Prefer RSS sections when you do not need the API.

## `sinceHours` (type: `integer`):

Optional recency window. If set to e.g. 24, only articles with publishedAt within the last 24 hours are kept. Use 0 (default) for all currently returned feed/API items.

## `maxItems` (type: `integer`):

Hard cap on articles scraped and billed across all sources. Each accepted article is one billable article-found event. Defaults to 50. Set lower for cheap test runs.

## `enrichHtml` (type: `boolean`):

Reserved for future RSS-row HTML enrich. URL mode already uses public OG/meta enrich. Default false. Does not unlock paywalled full text.

## `proxyConfiguration` (type: `object`):

Optional Apify proxy. Official RSS feeds normally work without one. Enable Residential only if HTML URL enrich is blocked.

## Actor input object example

```json
{
  "sections": [
    "HomePage",
    "Business"
  ],
  "searchKeywords": [],
  "articleUrls": [],
  "searchQuery": "",
  "topStoriesSections": [],
  "sinceHours": 0,
  "maxItems": 10,
  "enrichHtml": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items containing NYT article headlines, summaries, authors, sections, keywords, image metadata, publish times, source URLs, textAvailability, and scrape timestamps.

## `summary` (type: `string`):

Machine-readable run summary with selected sections, filters, feed/API counts, dataset item count, charged article count, estimated event cost, and status message.

## `runSummary` (type: `string`):

Alias containing the same terminal outcome at RUN\_SUMMARY.

# 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 = {
    "sections": [
        "HomePage",
        "Business"
    ],
    "searchKeywords": [],
    "articleUrls": [],
    "searchQuery": "",
    "topStoriesSections": [],
    "sinceHours": 0,
    "maxItems": 10,
    "enrichHtml": false,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/scrape-nytimes-news").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 = {
    "sections": [
        "HomePage",
        "Business",
    ],
    "searchKeywords": [],
    "articleUrls": [],
    "searchQuery": "",
    "topStoriesSections": [],
    "sinceHours": 0,
    "maxItems": 10,
    "enrichHtml": False,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/scrape-nytimes-news").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "sections": [
    "HomePage",
    "Business"
  ],
  "searchKeywords": [],
  "articleUrls": [],
  "searchQuery": "",
  "topStoriesSections": [],
  "sinceHours": 0,
  "maxItems": 10,
  "enrichHtml": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call khadinakbar/scrape-nytimes-news --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/scrape-nytimes-news"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/4MHf15PA8CigXcNNc/builds/lHgV2zDdniUJ5bbSB/openapi.json
