Search Hacker News
curl --request GET \
--url https://api.aisa.one/apis/v1/hackernews/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/hackernews/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/hackernews/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/hackernews/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/hackernews/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/hackernews/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/hackernews/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"aisa_pagination": {
"has_more": true,
"next_cursor": "<string>",
"next_param": "page"
},
"data": {
"page": {
"hasMore": true,
"nextPage": 123,
"page": 123,
"pageSize": 123
},
"query": "<string>"
},
"meta": {
"version": "<string>"
}
}Hacker News
Search Hacker News
Searches Hacker News stories and comments, with optional type, sort, date range, author, domain and points filters. query is required unless frontPageOnly, author, domain or url is set. Results are paged: while data.page.hasMore is true, send data.page.nextPage as page to get the next page.
GET
https://api.aisa.one
/
apis
/
v1
/
hackernews
/
search
Search Hacker News
curl --request GET \
--url https://api.aisa.one/apis/v1/hackernews/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/hackernews/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/hackernews/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/hackernews/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/hackernews/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/hackernews/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/hackernews/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"aisa_pagination": {
"has_more": true,
"next_cursor": "<string>",
"next_param": "page"
},
"data": {
"page": {
"hasMore": true,
"nextPage": 123,
"page": 123,
"pageSize": 123
},
"query": "<string>"
},
"meta": {
"version": "<string>"
}
}
请求示例待验证。 此接口的请求示例尚未在生产环境验证。静态示例用于说明请求格式,请替换为自己的参数。正式调用前,可用免费的报价模式(X-AISA-Cost-Mode: quote)查看预估费用。
请求规范
- 方法与路径: GET /apis/v1/hackernews/search
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/hackernews/search - author: query; 可选
- dateRange: query; 可选
- domain: query; 可选
- frontPageOnly: query; 可选
- limit: query; 可选
- minPoints: query; 可选
- page: query; 可选
- prefix: query; 可选
- query: query; 可选
- searchAuthor: query; 可选
- searchStoryText: query; 可选
- sort: query; 可选
- type: query; 可选
- typoTolerance: query; 可选
- url: query; 可选
{
"operationId": "hackernews.search",
"method": "GET",
"path": "/apis/v1/hackernews/search",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"in": "query",
"name": "author",
"required": false,
"schema": {
"description": "Restrict results to items by this Hacker News username.",
"maxLength": 4096,
"minLength": 1,
"type": "string"
}
},
{
"in": "query",
"name": "dateRange",
"required": false,
"schema": {
"description": "Creation-time window. Default: `all`.",
"enum": [
"24h",
"all",
"month",
"week",
"year"
],
"maxLength": 4096,
"minLength": 1,
"type": "string"
}
},
{
"in": "query",
"name": "domain",
"required": false,
"schema": {
"description": "Restrict search to story URLs matching this domain (e.g. example.com). Can omit `query`.",
"maxLength": 4096,
"minLength": 1,
"type": "string"
}
},
{
"in": "query",
"name": "frontPageOnly",
"required": false,
"schema": {
"description": "When true, restrict results to current front-page items. Allows omitting `query`.",
"type": "boolean"
}
},
{
"in": "query",
"name": "limit",
"required": false,
"schema": {
"description": "Hits per page. Must be one of 10, 20, 30, 50. Default: 20. Prefer this over `pageSize`.",
"enum": [
"10",
"20",
"30",
"50"
],
"maxLength": 4096,
"minLength": 1,
"type": "string"
}
},
{
"in": "query",
"name": "minPoints",
"required": false,
"schema": {
"description": "Minimum points/score filter.",
"maximum": 9223372036854775807,
"minimum": 0,
"type": "integer"
}
},
{
"in": "query",
"name": "page",
"required": false,
"schema": {
"description": "Zero-based page index (maximum 50 pages, up to 1,000 hits).",
"maximum": 49,
"minimum": 0,
"type": "integer"
}
},
{
"in": "query",
"name": "prefix",
"required": false,
"schema": {
"description": "When true, enable prefix matching for query tokens.",
"type": "boolean"
}
},
{
"in": "query",
"name": "query",
"required": false,
"schema": {
"description": "Full-text search query. Required unless `frontPageOnly`, `author`, `domain`, or `url` is set.",
"maxLength": 4096,
"minLength": 1,
"type": "string"
}
},
{
"in": "query",
"name": "searchAuthor",
"required": false,
"schema": {
"description": "When true, include author username in the searchable fields.",
"type": "boolean"
}
},
{
"in": "query",
"name": "searchStoryText",
"required": false,
"schema": {
"description": "Include story/comment text in searchable fields. Default: true. Set false to search title/URL only.",
"type": "boolean"
}
},
{
"in": "query",
"name": "sort",
"required": false,
"schema": {
"description": "Ranking mode. Default: `popularity`.",
"enum": [
"date",
"popularity"
],
"maxLength": 4096,
"minLength": 1,
"type": "string"
}
},
{
"in": "query",
"name": "type",
"required": false,
"schema": {
"description": "Restrict search results to a Hacker News content type. `ask_hn`: Ask HN posts (questions to the community). `show_hn`: Show HN posts (projects/work being shared). `launch_hn`: Launch HN posts (YC-affiliated company launches). Default: `all`.",
"enum": [
"all",
"ask_hn",
"comment",
"job",
"launch_hn",
"poll",
"show_hn",
"story"
],
"maxLength": 4096,
"minLength": 1,
"type": "string"
}
},
{
"in": "query",
"name": "typoTolerance",
"required": false,
"schema": {
"description": "Enable typo tolerance. Default: true.",
"type": "boolean"
}
},
{
"in": "query",
"name": "url",
"required": false,
"schema": {
"description": "Restrict search to story URLs matching this URL substring. Can omit `query`.",
"maxLength": 4096,
"minLength": 1,
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
已观察到的响应结构
以下结构来自探针或抽样请求的成功结果,只反映已观察到的部分:字段和类型可能变化,不保证每次都有。已有正式响应定义优先;这里不发布真实响应值。- HTTP 状态 / 最近观察日期: 200 / 2026-11-28
{
"additionalProperties": true,
"properties": {
"aisa_pagination": {
"additionalProperties": true,
"properties": {
"has_more": {
"type": "boolean"
},
"next_cursor": {
"type": [
"null",
"string"
]
},
"next_param": {
"type": "string"
}
},
"type": "object"
},
"data": {
"additionalProperties": true,
"properties": {
"page": {
"additionalProperties": true,
"properties": {
"hasMore": {
"type": "boolean"
},
"nextPage": {
"type": [
"null",
"integer"
]
},
"page": {
"type": "integer"
},
"pageSize": {
"type": "integer"
}
},
"type": "object"
},
"query": {
"type": "string"
}
},
"type": "object"
},
"meta": {
"additionalProperties": true,
"properties": {
"version": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
费用与请求规则
按实际用量收费。 默认请求预估费用:$0.014 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。翻页
- 把
aisa_pagination.next_cursor作为page(查询参数)传入即可获取下一页;aisa_pagination.has_more为 false 时停止。 - 响应头
X-AISA-Has-More与X-AISA-Next-Cursor返回相同的值。 - 页大小参数:
limit
响应时间
- 通常 10 秒内返回。
授权
查询参数
Restrict search results to a Hacker News content type. ask_hn: Ask HN posts (questions to the community). show_hn: Show HN posts (projects/work being shared). launch_hn: Launch HN posts (YC-affiliated company launches). Default: all.
可用选项:
all, ask_hn, comment, job, launch_hn, poll, show_hn, story Required string length:
1 - 4096响应
Observed successful JSON response. This partial structure comes from successful probe or sampled requests; fields and types may vary. No field is guaranteed to be present. Last observed: 2026-11-28.