All URIs are relative to https://api.unifapi.com
| Method | HTTP request | Description |
|---|---|---|
| hackerNewsItemsIdGet | GET /hacker-news/items/{id} | Get Hacker News item by ID |
| hackerNewsMaxItemGet | GET /hacker-news/max-item | Get largest Hacker News item ID |
| hackerNewsStoriesFeedGet | GET /hacker-news/stories/{feed} | List Hacker News story IDs |
| hackerNewsStoriesFeedItemsGet | GET /hacker-news/stories/{feed}/items | List Hacker News story items |
| hackerNewsUpdatesGet | GET /hacker-news/updates | Get changed Hacker News items and profiles |
| hackerNewsUsersIdGet | GET /hacker-news/users/{id} | Get Hacker News user by ID |
HackerNewsItemsIdGet200Response hackerNewsItemsIdGet(id)
Get Hacker News item by ID
Fetch a single Hacker News item. Stories, comments, jobs, polls, and poll options share the same item shape.
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.HackerNewsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
HackerNewsApi apiInstance = new HackerNewsApi(defaultClient);
Integer id = 56; // Integer | Hacker News item id.
try {
HackerNewsItemsIdGet200Response result = apiInstance.hackerNewsItemsIdGet(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HackerNewsApi#hackerNewsItemsIdGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | Integer | Hacker News item id. |
HackerNewsItemsIdGet200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Validation or invalid-id error | - |
| 401 | Missing, invalid, disabled, revoked, or expired UnifAPI API key | - |
| 402 | Insufficient workspace credits | - |
| 404 | Resource not found | - |
| 429 | Rate limited | - |
| 500 | Internal error | - |
| 502 | Source error | - |
| 503 | Source unavailable | - |
HackerNewsMaxItemGet200Response hackerNewsMaxItemGet()
Get largest Hacker News item ID
Returns the current largest Hacker News item id.
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.HackerNewsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
HackerNewsApi apiInstance = new HackerNewsApi(defaultClient);
try {
HackerNewsMaxItemGet200Response result = apiInstance.hackerNewsMaxItemGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HackerNewsApi#hackerNewsMaxItemGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}This endpoint does not need any parameter.
HackerNewsMaxItemGet200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Validation or invalid-id error | - |
| 401 | Missing, invalid, disabled, revoked, or expired UnifAPI API key | - |
| 402 | Insufficient workspace credits | - |
| 404 | Resource not found | - |
| 429 | Rate limited | - |
| 500 | Internal error | - |
| 502 | Source error | - |
| 503 | Source unavailable | - |
HackerNewsStoriesFeedGet200Response hackerNewsStoriesFeedGet(feed, cursor, limit)
List Hacker News story IDs
List Hacker News story ids from a named feed. Use `/hacker-news/items/{id}` to fetch item details.
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.HackerNewsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
HackerNewsApi apiInstance = new HackerNewsApi(defaultClient);
HackerNewsStoryFeed feed = HackerNewsStoryFeed.fromValue("top"); // HackerNewsStoryFeed | Story feed: top, new, best, ask, show, or jobs.
String cursor = "cursor_example"; // String | Zero-based offset cursor returned as `next_cursor`.
Integer limit = 100; // Integer |
try {
HackerNewsStoriesFeedGet200Response result = apiInstance.hackerNewsStoriesFeedGet(feed, cursor, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HackerNewsApi#hackerNewsStoriesFeedGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| feed | HackerNewsStoryFeed | Story feed: top, new, best, ask, show, or jobs. | [enum: top, new, best, ask, show, jobs] |
| cursor | String | Zero-based offset cursor returned as `next_cursor`. | [optional] |
| limit | Integer | [optional] [default to 100] |
HackerNewsStoriesFeedGet200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Validation or invalid-id error | - |
| 401 | Missing, invalid, disabled, revoked, or expired UnifAPI API key | - |
| 402 | Insufficient workspace credits | - |
| 404 | Resource not found | - |
| 429 | Rate limited | - |
| 500 | Internal error | - |
| 502 | Source error | - |
| 503 | Source unavailable | - |
HackerNewsStoriesFeedItemsGet200Response hackerNewsStoriesFeedItemsGet(feed, cursor, limit)
List Hacker News story items
Fetch item details from a named Hacker News story feed in one operation. Use this when an agent needs readable story titles, URLs, scores, authors, or comment counts.
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.HackerNewsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
HackerNewsApi apiInstance = new HackerNewsApi(defaultClient);
HackerNewsStoryFeed feed = HackerNewsStoryFeed.fromValue("top"); // HackerNewsStoryFeed | Story feed: top, new, best, ask, show, or jobs.
String cursor = "cursor_example"; // String | Zero-based offset cursor returned as `next_cursor`.
Integer limit = 20; // Integer |
try {
HackerNewsStoriesFeedItemsGet200Response result = apiInstance.hackerNewsStoriesFeedItemsGet(feed, cursor, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HackerNewsApi#hackerNewsStoriesFeedItemsGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| feed | HackerNewsStoryFeed | Story feed: top, new, best, ask, show, or jobs. | [enum: top, new, best, ask, show, jobs] |
| cursor | String | Zero-based offset cursor returned as `next_cursor`. | [optional] |
| limit | Integer | [optional] [default to 20] |
HackerNewsStoriesFeedItemsGet200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Validation or invalid-id error | - |
| 401 | Missing, invalid, disabled, revoked, or expired UnifAPI API key | - |
| 402 | Insufficient workspace credits | - |
| 404 | Resource not found | - |
| 429 | Rate limited | - |
| 500 | Internal error | - |
| 502 | Source error | - |
| 503 | Source unavailable | - |
HackerNewsUpdatesGet200Response hackerNewsUpdatesGet()
Get changed Hacker News items and profiles
Returns recently changed Hacker News item ids and user profile ids.
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.HackerNewsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
HackerNewsApi apiInstance = new HackerNewsApi(defaultClient);
try {
HackerNewsUpdatesGet200Response result = apiInstance.hackerNewsUpdatesGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HackerNewsApi#hackerNewsUpdatesGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}This endpoint does not need any parameter.
HackerNewsUpdatesGet200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Validation or invalid-id error | - |
| 401 | Missing, invalid, disabled, revoked, or expired UnifAPI API key | - |
| 402 | Insufficient workspace credits | - |
| 404 | Resource not found | - |
| 429 | Rate limited | - |
| 500 | Internal error | - |
| 502 | Source error | - |
| 503 | Source unavailable | - |
HackerNewsUsersIdGet200Response hackerNewsUsersIdGet(id)
Get Hacker News user by ID
Fetch a public Hacker News user profile by case-sensitive username.
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.HackerNewsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
HackerNewsApi apiInstance = new HackerNewsApi(defaultClient);
String id = "id_example"; // String | Case-sensitive Hacker News username.
try {
HackerNewsUsersIdGet200Response result = apiInstance.hackerNewsUsersIdGet(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HackerNewsApi#hackerNewsUsersIdGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | Case-sensitive Hacker News username. |
HackerNewsUsersIdGet200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Validation or invalid-id error | - |
| 401 | Missing, invalid, disabled, revoked, or expired UnifAPI API key | - |
| 402 | Insufficient workspace credits | - |
| 404 | Resource not found | - |
| 429 | Rate limited | - |
| 500 | Internal error | - |
| 502 | Source error | - |
| 503 | Source unavailable | - |