網頁搜尋、頁面擷取與網站地圖
網頁結果、頁面文字與網站地圖
由 SilentAPI Web Engine v1 驅動。Web Engine 尚處實驗階段,結果與速度可能波動。預計在線率 99.9%,目前算力有限,我們正在提升穩定性與在線率,並隨需求增長擴容算力。
網頁搜尋傳回查詢的排名結果清單,頁面擷取傳回頁面或 PDF 的可讀文字,網站地圖列出網站的頁面,三者均使用您常用的 SilentAPI API 金鑰,目前價格列於 [ 服務 ] 頁面。
方案
將 tier 設為 auto、standard 或 premium。設為 auto 時,請求先在標準等級上執行,僅當標準等級無法回答且你的餘額足夠時才會移至進階等級。實際提供服務的等級決定計費,顯示於回應的 tier 欄位中。
| 方案 | 行為 |
|---|---|
| auto | 先用 Standard,需要時再用 Premium。 |
| standard | 資料中心代理,遵循 robots.txt。 |
| premium | 以合乎道德與合法方式取得的住宅代理,可觸及封鎖資料中心流量的網站。 |
Web Extract 在標準版每頁包含最高 1 MB 頻寬,進階版最高 2 MB。超出部分,以及 Web Map,按標準版每 10 MB $0.01、進階版每 10 MB $0.02 收費,按 MB 計費。要發起請求,你的餘額必須涵蓋 1 GB 頻寬,實際只按請求使用的量收費。
快取
快取預設開啟,每筆開啟快取的請求均按正常價格的十分之一計費,無論是否有快取副本回應。快取副本在帳號間共用且不含任何帳號資料。快取副本的回應外觀與費用與新查詢相同,因此無人能得知他人查詢過什麼。將 cache 設為 false 即可一律以正常價格取得新答案,您的請求隨即不再被儲存。
快取結果遵循各網站的快取規則,Standard 方案最長 24 小時、Premium 方案最長 1 小時;freshness 為 day 時搜尋結果保留 10 分鐘,要求不被快取的頁面保留 5 分鐘。
若來源故障,可能改由較舊的儲存副本回應。
結果品質
我們持續努力維持結果的相關性,並減少垃圾訊息、假網站與危險連結。每次搜尋結合多個獨立來源,來源一致的結果排名更高。SilentAPI 會在回傳答案前移除重複結果與追蹤參數。
SilentAPI 會捨棄與查詢不符的結果頁面,例如誘餌頁面與離題的次要結果,且絕不回傳不安全配置的連結。兩項封鎖預設開啟,可分別關閉。block_threats 移除已知從事網路釣魚、詐騙、惡意軟體、假商店與跟蹤軟體的網域之結果與頁面。block_ads 移除廣告與追蹤網域,除非您的查詢指明該網站。將 filter 設為 false 可同時關閉兩者,明確指定 block_threats 或 block_ads 則優先適用。
沒有完美的過濾器,請以看待公開網路上任何頁面的態度看待結果,並向可信來源查證重要事實。
隱私權與條款
SilentAPI 不記錄您的查詢、網址或結果,網站永遠看不到您的 IP 位址與帳號;快取僅保存查詢或網址的雜湊值與結果,不含帳號資料,並會在 24 小時 內刪除所有項目,詳見 [ 隱私權政策 ]。
您須為傳送的查詢與網址,以及收到內容的使用方式負責,須遵守所存取網站的條款,不得使用這些端點攻擊或壓垮任何網站,完整規範請參閱 [ 服務條款 ]。
區域
設定 region 可選擇請求的發出地點,三個端點接受相同的值;若該地點無回應,請求會自動轉往最近的區域。
| 值 | 行為 |
|---|---|
| auto | 預設值;網頁搜尋請求若將 country 設為下方列出的國家代碼,即從該國發出,其他所有請求均從美國發出。 |
| global | 每次請求從清單中隨機選用一個國家。 |
| 區域名稱 | north-america, latin-america, central-america, caribbean, south-america, europe, eu-west, eu-north, eu-east, asia, asia-east, asia-southeast, asia-south, oceania, middle-east, africa, africa-north, africa-west, or africa-east |
| 國家代碼 | us, ca, mx, gt, hn, cr, pa, do, pr, br, ar, cl, co, pe, uy, ec, ve, gb, ie, de, fr, nl, be, at, ch, es, pt, it, se, no, fi, dk, pl, ro, cz, hu, bg, gr, ua, jp, kr, tw, hk, sg, in, pk, th, my, id, vn, au, nz, ae, sa, il, tr, za, ng, ke, ma, tn, gh, ci, tz, or ug |
網頁搜尋
POST /v1/silentapi/search 傳回查詢的網頁結果。
curl https://api.silentapi.com/v1/silentapi/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"private api gateway","max_results":3,"freshness":"week","lang":"en"}'
| 名稱 | 類型 | 預設值 | 規則 |
|---|---|---|---|
| query | string | 必填 | 搜尋文字,接受 q 作為別名。 |
| tier | string | auto | auto, standard, or premium |
| max_results | integer | 10 | 1 至 30;每組最多 10 筆結果計為一次搜尋,因此 20 的費用為 10 的兩倍,30 為三倍。 |
| offset | integer | 0 | 0 至 29;為下一頁略過該數量的結果,offset 加 max_results 維持在 30 以下,且僅就傳回的頁面收費。 |
| safe | string | moderate | moderate、strict 或 off |
| lang | string | en | 結果的語言代碼或名稱,例如 de、ja、pt-br 或 Persian |
| country | string | none | 在地結果的國家代碼或名稱,例如 us、CAN 或 Germany |
| region | string | auto | 區域清單中的一個值 |
| freshness | string | none | day、week 或 month |
| topic | string | web | web 為一般結果,news 為新聞網站的近期文章,images 為圖片,videos 為影片頁面,tor 為 Tor 網站,i2p 為 I2P 網站,dark 為兩者兼具 |
| include_domains | array | none | 最多 20 個網域,例如 ["python.org"];僅傳回這些網域及其子網域的結果。 |
| exclude_domains | array | none | 最多 20 個網域,其結果會被移除 |
| cache | boolean | true | 允許使用儲存的答案,價格為一成 |
| block_threats | boolean | true | 捨棄來自惡意主機的結果,傳送 false 可保留 |
| block_ads | boolean | true | 捨棄廣告與追蹤結果,傳送 false 可保留 |
| filter | boolean | true | 同時設定 block_threats 與 block_ads |
兩個網域清單亦接受逗號分隔的字串;topic 設為 news 時,每筆結果還會有帶發佈者名稱的 source,freshness 可將文章限於最近一天、一週或一個月。
{
"status": "ok",
"query": "private api gateway",
"results": [
{
"position": 1,
"title": "Example result",
"url": "https://example.com/page",
"domain": "example.com",
"snippet": "First lines of the page.",
"date": "2026-11-02"
}
],
"tier": "standard",
"cost": 0.1
}
| 欄位 | 類型 | 意義 |
|---|---|---|
| status | string | 請求完成時為 ok |
| query | string | 實際搜尋的查詢 |
| results | array | 結果依排名排序。每筆結果都有 position、title、url、domain 和 snippet,已知時還會加上 date 和 source。 |
| tier | string | 實際提供服務的方案 |
| cost | number | 以額度計的費用,亦見於 X-SilentAPI-Cost 標頭 |
日期採 YYYY-MM-DD 格式,結果連結會移除 utm_source 等追蹤參數,重複連結會合併為一筆結果。
圖像搜尋
將 topic 設為 images 即可搜尋圖片;每筆結果保留圖片所在頁面的 url,並以 image 提供圖檔的直接連結,width 與 height 為已知時的完整像素尺寸。同一頁面可能因不同圖片多次出現。freshness、safe 與兩個網域清單的用法與網頁結果相同,網域清單適用於頁面而非圖檔。圖像搜尋的計費與網頁搜尋相同。
curl https://api.silentapi.com/v1/silentapi/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"red panda","topic":"images","max_results":2}'
{
"status": "ok",
"query": "red panda",
"results": [
{
"position": 1,
"title": "Red panda facts",
"url": "https://example.com/red-panda",
"domain": "example.com",
"snippet": "A red panda resting in a tree.",
"image": "https://example.com/uploads/red-panda.jpg",
"width": 2048,
"height": 1356
}
],
"tier": "standard",
"cost": 0.1
}
影片搜尋
將 topic 設為 videos 即可取得 YouTube、TikTok 與 Vimeo 等網站的影片頁面,每筆結果可另附 source(網站名稱)、channel(上傳者)、duration(秒數)、views(整數)與 date。日期來自上傳時間,可能有數日誤差。YouTube 結果另附 thumbnail 連結。未知欄位將省略。影片搜尋與網頁搜尋計費相同。
{
"position": 1,
"title": "Red pandas at play",
"url": "https://www.youtube.com/watch?v=abcdefghijk",
"domain": "youtube.com",
"source": "YouTube",
"channel": "Example Zoo",
"duration": 56,
"views": 16900,
"date": "2026-10-29",
"thumbnail": "https://i.ytimg.com/vi/abcdefghijk/hqdefault.jpg"
}
暗網搜尋
將 topic 設為 tor 可搜尋 .onion 網站,設為 i2p 可搜尋 .i2p 網站,設為 dark 可同時搜尋兩個網路。結果包含 title、url、domain 與 snippet,已知時另附 date。位址經可信連結目錄確認的服務排名優先,並將 verified 設為 true。冒用已列名服務名稱或使用無效洋蔥位址的未知網站將視為網路釣魚,SilentAPI 會將其移除。暗網搜尋僅適用於 Premium 方案,將 tier 設為 auto 即會對其使用 Premium。無論篩選設定為何,被禁的洋蔥位址一律從結果中移除。暗網搜尋與 Premium 網頁搜尋計費相同。
curl https://api.silentapi.com/v1/silentapi/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"securedrop directory","topic":"tor","max_results":5}'
{
"status": "ok",
"query": "securedrop directory",
"results": [
{
"position": 1,
"title": "SecureDrop Directory",
"url": "http://vfnmxpa6fo4jdpyq3yneqhglluweax2uclvxkytfpmpkp5rsl75ir5qd.onion/",
"domain": "vfnmxpa6fo4jdpyq3yneqhglluweax2uclvxkytfpmpkp5rsl75ir5qd.onion",
"snippet": "A directory of SecureDrop instances.",
"date": "2026-11-21"
}
],
"tier": "premium",
"cost": 0.2
}
頁面擷取同樣可在 Premium 方案讀取 .onion 與 .i2p 頁面,並拒絕相同的被禁位址。
頁面擷取
POST /v1/silentapi/extract 讀取單一頁面或 PDF 並傳回其主文,不含選單、廣告或指令碼,頁面擷取按頁加下載的資料量計費。
curl https://api.silentapi.com/v1/silentapi/extract \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://www.iana.org/help/example-domains","format":"markdown","max_chars":20000}'
| 名稱 | 類型 | 預設值 | 規則 |
|---|---|---|---|
| url | string | 必填 | http 或 https 位址,最多 2,048 個字元 |
| tier | string | auto | auto, standard, or premium |
| format | string | markdown | markdown 或 text |
| max_chars | integer | 100000 | 500 至 400000 |
| region | string | auto | 區域清單中的一個值 |
| lang | string | none | 偏好的頁面語言(代碼或名稱,例如 fr 或 French),適用於提供多種語言的網站 |
| cache | boolean | true | 允許使用儲存的答案,價格為一成 |
| links | boolean | false | 為 true 時,頁面上找到的連結會傳回於 links |
| block_threats | boolean | true | 已知的惡意主機一律拒絕,傳送 false 可允許 |
| block_ads | boolean | true | 通往廣告與追蹤主機的連結會被移除,傳送 false 可保留 |
| filter | boolean | true | 同時設定 block_threats 與 block_ads |
頁面擷取支援任何語言的頁面,並以原文傳回文字;PDF 檔會逐頁讀取為文字,回應包含 pages 的數量。
{
"status": "ok",
"url": "https://www.iana.org/help/example-domains",
"title": "Example page",
"description": "A short summary of the page.",
"language": "en",
"published": "2026-11-12",
"content_type": "text/html",
"format": "markdown",
"length": 26,
"truncated": false,
"content": "# Example page\n\nPage text.",
"image": "https://example.com/cover.jpg",
"tier": "standard",
"cost": 0.16
}
| 欄位 | 類型 | 意義 |
|---|---|---|
| status | string | 請求完成時為 ok |
| url | string | 重新導向後實際讀取的位址 |
| title | string | 頁面標題 |
| description | string | 頁面摘要(若頁面有提供) |
| language | string | 頁面語言(若頁面有標示) |
| published | string | 發佈日期(YYYY-MM-DD 格式,若頁面有顯示) |
| content_type | string | 來源頁面的類型 |
| format | string | markdown 或 text |
| length | integer | content 的字元數 |
| truncated | boolean | 文字長於 max_chars 時為 True |
| archived | string | 公開封存副本的擷取時間,僅在網站拒絕所有請求時提供 |
| copy_of | string | 當頁面拒絕 Premium 方案的所有請求,而同一篇文章改由另一網站讀取時,所請求的位址由 url 標示 |
| content | string | 依請求格式傳回的頁面文字 |
| image | string | 頁面的主圖(若有) |
| pages | integer | 頁數,僅適用於 PDF 檔 |
| links | array | 僅在 links 為 true 時提供,每個連結有 url 與其 text,最多 500 個連結。 |
| tier | string | 實際提供服務的方案 |
| cost | number | 以額度計的費用,亦見於 X-SilentAPI-Cost 標頭 |
無值的欄位會從回應中省略,而非以 null 傳送。
truncated 為 true 的頁面僅含前 max_chars 個字元,提高 max_chars 可取得更多文字。
網站地圖
POST /v1/silentapi/map 列出網站的頁面,它會讀取網站發佈的網站地圖,缺漏或過短時再補上首頁找到的連結,網站地圖按次加下載的資料量計費。
curl https://api.silentapi.com/v1/silentapi/map \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","max_urls":100,"search":"blog"}'
| 名稱 | 類型 | 預設值 | 規則 |
|---|---|---|---|
| url | string | 必填 | 網站位址,例如 https://example.com |
| tier | string | auto | auto, standard, or premium |
| max_urls | integer | 200 | 1 至 1000 |
| search | string | none | 僅傳回包含此文字的位址,最多 200 個字元 |
| include_subdomains | boolean | false | 為 true 時,該網站子網域的頁面也會列出 |
| region | string | auto | 區域清單中的一個值 |
| cache | boolean | true | 允許使用儲存的答案,價格為一成 |
| block_threats | boolean | true | 已知的惡意主機一律拒絕,傳送 false 可允許 |
| block_ads | boolean | true | 通往廣告與追蹤主機的連結會被移除,傳送 false 可保留 |
| filter | boolean | true | 同時設定 block_threats 與 block_ads |
{
"status": "ok",
"url": "https://example.com",
"count": 2,
"urls": [
"https://example.com/blog",
"https://example.com/blog/first-post"
],
"tier": "standard",
"cost": 0.21
}
將 urls 中的任一位址傳給頁面擷取即可讀取該頁。
批次請求
網頁搜尋與頁面擷取一次請求最多接受 10 個項目;請向網頁搜尋傳送 queries、向頁面擷取傳送 urls,取代單一的 query 或 url,其他每個欄位適用於各項目。
curl https://api.silentapi.com/v1/silentapi/extract \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"urls":["https://example.com","https://example.com/missing"],"format":"text"}'
各項目並行執行,並依傳送順序回傳;每個項目與單一回應有相同的欄位,未完成的項目其 status 為 error,並附帶含 status、message、type 與 code 的 error 物件。
{
"status": "ok",
"count": 2,
"failed": 1,
"items": [
{ "status": "ok", "url": "https://example.com", "content": "Page text.", "tier": "standard", "cost": 0.16 },
{ "status": "error", "url": "https://example.com/missing", "error": { "status": 404, "message": "The page was not found.", "type": "not_found_error", "code": "not_found" }, "cost": 0 }
],
"cost": 0.16
}
頂層的 cost 為整批的總費用;若無任何項目完成,請求改為傳回第一個項目的錯誤。
程式碼範例
Python
import requests
API = "https://api.silentapi.com/v1/silentapi"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
search = requests.post(f"{API}/search", headers=HEADERS, json={
"query": "rust async runtime",
"max_results": 5,
"include_domains": ["docs.rs", "rust-lang.org"]
}, timeout=90).json()
for result in search["results"]:
print(result["position"], result["title"], result["url"])
page = requests.post(f"{API}/extract", headers=HEADERS, json={
"url": search["results"][0]["url"],
"format": "markdown"
}, timeout=90).json()
print(page["title"])
print(page["content"][:500])
JavaScript
const API = 'https://api.silentapi.com/v1/silentapi';
const headers = { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' };
async function call(path, body) {
const response = await fetch(`${API}/${path}`, { method: 'POST', headers, body: JSON.stringify(body) });
const data = await response.json();
if (!response.ok) throw new Error(data.error.message);
return data;
}
const news = await call('search', { query: 'open source security', topic: 'news', freshness: 'week' });
const headlines = news.results.map((item) => `${item.date} ${item.source}: ${item.title}`);
const batch = await call('extract', { urls: news.results.slice(0, 3).map((item) => item.url), format: 'text' });
const pages = batch.items.filter((item) => item.status === 'ok');
const missed = batch.items.filter((item) => item.status === 'error').map((item) => `${item.url}: ${item.error.message}`);
用戶端逾時請設為至少 90 秒,因為緩慢的網站可能需要一段時間回應。
錯誤
三個端點均傳回以下狀態:
| 狀態 | 意義 |
|---|---|
| 400 | 無效的輸入或網址 |
| 402 | 餘額不足以支付請求,或頁面需要的頻寬超出餘額可支付的範圍 |
| 403 | 網站無法擷取,或被安全過濾器拒絕(除非 block_threats 為 false) |
| 404 | 找不到頁面 |
| 413 | 頁面過大 |
| 415 | 不支援的內容類型 |
| 422 | 頁面過於複雜,或僅以 JavaScript 顯示內容 |
| 429 | 目標網站忙碌中,回應包含 Retry-After |
| 502 | 擷取失敗 |
| 503 | 服務暫時無法使用,回應包含 Retry-After |
| 504 | 逾時 |
錯誤使用與其他端點相同的內文;當搜尋或擷取本身失敗時,內文還會有 cost,並同時設定 X-SilentAPI-Cost 標頭:
{
"error": {
"message": "The page was not found.",
"type": "not_found_error",
"code": "not_found"
},
"cost": 0
}