HackerNewsAPI

A Python wrapper for the Official Hacker News API


Keywords
ycombinator, hacker, news
License
LGPL-3.0
Install
pip install HackerNewsAPI==0.1.1

Documentation

Circle CI PyPI version

HackerNewsAPI

HackerNewsAPI is an unofficial Python implementation of the Hacker News API, that utilizes the Python requests packages. The package can be installed via

    python setup.py install

or via

    pip install HackerNewsAPI

Usage

An example script (example.py is included). You can get latest story info by doing

from HackerNewsAPI import HackerNewsAPI
api = HackerNewsAPI()
stories = [api.get_item(item_num) for item_num in api.get_top_stories()]

Note that the API does have a built in rate-limiter that defaults to 250 milliseconds. Tests are run by calling

python HackerNewsAPI_Test