Using nytimes-typescript-sdk with nytimes.com

TypeScript integration

Install

npm install nytimes-typescript-sdk

Quick start

import Nytimes_typescript_sdk from 'nytimes-typescript-sdk';

const client = new Nytimes_typescript_sdk({ apiKey: "YOUR_API_KEY" });
curl \
  # append ?api-key=$API_KEY to the URL \
  http://api.nytimes.com/svc/news/v3/content.json
curl \
  # append ?api-key=$API_KEY to the URL \
  http://api.nytimes.com/svc/news/v3/content/{source}/{section}.json
curl \
  # append ?api-key=$API_KEY to the URL \
  http://api.nytimes.com/svc/news/v3/content/{source}/{section}/{time-period}.json
SDK on GitHub 📄 API Docs
SDK
nytimes-typescript-sdk
TypeScript
API
nytimes.com
nytimes.com:timeswire

At a glance

Language TypeScript
Endpoints3
Base URLhttp://api.nytimes.com/svc/news/v3