The New York Times Archive API

The Archive API from The New York Times — 1 operation(s) for archive.

OpenAPI Specification

the-new-york-times-archive-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  description: The Archive API provides lists of NYT articles by month going back to 1851.  You can use it to build your own local database of NYT article metadata.
  termsOfService: http://developer.nytimes.com/tou
  title: The New York Times Archive API
  version: 1.0.0
  x-apiClientRegistration:
    url: http://developer.nytimes.com/signup
  x-apisguru-categories:
  - media
  - open_data
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_static01.nyt.com_images_icons_t_logo_291_black.png
  x-origin:
  - format: openapi
    url: https://raw.githubusercontent.com/nytimes/public_api_specs/master/archive_api/archive_api.json
    version: '3.0'
  x-providerName: nytimes.com
  x-serviceName: archive
servers:
- url: http://api.nytimes.com/svc/archive/v1
- url: https://api.nytimes.com/svc/archive/v1
security:
- apikey: []
tags:
- name: Archive
paths:
  /{year}/{month}.json:
    get:
      description: 'The Archive API provides lists of NYT articles by month going back to 1851.  Simply pass in the year and month you want and it returns a JSON object with all articles for that month.

        '
      parameters:
      - description: The year (e.g. 2016).
        in: path
        name: year
        required: true
        schema:
          default: '2016'
          format: int32
          maximum: 2030
          minimum: 1851
          type: integer
        x-consoleDefault: '2016'
      - description: The month number (e.g. 1 for January).
        in: path
        name: month
        required: true
        schema:
          default: '1'
          format: int32
          maximum: 12
          minimum: 1
          type: integer
        x-consoleDefault: '1'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  response:
                    properties:
                      docs:
                        items:
                          $ref: '#/components/schemas/Doc'
                        type: array
                      meta:
                        properties:
                          hits:
                            type: integer
                          offset:
                            type: integer
                          time:
                            type: integer
                        type: object
                    type: object
                type: object
          description: The docs requested.
      summary: The New York Times Archive API
      tags:
      - Archive
components:
  schemas:
    Doc:
      properties:
        _id:
          type: string
        abstract:
          type: string
        blog:
          items: {}
          type: array
        byline:
          properties:
            organization:
              type: string
            original:
              type: string
            person:
              items: {}
              type: array
          type: object
        document_type:
          type: string
        headline:
          properties:
            kicker:
              type: string
            main:
              type: string
          type: object
        keywords:
          properties:
            name:
              type: string
            rank:
              type: string
            value:
              type: string
          type: object
        lead_paragraph:
          type: string
        multimedia:
          items:
            properties:
              caption:
                type: string
              copyright:
                type: string
              format:
                type: string
              height:
                type: integer
              subtype:
                type: string
              type:
                type: string
              url:
                type: string
              width:
                type: integer
            type: object
          type: array
        news_desk:
          type: string
        print_page:
          type: string
        pub_date:
          type: string
        section_name:
          type: string
        slideshow_credits:
          type: string
        snippet:
          type: string
        source:
          type: string
        subsection_name:
          type: string
        type_of_material:
          type: string
        web_url:
          type: string
        word_count:
          type: string
      type: object
  securitySchemes:
    apikey:
      in: query
      name: api-key
      type: apiKey
externalDocs:
  url: http://developer.nytimes.com/