# Nyt News Scraper (`romy/nyt-news-scraper`) Actor

Search New York Times articles by keyword and get structured metadata: headline, summary, byline, publish date, content type, and article URL. Uses NYT's own internal GraphQL API -- no NYT API key or subscription needed.

- **URL**: https://apify.com/romy/nyt-news-scraper.md
- **Developed by:** [Romy](https://apify.com/romy) (community)
- **Categories:** News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.56 / 1,000 article scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## NYT News Scraper

Search **New York Times** articles by keyword and retrieve structured metadata — headlines, summaries, authors, publication dates, and direct article URLs. No NYT API key or subscription required.

### What does NYT News Scraper do?

This Actor searches the New York Times using NYT's internal GraphQL API (`samizdat-graphql.nytimes.com`). For each article it returns the headline, summary, author bylines, publication date, content type, and full article URL. You can sort by newest, oldest, or best match, and limit the number of results.

### Why use NYT News Scraper?

- **Media monitoring** — track how NYT covers a company, person, or topic over time
- **Research & journalism** — build datasets of NYT coverage for analysis
- **SEO & content research** — see what topics NYT publishes most
- **Trend tracking** — monitor article volume for any keyword across dates
- **Competitive intelligence** — understand NYT editorial focus by category

### How to use

1. Open the **Input** tab in Apify Console
2. Enter a **Search Query** (e.g., `"artificial intelligence"`, `"climate change"`)
3. Choose a **Sort Order** (newest, oldest, or best match)
4. Set **Max Articles** (default 50)
5. Click **Start** — results appear in the **Output** tab within seconds

### Input

```json
{
  "query": "artificial intelligence",
  "sort": "newest",
  "maxItems": 100
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Keyword(s) to search for |
| `sort` | string | No | `newest` (default), `oldest`, `best` |
| `maxItems` | integer | No | Max articles to return (default 50) |
| `types` | array | No | Content types: `ARTICLE`, `VIDEO`, `RECIPE`, `SLIDESHOW`, etc. Default: all types |

### Output

One item per article:

```json
{
  "type": "Article",
  "url": "https://www.nytimes.com/2026/08/08/technology/ai-regulations.html",
  "uri": "nyt://article/92c4298c-d378-523c-a034-852b92f744a9",
  "headline": "New Rules for A.I. Are Being Drafted in Congress",
  "summary": "Lawmakers are working on a framework to regulate artificial intelligence systems.",
  "kicker": "Technology",
  "authors": ["By Jane Smith", "By John Doe"],
  "firstPublished": "2026-08-08T14:30:00.000Z",
  "lastModified": "2026-08-08T16:00:00.000Z"
}
```

You can download the dataset in JSON, CSV, or Excel format.

### Data fields

| Field | Description |
|-------|-------------|
| `type` | Content type: `Article`, `Video`, `Recipe`, `Slideshow`, etc. |
| `url` | Full URL to the NYT article |
| `uri` | Internal NYT content identifier |
| `headline` | Article headline |
| `summary` | Short article summary / deck |
| `kicker` | Section label (e.g., "Opinion", "Technology", "Guest Essay") |
| `authors` | List of author bylines |
| `firstPublished` | Original publication timestamp (ISO 8601) |
| `lastModified` | Last modification timestamp (ISO 8601) |

### Pricing

This Actor uses **Pay-Per-Event** billing:

| Event | Price |
|-------|-------|
| Actor start | $0.05 (once per run) |
| Per article scraped | $0.005 |

**Example:** 100 articles = $0.05 start + $0.50 = **$0.55 total**
**Example:** 1,000 articles = $0.05 + $5.00 = **$5.05 total**

### Tips

- Use **quoted phrases** (`"supply chain"`) for precise topic searches
- Combine with `sort: oldest` to study historical coverage and track how a topic evolved
- Use `types: ["ARTICLE"]` to exclude recipes, videos, and slideshows
- For media monitoring workflows, run on a schedule (e.g., daily) and store results in a dataset

### FAQ and support

**Does this require a NYT subscription?**
No. The scraper accesses metadata (headlines, summaries, dates, URLs) that NYT makes available publicly. Full article body text requires a subscription and is not scraped.

**How many articles can I get per search?**
NYT's search typically returns up to several thousand results per query. Use `maxItems` to control how many you retrieve.

**Is this legal?**
This Actor scrapes publicly accessible metadata. Respect NYT's Terms of Service and use for research and analysis purposes only.

Open an issue on the **Issues** tab or contact the author for custom solutions.

# Actor input Schema

## `query` (type: `string`):

Keyword(s) to search for in New York Times articles.

## `sort` (type: `string`):

Sort order for results.

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

Maximum number of articles to return.

## `types` (type: `array`):

Content types to include. Leave empty for all types.

## Actor input object example

```json
{
  "query": "artificial intelligence",
  "sort": "newest",
  "maxItems": 50,
  "types": [
    "ARTICLE",
    "ATHLETICARTICLE",
    "ATHLETICLIVEBLOG",
    "CARDDECK",
    "INTERACTIVE",
    "LEGACYCOLLECTION",
    "RECIPE",
    "SLIDESHOW",
    "VIDEO",
    "WIRECUTTERARTICLE"
  ]
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "query": "artificial intelligence",
    "types": [
        "ARTICLE",
        "ATHLETICARTICLE",
        "ATHLETICLIVEBLOG",
        "CARDDECK",
        "INTERACTIVE",
        "LEGACYCOLLECTION",
        "RECIPE",
        "SLIDESHOW",
        "VIDEO",
        "WIRECUTTERARTICLE"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("romy/nyt-news-scraper").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 = {
    "query": "artificial intelligence",
    "types": [
        "ARTICLE",
        "ATHLETICARTICLE",
        "ATHLETICLIVEBLOG",
        "CARDDECK",
        "INTERACTIVE",
        "LEGACYCOLLECTION",
        "RECIPE",
        "SLIDESHOW",
        "VIDEO",
        "WIRECUTTERARTICLE",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("romy/nyt-news-scraper").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 '{
  "query": "artificial intelligence",
  "types": [
    "ARTICLE",
    "ATHLETICARTICLE",
    "ATHLETICLIVEBLOG",
    "CARDDECK",
    "INTERACTIVE",
    "LEGACYCOLLECTION",
    "RECIPE",
    "SLIDESHOW",
    "VIDEO",
    "WIRECUTTERARTICLE"
  ]
}' |
apify call romy/nyt-news-scraper --silent --output-dataset

```

## MCP server setup

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

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/g0ewQVX6qO6ag3BGo/builds/IqZjlMi6ggCeDWT5S/openapi.json
