All URIs are relative to https://api.unifapi.com, except if the operation defines another base path.
| 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 |
hackerNewsItemsIdGet($id): \Unifapi\\Sdk\Model\HackerNewsItemsIdGet200ResponseGet Hacker News item by ID
Fetch a single Hacker News item. Stories, comments, jobs, polls, and poll options share the same item shape.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Unifapi\\Sdk\Api\HackerNewsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 56; // int | Hacker News item id.
try {
$result = $apiInstance->hackerNewsItemsIdGet($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HackerNewsApi->hackerNewsItemsIdGet: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Hacker News item id. |
\Unifapi\Sdk\Model\HackerNewsItemsIdGet200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
hackerNewsMaxItemGet(): \Unifapi\\Sdk\Model\HackerNewsMaxItemGet200ResponseGet largest Hacker News item ID
Returns the current largest Hacker News item id.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Unifapi\\Sdk\Api\HackerNewsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->hackerNewsMaxItemGet();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HackerNewsApi->hackerNewsMaxItemGet: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
\Unifapi\Sdk\Model\HackerNewsMaxItemGet200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
hackerNewsStoriesFeedGet($feed, $cursor, $limit): \Unifapi\\Sdk\Model\HackerNewsStoriesFeedGet200ResponseList Hacker News story IDs
List Hacker News story ids from a named feed. Use /hacker-news/items/{id} to fetch item details.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Unifapi\\Sdk\Api\HackerNewsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$feed = new \Unifapi\\Sdk\Model\\Unifapi\\Sdk\Model\HackerNewsStoryFeed(); // \Unifapi\\Sdk\Model\HackerNewsStoryFeed | Story feed: top, new, best, ask, show, or jobs.
$cursor = 'cursor_example'; // string | Zero-based offset cursor returned as `next_cursor`.
$limit = 100; // int
try {
$result = $apiInstance->hackerNewsStoriesFeedGet($feed, $cursor, $limit);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HackerNewsApi->hackerNewsStoriesFeedGet: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| feed | \Unifapi\Sdk\Model\HackerNewsStoryFeed | Story feed: top, new, best, ask, show, or jobs. | |
| cursor | string | Zero-based offset cursor returned as `next_cursor`. | [optional] |
| limit | int | [optional] [default to 100] |
\Unifapi\Sdk\Model\HackerNewsStoriesFeedGet200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
hackerNewsStoriesFeedItemsGet($feed, $cursor, $limit): \Unifapi\\Sdk\Model\HackerNewsStoriesFeedItemsGet200ResponseList 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.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Unifapi\\Sdk\Api\HackerNewsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$feed = new \Unifapi\\Sdk\Model\\Unifapi\\Sdk\Model\HackerNewsStoryFeed(); // \Unifapi\\Sdk\Model\HackerNewsStoryFeed | Story feed: top, new, best, ask, show, or jobs.
$cursor = 'cursor_example'; // string | Zero-based offset cursor returned as `next_cursor`.
$limit = 20; // int
try {
$result = $apiInstance->hackerNewsStoriesFeedItemsGet($feed, $cursor, $limit);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HackerNewsApi->hackerNewsStoriesFeedItemsGet: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| feed | \Unifapi\Sdk\Model\HackerNewsStoryFeed | Story feed: top, new, best, ask, show, or jobs. | |
| cursor | string | Zero-based offset cursor returned as `next_cursor`. | [optional] |
| limit | int | [optional] [default to 20] |
\Unifapi\Sdk\Model\HackerNewsStoriesFeedItemsGet200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
hackerNewsUpdatesGet(): \Unifapi\\Sdk\Model\HackerNewsUpdatesGet200ResponseGet changed Hacker News items and profiles
Returns recently changed Hacker News item ids and user profile ids.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Unifapi\\Sdk\Api\HackerNewsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->hackerNewsUpdatesGet();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HackerNewsApi->hackerNewsUpdatesGet: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
\Unifapi\Sdk\Model\HackerNewsUpdatesGet200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
hackerNewsUsersIdGet($id): \Unifapi\\Sdk\Model\HackerNewsUsersIdGet200ResponseGet Hacker News user by ID
Fetch a public Hacker News user profile by case-sensitive username.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Unifapi\\Sdk\Api\HackerNewsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 'id_example'; // string | Case-sensitive Hacker News username.
try {
$result = $apiInstance->hackerNewsUsersIdGet($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HackerNewsApi->hackerNewsUsersIdGet: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | Case-sensitive Hacker News username. |
\Unifapi\Sdk\Model\HackerNewsUsersIdGet200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]