Yahoo 搜尋 API
最后更新于
最后更新于
/search?engine=yahoo
API 端點允許您透過 SerpApi 服務獲取 Yahoo! 搜尋引擎的結果。
端點GET https://serpapi.abcproxy.com/search
描述
使用者可透過 GET 請求查詢:
https://serpapi.abcproxy.com/search?engine=yahoo_images
。前往查看互動式即時演示。
curl -X GET "https://serpapi.abcproxy.com/search" \
-d "engine=yahoo" \
-d "p=Coffee" \
-d "no_cache=false" \
-d "api_key=YOUR_API_KEY"
import requests
params = {
"engine": "yahoo",
"p": "Coffee",
"no_cache": "false",
"api_key": "YOUR_API_KEY"
}
response = requests.get("https://serpapi.abcproxy.com/search", params=params)
print(response.json())
const axios = require('axios');
const params = {
engine: "yahoo",
p: "Coffee",
no_cache: "false",
api_key: "YOUR_API_KEY"
};
axios.get("https://serpapi.abcproxy.com/search", { params })
.then(response => console.log(response.data));
GET /search?engine=yahoo&p=Coffee&no_cache=false&api_key=YOUR_API_KEY HTTP/1.1
Host: serpapi.abcproxy.com
<?php
$client = new \GuzzleHttp\Client();
$response = $client->get('https://serpapi.abcproxy.com/search', [
'query' => [
'engine' => 'yahoo',
'p' => 'Coffee',
'no_cache' => 'false',
'api_key' => 'YOUR_API_KEY'
]
]);
echo $response->getBody();
package main
import (
"net/http"
"io/ioutil"
"log"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://serpapi.abcproxy.com/search", nil)
q := req.URL.Query()
q.Add("engine", "yahoo")
q.Add("p", "Coffee")
q.Add("no_cache", "false")
q.Add("api_key", "YOUR_API_KEY")
req.URL.RawQuery = q.Encode()
resp, _ := client.Do(req)
body, _ := ioutil.ReadAll(resp.Body)
log.Println(string(body))
}
using System;
using System.Net.Http;
class Program
{
static async Task Main()
{
var client = new HttpClient();
var query = System.Web.HttpUtility.ParseQueryString(string.Empty);
query["engine"] = "yahoo";
query["p"] = "Coffee";
query["no_cache"] = "false";
query["api_key"] = "YOUR_API_KEY";
var response = await client.GetAsync(
$"https://serpapi.abcproxy.com/search?{query}"
);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
import java.net.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://serpapi.abcproxy.com/search" +
"?engine=yahoo" +
"&p=Coffee" +
"&no_cache=false" +
"&api_key=YOUR_API_KEY";
HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
conn.setRequestMethod("GET");
BufferedReader in = new BufferedReader(
new InputStreamReader(conn.getInputStream())
);
String response = in.lines().collect(Collectors.joining());
System.out.println(response);
}
}
搜尋查詢
p
字符串
是
定義搜尋查詢,可用於常規 Yahoo! 搜尋
coffee
本地化
yahoo_domain
字符串
否
指定 Yahoo! 域名
fr.search.yahoo.com
vc
字符串
否
指定國家(雙字母國家代碼)
uk
vl
字符串
否
指定搜尋語言
lang_fr
分頁
b
整數型
是
定義結果偏移量
1
進階篩選
vm
字符串
否
控制有機結果偏移量(預設1
)
1
vs
字符串
否
控制每頁結果數量
100
vf
字符串
否
pdf
fr2
字符串
否
控制元素渲染位置
-
d
字符串
否
指定相關主題目標頁面
-
Serpapi 參數
engine
字符串
是
需設為 yahoo
以使用 Yahoo! API
yahoo
no_cache
布爾值
否
強制重新抓取結果(即使有緩存)
true
或 false
api_key
字符串
是
SerpApi 私鑰
YOUR_API_KEY
響應主體
{
"code": 200,
"search_parameters": {
"engine": "yahoo",
"no_cache": true,
"api_key": "YOUR_API_KEY",
"p": "Coffee"
},
"search_metadata": {
"raw_html_file": "https://webserp.abcproxy.com/files/07df4a3eae24eaa5/c9e41136-658b-4e3e-8ea3-a3facd10b102.html",
"xray_html_file": "https://webserp.abcproxy.com/files/07df4a3eae24eaa5/c9e41136-658b-4e3e-8ea3-a3facd10b102.xray",
"total_time_taken": "35.3403",
"id": "c9e41136-658b-4e3e-8ea3-a3facd10b102",
"json_endpoint": "https://webserp.abcproxy.com/files/07df4a3eae24eaa5/c9e41136-658b-4e3e-8ea3-a3facd10b102.json",
"created_at": "2025-04-09 13:48:38",
"yahoo_url": "https://search.yahoo.com/search?ei=UTF-8&fr=fp-tts&p=Coffee"
},
"inline_videos": {
"items": [
{
"position": 1,
"source": "YouTube",
"duration": "5:40",
"views": "205.7K Views",
"title": "6 Ways Coffee Benefits Your Health | #DeepDives | Health",
"thumbnail": "https://up.yimg.com/ib/th?id=OVP.tfP_eY_jjunmtmVuDFxipwHgFo&pid=Api&w=296&h=156&c=7&p=0&rs=1&qlt=95",
"date": "Aug 30, 2020"
},
...
],
"see_more_link": "https://video.search.yahoo.com/search/video;_ylt=Awr98ZjwbPNnizsQA7hXNyoA;_ylu=Y29sbwNncTEEcG9zAzUEdnRpZAMEc2VjA3Nj?p=Coffee&fr=fp-tts"
},
"knowledge_graph": {
"profiles": [
{
"title": "Wiki",
"link": "https://en.wikipedia.org/wiki/Coffee"
}
],
"title": "Coffee",
"image": "https://s.yimg.com/fz/api/res/1.2/KeEAFWLeg8L6OhHT.XMCZQ--~C/YXBwaWQ9c3JjaGRkO2ZpPWZpdDtoPTEzMDtxPTgwO3c9MTAw/https://s.yimg.com/zb/imgv1/380d76fc-be63-3b73-9379-fdf0818cd2e2/t_500x300",
"description": "Coffee is a beverage brewed from roasted, ground coffee beans. Darkly colored, bitter, and slightly acidic, coffee has a stimulating effect on humans, primarily due to its caffeine content, but decaffeinated coffee is also commercially available. There are also various coffee substitutes. Typically served hot, coffee has the highest sales in the world market for hot drinks. Wikipedia ",
"description_link": {
"title": "Wikipedia",
"link": "http://en.wikipedia.org/wiki/Coffee"
}
},
"related_trending_searches": {
"title": "Coffee",
"bottom": [
{
"position": 1,
"link": "https://search.yahoo.com/search;_ylt=Awr98ZjwbPNnizsQ6rdXNyoA;_ylu=Y29sbwNncTEEcG9zAzMEdnRpZAMEc2VjA3Nj?ei=UTF-8&p=Organic+coffee&fr2=p%3As%2Cv%3Aw%2Cpos%3A0%2Cm%3AsingleCarousel%2Cct%3ACoffee&fr=fp-tts",
"thumbnail": "https://s.yimg.com/fz/api/res/1.2/0Ufm.VAgBIOmid90dOliPw--~C/YXBwaWQ9c3JjaGRkO2ZpPWZpbGw7aD0yMzI7cHhvZmY9NTA7cHlvZmY9NTA7cT04MDt3PTIzMg--/https://s.yimg.com/pv/static/shopping/img/1707203373677/coffee-Organic.jpg?v=15",
"snippet": "Organic"
},
...
]
},
"trending_searches": [
{
"title": "Donald Trump",
"link": "https://search.yahoo.com/search;_ylt=Awr98ZjwbPNnizsQKbhXNyoA;_ylu=Y29sbwNncTEEcG9zAzEEdnRpZAMEc2VjA3Nj?ei=UTF-8&p=Donald+Trump&fr2=p%3As%2Cv%3Aw%2Cm%3Atn%2Cct%3Aall%2Cpg%3A1%2Cstl%3Atxt%2Ckt%3Aorg%2Cb%3A&fr=fp-tts",
"thumbnail": "https://s.yimg.com/fz/api/res/1.2/1mf5Zl0WkHUPS8xiSZ86Mg--~C/YXBwaWQ9c3JjaGRkO2ZpPWZpbGw7aD0xNjA7cT04MDtzbT0xO3c9MzIw/https://media.zenfs.com/en/cnn_articles_875/d6db947a74cb7741235a931f6699c0f1",
"snippet": "Trump says he’s ready to talk as new stock market losses fuel tariff chaos",
"position": 1
},
...
],
"related_to_searches": [
{
"link": "https://search.yahoo.com/search;_ylt=Awr98ZjwbPNnizsQIbhXNyoA;_ylu=Y29sbwNncTEEcG9zAzEEdnRpZAMEc2VjA3JlbC1lYXN0?ei=UTF-8&p=coffee+shops+near+me&fr2=p%3As%2Cv%3Aw%2Cm%3Aat-e%2Cct%3Agossip&fr=fp-tts",
"position": 1,
"title": "coffee shops near me"
},
...
],
"related_questions": [
{
"title": "Which coffee maker makes the best drip coffee?",
"link": "https://search.yahoo.com/search;_ylt=Awr98ZjwbPNnizsQ8LdXNyoA;_ylu=Y29sbwNncTEEcG9zAzQEdnRpZAMEc2VjA3Nj?ei=UTF-8&p=Which+coffee+maker+makes+the+best+drip+coffee%3F&fr2=p%3As%2Cv%3Aw%2Cm%3AnuwaPeopleAlsoAsk&fr=fp-tts"
},
...
],
"organic_results": [
{
"snippet": "Jan 17, 2025 · From lavender-flavored lattes to single-origin pour-overs, here are our favorite coffee shops across L.A. In the last few years, L.A.’s coffee culture has blossomed into a sprawling, diverse... ",
"snippet_highlighted_words": [
"coffee ",
"coffee "
],
"favicon": "https://s.yimg.com/pv/static/search_favicon/images/32x32_fefaa30d76b9a1ca.png",
"origin_site": "Time Out",
"images": [
{
"link": "https://images.search.yahoo.com/search/images;_ylt=Awr98ZjwbPNnizsQ3LdXNyoA;_ylu=Y29sbwNncTEEcG9zAzEEdnRpZAMEc2VjA3Ny?ei=UTF-8&p=The+27+best+coffee+shops+in+Los+Angeles+-+Time+Out&fr=fp-tts&imgurl=https%3A%2F%2Fwww.bing.com%2Fimages%2Fsearch%3Fview%3DdetailV2%26ccid%3DUki3pBBi%26id%3DD5C7D2BDBE3CCCEBE30B284F17036031B9711109%26thid%3DOIP.Uki3pBBiF_y8KXSNFkLyXgHaFj%26mediaurl%3Dhttps%3A%2F%2Fmedia.timeout.com%2Fimages%2F106155159%2F1372%2F1029%2Fimage.jpg%26q%3DCoffee%26ck%3DB891EEB77887D5ED0E48748A8869A8AC%26idpp%3Drc%26idpview%3Dsingleimage%26form%3Drc2idp&name=Coffee1&turl=https%3A%2F%2Fsp.yimg.com%2Fib%2Fth%3Fid%3DOIP.Uki3pBBiF_y8KXSNFkLyXgHaFj%26pid%3DApi%26w%3D148%26h%3D148%26c%3D7%26rs%3D1&tt=Coffee1&sigit=.LVY_r8tkP6G&sigi=4wm0YLHbynf2&sign=or2mgQYzDrKi&sigt=or2mgQYzDrKi",
"thumbnail": "https://sp.yimg.com/ib/th?id=OIP.Uki3pBBiF_y8KXSNFkLyXgHaFj&pid=Api&w=148&h=148&c=7&rs=1"
},
...
],
"position": 1,
"title": "The 27 best coffee shops in Los Angeles - Time Out",
"url": "https://www.timeout.com/los-angeles/restaurants/the-best-coffee-shops-in-los-angeles"
},
...
]
},
"inline_images": {
"items": [
{
"thumbnail": "https://up.yimg.com/ib/th?id=OIP.Re7WHLgpMU2E8obQUJb-TAAAAA&pid=Api&rs=1&c=1&qlt=95&w=66&h=99",
"link": "https://images.search.yahoo.com/search/images;_ylt=Awr98ZjwbPNnizsQ4rdXNyoA;_ylu=Y29sbwNncTEEcG9zAzIEdnRpZAMEc2VjA3Nj?ei=UTF-8&p=Coffee&fr=fp-tts&th=710&tw=474&imgurl=http%3A%2F%2F3.bp.blogspot.com%2F-U2uqPh7hw0U%2FUHNEoLahrPI%2FAAAAAAAAAv8%2FbuuzujhKZkY%2Fs1600%2Fcoffee.jpg&rurl=http%3A%2F%2Fbellevueclub.blogspot.com%2F2012%2F10%2Fcoffees-health-benefitsand-how-to-taste.html&size=191KB&name=Bellevue+Club%3A+Coffee%27s+Health+Benefits...and+How+to+Taste+It%21&oid=1&h=710&w=474&turl=https%3A%2F%2Ftse1.mm.bing.net%2Fth%3Fid%3DOIP.Re7WHLgpMU2E8obQUJb-TAAAAA%26pid%3DApi&tt=Bellevue+Club%3A+Coffee%27s+Health+Benefits...and+How+to+Taste+It%21&sigr=rnAAVwMciMuZ&sigit=M0AeHccPrzKD&sigi=AqnI4YQ6m2u2&sign=fe5IlTuhTrog&sigt=fe5IlTuhTrog"
},
...
],
"see_more_link": "https://images.search.yahoo.com/search/images;_ylt=Awr98ZjwbPNnizsQ57dXNyoA;_ylu=Y29sbwNncTEEcG9zAzIEdnRpZAMEc2VjA3Nj?p=Coffee&fr=fp-tts"
},
"related_searches": {
"bottom": [
{
"query": "coffee shops near me",
"link": "https://search.yahoo.com/search;_ylt=Awr98ZjwbPNnizsQBrhXNyoA;_ylu=Y29sbwNncTEEcG9zAzEEdnRpZAMEc2VjA3JlbC1ib3Q-?ei=UTF-8&p=coffee+shops+near+me&fr2=p%3As%2Cv%3Aw%2Cm%3Ars-bottom%2Cct%3Agossip&fr=fp-tts"
},
...
]
},
"pagination": {
"current": "1",
"next": "https://search.yahoo.com/search;_ylt=Awr98ZjwbPNnizsQErhXNyoA;_ylu=Y29sbwNncTEEcG9zAzEEdnRpZAMEc2VjA3BhZ2luYXRpb24-?ei=UTF-8&fr=fp-tts&p=Coffee&b=8&pz=7&bct=0&xargs=0",
"other_pages": [
{
"2": "https://search.yahoo.com/search;_ylt=Awr98ZjwbPNnizsQDrhXNyoA;_ylu=Y29sbwNncTEEcG9zAzEEdnRpZAMEc2VjA3BhZ2luYXRpb24-?ei=UTF-8&fr=fp-tts&p=Coffee&b=8&pz=7&bct=0&xargs=0"
},
{
"3": "https://search.yahoo.com/search;_ylt=Awr98ZjwbPNnizsQD7hXNyoA;_ylu=Y29sbwNncTEEcG9zAzEEdnRpZAMEc2VjA3BhZ2luYXRpb24-?ei=UTF-8&fr=fp-tts&p=Coffee&b=15&pz=7&bct=0&xargs=0"
},
{
"4": "https://search.yahoo.com/search;_ylt=Awr98ZjwbPNnizsQELhXNyoA;_ylu=Y29sbwNncTEEcG9zAzEEdnRpZAMEc2VjA3BhZ2luYXRpb24-?ei=UTF-8&fr=fp-tts&p=Coffee&b=22&pz=7&bct=0&xargs=0"
},
{
"5": "https://search.yahoo.com/search;_ylt=Awr98ZjwbPNnizsQEbhXNyoA;_ylu=Y29sbwNncTEEcG9zAzEEdnRpZAMEc2VjA3BhZ2luYXRpb24-?ei=UTF-8&fr=fp-tts&p=Coffee&b=29&pz=7&bct=0&xargs=0"
}
]
},
...
}
響應欄位
search_parameters
對象
包含查詢參數及搜尋上下文
search_metadata
對象
包含時間和狀態資訊
search_information
對象
通用搜尋統計和元數據
organic_results
對象數組
主要搜尋結果(網站/文章)
inline_images
對象
內聯圖片結果
inline_videos
對象
內聯影片結果
ads_results
對象數組
贊助廣告列表
knowledge_graph
對象
知識面板資訊
related_trending
對象
當前熱門相關搜尋
shopping_results
對象數組
產品列表和購物優惠
local_map
對象
本地結果的地圖可視化
local_results
對象數組
附近商家列表
top_stories
對象數組
熱門新聞文章
answer_box
對象
查詢的即時答案
discover_more_places
對象數組
附加本地推薦
trending_searches
對象數組
今日熱門搜尋
related_searches
對象數組
相似搜尋建議
related_questions
對象數組
"其他人也問"問題
pagination
對象
結果分頁控制
常見錯誤
200
400
API 金鑰不可為空
200
401
參數錯誤
200
402
API 金鑰錯誤
200
403
餘額不足
200
404
扣費失敗
200
405
用量記錄失敗
200
406
不支援的引擎
200
407
網路錯誤
200
408
檔案不存在
200
429
請求過於頻繁
200
409
限制參數錯誤
200
410
URL 建構錯誤
200
411
查詢記錄失敗
200
412
找不到 JSON
200
413
獲取 HTML 錯誤
200
414
HTML 內容為空
錯誤範例
{
"code": 400,
"message": "API Key can not be empty"
}
文件格式篩選()