Skip to main content

ArchiveService

A list of all methods in the ArchiveService service. Click on the method name to view detailed information about that method.

MethodsDescription
get_by_year_month_jsonPass in year and month and get back JSON with all articles for that month. The response can be big (~20 megabytes) and contain thousands of articles, depending on the year and month.

get_by_year_month_json

Pass in year and month and get back JSON with all articles for that month. The response can be big (~20 megabytes) and contain thousands of articles, depending on the year and month.

  • HTTP Method: GET
  • Endpoint: /{year}/{month}.json

Parameters

NameTypeRequiredDescription
yearnumberYear: 1851-2019
monthnumberYear: 1-12

Return Type

GetByYearMonthJsonOkResponse

Example Usage Code Snippet

import { NytArchives } from 'nyt-archives';

(async () => {
const nytArchives = new NytArchives({
apiKey: '',
});

const { data } = await nytArchives.archive.getByYearMonthJson(2018, 9);

console.log(data);
})();

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →