TopStories - sections

Example

example.js
const { TopStories } = require('nytimes-api');
const top = new TopStories('your-super-secret-api-key');

top.sections(data => console.log(data));

What does it do?

sections returns an array full of all of the sections you can search for top stories for. The code example above does the same.

This is not a feature in the API. It has just been added to the wrapper for convenience.

Example Response

example-response.json
[ 'arts',
  'automobiles',
  'books',
  'business',
  'fashion',
  'food',
  'health',
  'home',
  'insider',
  'magazine',
  'movies',
  'national',
  'nyregion',
  'obituaries',
  'opinion',
  'politics',
  'realestate',
  'science',
  'sports',
  'sundayreview',
  'technology',
  'theater',
  'tmagazine',
  'travel',
  'upshot',
  'world' ]

Last updated