Connecting to HackerNews
Connecting to HackerNews
The HackerNews API (powered by Firebase) is a public API that requires no authentication. You can connect and query data immediately without any credentials.
After setting the following connection properties, you are ready to connect:
- AuthScheme: Set this to None.
Example connection string:
Profile=C:\profiles\HackerNews.apip;AuthScheme=None
Available Tables
The HackerNews API Profile provides access to the following tables:
- Items: Retrieve a single HackerNews item by ID. Covers all item types (stories, comments, jobs, polls, and poll options) via the Type field discriminator.
- TopStories: Retrieve the IDs of the current top 500 stories.
- NewStories: Retrieve the IDs of the 500 newest stories.
- BestStories: Retrieve the IDs of the current best 200 stories.
- AskStories: Retrieve the IDs of the latest 200 Ask HN stories.
- ShowStories: Retrieve the IDs of the latest 200 Show HN stories.
- JobStories: Retrieve the IDs of the latest 200 job postings.
- Users: Retrieve a single user profile by username, including karma, bio, account creation date, and submission history.
- Updates: Retrieve the IDs of recently changed items and profiles.
Usage Examples
Browsing Story Lists
Get the current top story IDs:
SELECT * FROM TopStories
Get the current new story IDs:
SELECT * FROM NewStories
Get the current best story IDs:
SELECT * FROM BestStories
Get Ask HN story IDs:
SELECT * FROM AskStories
Get Show HN story IDs:
SELECT * FROM ShowStories
Get job posting IDs:
SELECT * FROM JobStories
Retrieving Item Details
Items include stories, comments, jobs, polls, and poll options. The Type field indicates which fields are populated.
Get a single item by ID:
SELECT * FROM Items WHERE Id = 8863
Retrieving User Profiles
Get a user profile by username:
SELECT * FROM Users WHERE Id = 'pg'
Real-Time Updates
Get the most recently changed items and user profiles:
SELECT * FROM Updates
Connection Properties
The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider.
| Property | Description |
| AuthScheme | The scheme used for authentication. Accepted entry is None. Allowed values are: BASIC, NONE, NTLM, OAUTH, APIKEY, OAUTH_CLIENT |