pynytimes
  • Introduction to pynytimes
  • Getting Started
    • Installation
    • Usage
    • Citation
  • Search
    • Article Search
    • Book Reviews
    • Movie Reviews
  • Popular
    • Top Stories
    • Most Viewed
    • Most Shared
    • Best Sellers Lists
  • Metadata
    • Article Metadata
    • Archive Metadata
    • Latest Articles
  • Other
    • Tags
  • Advanced Usage
    • Close Connection
    • Automatic Connection
  • Repository
  • PyPI
Powered by GitBook
On this page
  • Usage
  • Parameters
  • Example

Was this helpful?

Edit on GitHub
  1. Popular

Top Stories

Load all the top stories.

Usage

NYTAPI.top_stories(section=None)

Parameters

Variables
Description
Data type
Required

section

Get Top Stories from a specific section

str

False

The possible sections are: 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, and world.

Example

top_stories = nyt.top_stories()

# Get all the top stories from a specific category
top_science_stories = nyt.top_stories(section = "science")
PreviousMovie ReviewsNextMost Viewed

Last updated 2 years ago

Was this helpful?