search
curl --request GET \
--url https://api.aisa.one/apis/v1/reddit/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/reddit/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/reddit/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/reddit/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/reddit/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/reddit/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/reddit/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{
"after": "t3_1izmcgx",
"posts": [
{
"author": "Morgentau7",
"author_fullname": "t2_2hy2xjit",
"created": 1658580900,
"created_utc": 1658580900,
"downs": 0,
"id": "w63dgy",
"is_video": true,
"name": "t3_w63dgy",
"num_comments": 1246,
"score": 220403,
"subreddit": "MadeMeSmile",
"subreddit_subscribers": 11605207,
"title": "Player realizes that he nearly stole the dogs job",
"total_awards_received": 0,
"ups": 220403,
"upvote_ratio": 0.97,
"url": "https://www.reddit.com/r/MadeMeSmile/comments/w63dgy/player_realizes_that_he_nearly_stole_the_dogs_job/"
}
],
"success": true
}Reddit
search
搜索 Reddit
GET
https://api.aisa.one
/
apis
/
v1
/
reddit
/
search
search
curl --request GET \
--url https://api.aisa.one/apis/v1/reddit/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/reddit/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/reddit/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/reddit/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/reddit/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/reddit/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/reddit/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{
"after": "t3_1izmcgx",
"posts": [
{
"author": "Morgentau7",
"author_fullname": "t2_2hy2xjit",
"created": 1658580900,
"created_utc": 1658580900,
"downs": 0,
"id": "w63dgy",
"is_video": true,
"name": "t3_w63dgy",
"num_comments": 1246,
"score": 220403,
"subreddit": "MadeMeSmile",
"subreddit_subscribers": 11605207,
"title": "Player realizes that he nearly stole the dogs job",
"total_awards_received": 0,
"ups": 220403,
"upvote_ratio": 0.97,
"url": "https://www.reddit.com/r/MadeMeSmile/comments/w63dgy/player_realizes_that_he_nearly_stole_the_dogs_job/"
}
],
"success": true
}在整个 Reddit 中搜索与查询匹配的帖子。
示例
curl "https://api.aisa.one/apis/v1/reddit/search?query=VALUE" \
-H "Authorization: Bearer YOUR_API_KEY"
请求规范
- 方法与路径: GET /apis/v1/reddit/search
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/reddit/search - after: query; 可选
- count: query; 可选
- filter: query; 可选
- limit: query; 可选
- query: query; 必填
- sort: query; 可选
- time: query; 可选
- timeframe: query; 可选
- trim: query; 可选
- trimmed: query; 可选
{
"operationId": "get_reddit_search",
"method": "GET",
"path": "/apis/v1/reddit/search",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "Used to paginate to next page",
"in": "query",
"name": "after",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "count",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Search posts or comments",
"in": "query",
"name": "filter",
"required": false,
"schema": {
"enum": [
"comments",
"posts"
],
"type": "string"
}
},
{
"in": "query",
"name": "limit",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Search query",
"in": "query",
"name": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Sort by\n\nProvider reference (supplier schema): `{\"enum\":[\"relevance\",\"new\",\"top\",\"comment_count\"],\"type\":\"string\"}`.",
"in": "query",
"name": "sort",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "time",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Timeframe\n\nProvider reference (supplier schema): `{\"enum\":[\"all\",\"day\",\"week\",\"month\",\"year\"],\"type\":\"string\"}`.",
"in": "query",
"name": "timeframe",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Set to true for a trimmed down version of the response",
"in": "query",
"name": "trim",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "trimmed",
"required": false,
"schema": {
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}