HN Search

FREE
By speedblue
Updated 5 months ago
Social
6.1/10
Popularity Score
272ms
Latency
92%
Success Rate

HN Search API Documentation

This API is built on top of Algolia Search's API. It enables developers to access HN (Hacker News) data programmatically using a REST API. This documentation describes how to request data from the API and how to interpret the response.

View API Details
GETItems
GETSearch
GETSearch by Date
GETUsers
GETItems
Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
idSTRING
REQUIRED
Code Snippet
unirest.get("https://community-hn-search.p.rapidapi.com/items/1")
.header("X-RapidAPI-Host", "community-hn-search.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://community-hn-search.p.rapidapi.com/items/{id}
Request Method: GET
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://community-hn-search.p.rapidapi.com/items/1")
.header("X-RapidAPI-Host", "community-hn-search.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication