为一组 URL 提取完整页面内容。
curl --request POST \
--url https://api.aisa.one/apis/v1/exa/contents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"https://example.com/article"
],
"text": true,
"highlights": true,
"summary": true,
"subpages": 123
}
'import requests
url = "https://api.aisa.one/apis/v1/exa/contents"
payload = {
"ids": ["https://example.com/article"],
"text": True,
"highlights": True,
"summary": True,
"subpages": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ids: ['https://example.com/article'],
text: true,
highlights: true,
summary: true,
subpages: 123
})
};
fetch('https://api.aisa.one/apis/v1/exa/contents', 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/exa/contents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
'https://example.com/article'
],
'text' => true,
'highlights' => true,
'summary' => true,
'subpages' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/exa/contents"
payload := strings.NewReader("{\n \"ids\": [\n \"https://example.com/article\"\n ],\n \"text\": true,\n \"highlights\": true,\n \"summary\": true,\n \"subpages\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/exa/contents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"https://example.com/article\"\n ],\n \"text\": true,\n \"highlights\": true,\n \"summary\": true,\n \"subpages\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/exa/contents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"https://example.com/article\"\n ],\n \"text\": true,\n \"highlights\": true,\n \"summary\": true,\n \"subpages\": 123\n}"
response = http.request(request)
puts response.read_body{
"requestId": "<string>",
"results": [
{
"title": "<string>",
"url": "<string>",
"publishedDate": "<string>",
"author": "<string>",
"id": "<string>",
"text": "<string>",
"highlights": [
"<string>"
],
"summary": "<string>"
}
]
}搜索 API
Exa Contents
为你已经拿到的 URL 取回页面正文和元信息。
POST
https://api.aisa.one/apis/v1
/
exa
/
contents
为一组 URL 提取完整页面内容。
curl --request POST \
--url https://api.aisa.one/apis/v1/exa/contents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"https://example.com/article"
],
"text": true,
"highlights": true,
"summary": true,
"subpages": 123
}
'import requests
url = "https://api.aisa.one/apis/v1/exa/contents"
payload = {
"ids": ["https://example.com/article"],
"text": True,
"highlights": True,
"summary": True,
"subpages": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ids: ['https://example.com/article'],
text: true,
highlights: true,
summary: true,
subpages: 123
})
};
fetch('https://api.aisa.one/apis/v1/exa/contents', 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/exa/contents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
'https://example.com/article'
],
'text' => true,
'highlights' => true,
'summary' => true,
'subpages' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/exa/contents"
payload := strings.NewReader("{\n \"ids\": [\n \"https://example.com/article\"\n ],\n \"text\": true,\n \"highlights\": true,\n \"summary\": true,\n \"subpages\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/exa/contents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"https://example.com/article\"\n ],\n \"text\": true,\n \"highlights\": true,\n \"summary\": true,\n \"subpages\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/exa/contents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"https://example.com/article\"\n ],\n \"text\": true,\n \"highlights\": true,\n \"summary\": true,\n \"subpages\": 123\n}"
response = http.request(request)
puts response.read_body{
"requestId": "<string>",
"results": [
{
"title": "<string>",
"url": "<string>",
"publishedDate": "<string>",
"author": "<string>",
"id": "<string>",
"text": "<string>",
"highlights": [
"<string>"
],
"summary": "<string>"
}
]
}为你已经拿到的 URL 取回页面正文和元信息。
ids 必填,接收 post_exa_search 返回的 id —— 那本身就是 URL,所以任何 URL 都能用。可开关 text、highlights、summary、subpages、livecrawl。返回 results[](含 id、title、url、author、text),外加一个 statuses[] 数组,逐个 URL 给出 status 和 source —— 一定要读,取不到的 URL 记在那里而不是抛错。命中缓存时立即返回,未命中则回落到实时抓取。实测 1.2 秒。按次固定计费 $0.08。要的是整站而不是一份 URL 清单,用 post_firecrawl_crawl。授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json