Overview

The New York Times API offers programmatic access to a vast repository of news content, enabling developers to integrate articles, historical data, and real-time updates into their applications. Established in 1851, The New York Times has accumulated an extensive archive, which is made available through specialized API endpoints, alongside current news feeds. This suite of APIs is designed for various use cases, including academic research, content analysis, and the development of news-driven applications. Developers can access different facets of NYT content, from the complete text of articles to metadata such as publication dates, authors, and keywords.

The API suite includes several distinct services, each tailored to specific data needs. For instance, the Article Search API allows developers to query millions of articles from 1851 to the present, supporting filters based on date, section, and keyword. The Archive API provides daily article lists for specific months and years, useful for bulk data processing and historical trend analysis. For real-time information, the Top Stories API and Newswire API deliver currently trending and recently published articles across various sections. Beyond general news, specialized APIs like the Books API provide data on New York Times Best Sellers lists, while the Semantic API offers access to a controlled vocabulary of people, places, and organizations mentioned in articles, facilitating more granular content categorization and analysis. These tools support developers in building applications that can display news, perform sentiment analysis, or conduct historical research on journalistic content. The New York Times offers a free tier for initial development and testing, with custom enterprise pricing available for applications requiring higher request volumes, as detailed on the NYT Developer Pricing page.

The New York Times APIs are utilized by a diverse audience, including academic institutions conducting research on media trends, data journalists building interactive visualizations, and application developers creating news aggregators or content recommendation engines. The API key management process is handled through a developer portal, providing a streamlined experience for obtaining and managing access credentials. The available documentation includes detailed endpoint specifications and basic code examples, which assist developers in quickly integrating the APIs into their projects. The breadth of content, spanning over a century and a half, makes the New York Times API a resource for both contemporary news consumption and in-depth historical analysis, providing a structured way to access and utilize published journalistic material.

Key features

  • Archive API: Provides access to New York Times articles published in a given month and year, dating back to 1851, suitable for historical data retrieval and analysis (NYT Archive API documentation).
  • Article Search API: Enables searching through millions of New York Times articles with various query parameters, including keywords, dates, and facets.
  • Books API: Offers data on New York Times Best Sellers lists, including list names, publication dates, and book details.
  • Community API: Provides access to user comments on New York Times articles, allowing for analysis of reader engagement.
  • Newswire API: Delivers a feed of published articles from The New York Times, updated in real-time.
  • Popular API: Retrieves lists of the most emailed, shared, or viewed articles on NYTimes.com within specified timeframes.
  • Semantic API: Provides access to a controlled vocabulary of people, organizations, and locations mentioned in New York Times articles, aiding in content categorization and entity extraction.
  • Times Newswire API: Offers a continuously updated stream of New York Times articles, similar to the Newswire API but with potentially different filtering options.
  • Top Stories API: Returns a list of the current top stories across various sections of NYTimes.com.

Pricing

As of May 2026, the New York Times Developer Network offers a free tier and custom enterprise pricing:

Tier Daily Request Limit Monthly Request Limit Features
Free Tier 500 requests 10,000 requests Access to all APIs (Archive, Article Search, Top Stories, etc.)
Enterprise Custom Custom Higher request volumes, dedicated support, custom data access. Contact The New York Times for specific enterprise pricing details.

Further details on usage and potential overage costs are available on the New York Times Developer Pricing page.

Common integrations

  • Content Management Systems (CMS): Integrating news feeds into platforms like WordPress or Drupal for dynamic content display.
  • Data Visualization Tools: Connecting with platforms like Tableau or Power BI to analyze news trends and historical data.
  • Research Applications: Utilizing APIs in academic tools for text mining and sentiment analysis of journalistic content.
  • Mobile News Apps: Powering native iOS and Android applications with real-time news updates and article archives.
  • AI and Machine Learning Models: Providing training data for natural language processing (NLP) models focused on news content.

Alternatives

  • Associated Press (AP): Offers a wide range of news content and media assets, including real-time feeds and historical archives, primarily for professional news organizations.
  • NewsAPI.org: Provides a simple API to search and retrieve news articles from various global sources, suitable for developers building news aggregation applications.
  • GDELT Project: A large-scale initiative monitoring the world's news media in nearly every country and language, offering extensive open data for research and analysis.
  • Mozilla Developer Network: Provides comprehensive documentation on web technologies, including methods for handling HTTP requests, which are fundamental to consuming any RESTful API like the New York Times API.

Getting started

To begin using the New York Times API, you first need to register for an API key on the New York Times Developer Portal. Once you have your key, you can make requests to the various API endpoints. The following Python example demonstrates how to retrieve the current top stories using the Top Stories API:


import requests
import json

API_KEY = "YOUR_API_KEY"  # Replace with your actual API key
SECTION = "home"          # e.g., 'home', 'world', 'us', 'politics'

url = f"https://api.nytimes.com/svc/topstories/v2/{SECTION}.json?api-key={API_KEY}"

try:
    response = requests.get(url)
    response.raise_for_status()  # Raise an HTTPError for bad responses (4xx or 5xx)
    data = response.json()

    if data and data.get("results"):
        print(f"Top Stories in '{SECTION}' section:")
        for i, story in enumerate(data["results"][:5]): # Print top 5 stories
            title = story.get("title", "No Title")
            abstract = story.get("abstract", "No Abstract")
            url_link = story.get("url", "#")
            print(f"\n{i+1}. {title}")
            print(f"   Abstract: {abstract}")
            print(f"   URL: {url_link}")
    else:
        print("No results found or invalid response format.")

except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err} - {response.text}")
except requests.exceptions.RequestException as req_err:
    print(f"Request error occurred: {req_err}")
except json.JSONDecodeError:
    print("Failed to decode JSON response.")

This Python script uses the requests library to make an HTTP GET request to the Top Stories API endpoint. It then parses the JSON response and prints the titles, abstracts, and URLs of the top five stories in the specified section. Remember to replace "YOUR_API_KEY" with the API key you obtain from the New York Times developer portal. This example provides a basic framework, and developers can expand upon it to integrate other New York Times APIs for more specialized data retrieval and application features.