Bing SERP API:参数与响应
Bing 搜索参数、原生结果、令牌分页和计费规则。
使用 GoAnyAPI 查询 Bing 搜索结果、排名及实际出现的搜索特征,可按市场、位置、设备及时间设置查询条件。
测试 Bing SERP API →
接口与鉴权
GET https://api.goanyapi.com/api/v1/bing-serpAuthorization: Bearer YOUR_API_KEY当前配置下,每次成功请求消耗 2 积分。
请求参数
| 参数 | 类型 | 必填 | 说明与约束 |
|---|---|---|---|
query | string | 是 | 搜索词,最多 8192 UTF-8 字节。 最大字符数:8192 coffee shops |
cc | string | 否 | 结果国家,不区分大小写;未传 mkt 时默认 us;与 mkt 互斥。 ar / AR / Ar / aR / au / AU / Au / aU / at / AT / At / aT / be / BE / Be / bE / br / BR / Br / bR / ca / CA / Ca / cA / cl / CL / Cl / cL / dk / DK / Dk / dK / fi / FI / Fi / fI / fr / FR / Fr / fR / de / DE / De / dE / hk / HK / Hk / hK / in / IN / In / iN / id / ID / Id / iD / it / IT / It / iT / jp / JP / Jp / jP / kr / KR / Kr / kR / my / MY / My / mY / mx / MX / Mx / mX / nl / NL / Nl / nL / nz / NZ / Nz / nZ / no / NO / No / nO / cn / CN / Cn / cN / pl / PL / Pl / pL / pt / PT / Pt / pT / ph / PH / Ph / pH / ru / RU / Ru / rU / sa / SA / Sa / sA / za / ZA / Za / zA / es / ES / Es / eS / se / SE / Se / sE / ch / CH / Ch / cH / tw / TW / Tw / tW / tr / TR / Tr / tR / gb / GB / Gb / gB / us / US / Us / uS / vn / VN / Vn / vN 默认值: us |
mkt | string | 否 | 结果市场,例如 fr-FR;不区分大小写,与 cc 互斥。^[A-Za-z]{2}-[A-Za-z]{2}$fr-FR |
setlang | string | 否 | 界面语言提示,不限制结果语言;Bing 可能回退为英语。 默认值: en-USen-US |
device | string | 否 | 设备类型。 desktop / mobile / tablet |
next_page_token | string | 否 | 使用 result.next_page_token;有效期一小时,翻页须保持搜索词及搜索控制不变;过期或被拒绝时重新搜索。 |
location | string | 否 | 搜索位置,地名或支持的国家代码;最多 512 UTF-8 字节,不含控制字符,与 coordinates 互斥。 最大字符数:512 ^[^\x00-\x1f\x7f]+$Austin, Texas |
coordinates | object | 否 | 位置偏好,不是严格地理边界;与 location 互斥;GET 请求中使用 JSON 对象字符串。{"latitude":30.2672,"longitude":-97.7431} |
safe | string | 否 | 安全搜索:active 严格过滤,off 请求不过滤。 active / off |
tbs | string | 否 | 时间范围:qdr:d/w/m/y,可附加 1–10000 的数量;或 cdr:1,cd_min:M/D/YYYY,cd_max:M/D/YYYY;不支持小时,与 filters 互斥。^(?:qdr:[dwmy](?:[1-9][0-9]{0,3}|10000)?|cdr:1,cd_min:(?:[1-9]|1[0-2])/(?:[1-9]|[12][0-9]|3[01])/[0-9]{4},cd_max:(?:[1-9]|1[0-2])/(?:[1-9]|[12][0-9]|3[01])/[0-9]{4})$qdr:w |
filters | string | 否 | Bing 原生 URL 筛选,最多 4096 UTF-8 字节,不含控制字符;与 tbs 互斥,翻页时保持原值。 最大字符数:4096 ^[^\x00-\x1f\x7f]+$ |
first | integer | 否 | 页起始位置,默认 1;大于 1 必须携带上一页令牌且与之匹配;传令牌时可省略 first。 默认值: 11 – 9007199254740991 |
sp | integer | 否 | Bing 拼写提示,仅支持 -1,不保证效果。 -1 |
color_scheme | string | 否 | 搜索页面配色,不改变排名。 light / dark |
output | string | 否 | 内容格式;html 为 Brotli 压缩并 Base64 编码的 HTML,md 为 Markdown,响应外层始终为 JSON。 json / html / md 默认值: json |
html | boolean | 否 | 返回编码的 HTML,等价于 output=html,与 json_restrictor 不兼容。 默认值: false |
json_restrictor | string | 否 | 筛选 content 字段,支持逗号路径、索引、[start:end]、[]、.{a,b},最多 128 个选择、16 层;不能用于 HTML。results[0:3].{title,url,snippet},has_next_page |
zero_trace | boolean | 否 | 不归档搜索采集产物;GoAnyAPI 请求历史及计费记录仍按现有规则保留,此参数不删除请求历史。 默认值: false |
no_cache | boolean | 否 | 兼容参数;无论 true 或 false 均实时获取,成功请求正常计费。 默认值: false |
可选参数不使用时直接省略。GET 中布尔值写为 true / false,coordinates 使用 URL 编码后的 JSON 对象。
cc 与 mkt、location 与 coordinates、tbs 与 filters 分别互斥。HTML 输出不能与 json_restrictor 同时使用。
请求示例
GET /api/v1/bing-serp?query=ai%20image&cc=us&setlang=en-US&device=desktop
Authorization: Bearer YOUR_API_KEY坐标编码前的对象示例:
{
"latitude": 30.2672,
"longitude": -97.7431
}位置只影响相关性,不是严格的地理边界。setlang 只提示界面语言,不限制结果文档语言。
分页
从 data.result.next_page_token 获取下一页令牌,保持搜索词、设备、市场、位置、时间及筛选条件不变,再次请求:
GET /api/v1/bing-serp?query=ai%20image&cc=us&setlang=en-US&device=desktop&next_page_token=TOKEN_FROM_PREVIOUS_RESPONSE
Authorization: Bearer YOUR_API_KEY令牌与搜索上下文绑定,有效期一小时;没有令牌时停止翻页。过期或被拒绝后,从第一页重新查询。first 可以省略;大于 1 时必须携带令牌且位置与令牌一致,不支持任意偏移翻页。
响应示例
以下为 2026-11-02 保存的真实 JSON 示例;分页令牌已替换为占位值,不能用于实际翻页。示例不包含固定价格,实际积分消耗见真实响应及当前计费配置。
{ "code": "ok", "message": "Example response", "data": { "endpoint": "bing-serp", "query": { "query": "ai image" }, "result": { "format": "json", "content": { "has_next_page": true, "results": [ { "classification": {}, "display_url": "deepai.org › machine-learning-model › text2img", "domain": "deepai.org", "domain_info": { "category": "", "sld": "deepai", "tld": "org" }, "engine": "bing", "favicon": "https://deepai.org/favicon.ico", "id": "s_e077d58bce1c9b05", "position": { "absolute": 1 }, "rank": 1, "snippet": "Whether you're a creator, developer, or entrepreneur, DeepAI's Free Online AI Image Generator gives you the power to visualize …", "source_name": "deepai.org", "thumbnail": "", "title": "AI Image Generator - DeepAI", "tracking_url": "", "type": "organic", "url": "https://deepai.org/machine-learning-model/text2img" }, { "classification": {}, "display_url": "bing.com › images › create › ai-image-generator", "domain": "bing.com", "domain_info": { "category": "", "sld": "bing", "tld": "com" }, "engine": "bing", "favicon": "https://bing.com/favicon.ico", "id": "s_6371a9eb2508c4c0", "position": { "absolute": 2 }, "rank": 2, "snippet": "Turn text into AI art, photos, and visuals instantly, all for free.", "source_name": "bing.com", "thumbnail": "", "title": "Free AI Image Generator - Bing Image Creator", "tracking_url": "", "type": "organic", "url": "https://www.bing.com/images/create/ai-image-generator" }, { "classification": {}, "display_url": "perchance.org › ai-text-to-image-generator", "domain": "perchance.org", "domain_info": { "category": "", "sld": "perchance", "tld": "org" }, "engine": "bing", "favicon": "https://perchance.org/favicon.ico", "id": "s_786b2022298e8794", "position": { "absolute": 3 }, "rank": 3, "snippet": "Use this AI to generate high quality art, photos, cartoons, drawings, anime, thumbnails, pfps, and more. Create OCs, anime …", "source_name": "perchance.org", "thumbnail": "", "title": "AI Image Generator (free, no sign-up, unlimited) - Perchance", "tracking_url": "", "type": "organic", "url": "https://perchance.org/ai-text-to-image-generator" }, { "classification": {}, "display_url": "gemini.google › overview › image-generation", "domain": "gemini.google", "domain_info": { "category": "", "sld": "gemini", "tld": "google" }, "engine": "bing", "favicon": "https://gemini.google/favicon.ico", "id": "s_fac4dce178da0a5a", "position": { "absolute": 4 }, "rank": 4, "snippet": "With Nano Banana 2, Gemini's AI image generator and photo editor, you can create high-quality images and edit photos into …", "source_name": "gemini.google", "thumbnail": "", "title": "Nano Banana 2 - Gemini AI image generator & photo editor", "tracking_url": "", "type": "organic", "url": "https://gemini.google/overview/image-generation" }, { "classification": {}, "display_url": "fotor.com › ai-image-generator", "domain": "fotor.com", "domain_info": { "category": "", "sld": "fotor", "tld": "com" }, "engine": "bing", "favicon": "https://fotor.com/favicon.ico", "id": "s_20ac617e4d648a0a", "position": { "absolute": 5 }, "rank": 5, "snippet": "Convert text to image with Fotor's free AI image generator. Explore industry-leading AI models, strong prompt adherence & high …", "source_name": "fotor.com", "thumbnail": "", "title": "Free AI Image Generator - Text to Image AI (No Signup) | Fotor", "tracking_url": "", "type": "organic", "url": "https://www.fotor.com/ai-image-generator" }, { "classification": {}, "display_url": "leonardo.ai › ai-image-generator", "domain": "leonardo.ai", "domain_info": { "category": "", "sld": "leonardo", "tld": "ai" }, "engine": "bing", "favicon": "https://leonardo.ai/favicon.ico", "id": "s_d9e939b49914b6e1", "position": { "absolute": 6 }, "rank": 6, "snippet": "Create AI images from text or visuals. Leonardo's AI image generator helps you generate, refine, and scale quality images for any …", "source_name": "leonardo.ai", "thumbnail": "", "title": "AI Image Generator - Create AI Images for Free", "tracking_url": "", "type": "organic", "url": "https://leonardo.ai/ai-image-generator" }, { "classification": {}, "display_url": "craiyon.com › en", "domain": "craiyon.com", "domain_info": { "category": "", "sld": "craiyon", "tld": "com" }, "engine": "bing", "favicon": "https://craiyon.com/favicon.ico", "id": "s_bf54975d51502c3a", "position": { "absolute": 7 }, "rank": 7, "snippet": "Create AI images from text with Craiyon. Generate, explore, and edit images online.", "source_name": "craiyon.com", "thumbnail": "", "title": "Free AI Image Generator - Craiyon", "tracking_url": "", "type": "organic", "url": "https://www.craiyon.com/en" }, { "classification": {}, "display_url": "free.ai › image", "domain": "free.ai", "domain_info": { "category": "", "sld": "free", "tld": "ai" }, "engine": "bing", "favicon": "https://free.ai/favicon.ico", "id": "s_f541d2234d954d9f", "position": { "absolute": 8 }, "rank": 8, "snippet": "Free AI Image Generator creates images from text descriptions using open-source models we run on our own GPUs: Stable …", "source_name": "free.ai", "thumbnail": "", "title": "Free AI Image Generator - Create Images from Text | Free.ai", "tracking_url": "", "type": "organic", "url": "https://free.ai/image" }, { "classification": {}, "display_url": "visualgpt.io › ai-image-generator", "domain": "visualgpt.io", "domain_info": { "category": "", "sld": "visualgpt", "tld": "io" }, "engine": "bing", "favicon": "https://visualgpt.io/favicon.ico", "id": "s_6a5108a4c1291ab4", "position": { "absolute": 9 }, "rank": 9, "snippet": "VisualGPT's AI Image Generator is a powerful AI-powered tool that turns words into unique images. Users can generate illustrations, …", "source_name": "visualgpt.io", "thumbnail": "", "title": "AI Image Generator – Free Online Text to Image, No Sign-Up", "tracking_url": "", "type": "organic", "url": "https://visualgpt.io/ai-image-generator" }, { "classification": {}, "display_url": "adobe.com › products › firefly › features › text-to…", "domain": "adobe.com", "domain_info": { "category": "", "sld": "adobe", "tld": "com" }, "engine": "bing", "favicon": "https://adobe.com/favicon.ico", "id": "s_5103f12230b18a39", "position": { "absolute": 10 }, "rank": 10, "snippet": "Easily create AI-generated images online for free with Adobe Firefly. Input simple text prompts and our AI image generator will do the …", "source_name": "adobe.com", "thumbnail": "", "title": "Free Online AI Text to Image Generator | Adobe Firefly", "tracking_url": "", "type": "organic", "url": "https://www.adobe.com/products/firefly/features/text-to-image.html?msockid=02308a37df8766d100a39232dec46756" } ], "search_parameters": { "cc": "us", "color_scheme": "", "coordinates": { "latitude": 0, "longitude": 0 }, "device": "", "engine": "bing", "filters": "", "first": 0, "location": "", "mkt": "", "q": "ai image", "safe": "", "setlang": "en-US", "sp": 0, "tbs": "", "type": "search" }, "serp_features": [] }, "next_page_token": "EXAMPLE_ONLY_RUN_A_SEARCH_FOR_A_FRESH_TOKEN", "pagination_limited": false } }}响应字段
| 字段 | 含义 |
|---|---|
data.endpoint | 固定为 bing-serp |
data.costCredits | 本次消耗积分 |
data.remainingCredits | 扣费后余额 |
data.query | 校验后的请求参数 |
data.result.format | json、md 或 html+br+base64 |
data.result.next_page_token | 下一页令牌;缺失或为空时停止翻页 |
data.result.pagination_limited | 返回时表示分页是否受限 |
data.result.content | JSON 对象、Markdown 字符串,或 Brotli 压缩并 Base64 编码的 HTML 字符串 |
data.result.content.search_parameters | 搜索上下文;其中搜索词字段为 q,引擎为 engine |
data.result.content.has_next_page | 是否还有下一页 |
data.result.content.results[] | 搜索结果,保留类型及排名 |
data.result.content.serp_features[] | 实际出现的搜索特征,包括出现时的 AI 摘要 |
结果记录可包含 id、rank、type、title、url、display_url、tracking_url、snippet、domain、favicon、thumbnail、source_name、position.absolute、engine、domain_info 和 classification。domain_info 可包含 tld、sld、category。
特征记录可包含 id、engine、type、title、text、items、links、source_result_ids、position、confidence 和 extracted_at。不保证每次搜索都出现特定模块。
缺失字段、null、空字符串和空数组按实际数据返回;不要根据缺少标题、图片或其他展示字段判断请求失败。使用 json_restrictor 后,未选择或不存在的字段可能缺失。
输出格式与记录
output=md 返回 Markdown;output=html 或 html=true 返回编码的 HTML。外层仍为 GoAnyAPI JSON 响应,Tester 不执行返回的 HTML。
zero_trace=true 关闭搜索采集产物归档,不删除 GoAnyAPI 的请求历史及计费记录。no_cache 是兼容参数,两种值都实时获取结果,正常计费。
计费与错误
每次成功请求按数据库配置扣费,包括有效空结果和每次成功翻页。参数错误、无效令牌及实际搜索失败不扣积分。错误继续使用 GoAnyAPI 的 code / message 响应格式。
旧版接入调整
URL、GoAnyAPI 鉴权和计费规则保持不变。旧版 q、setLang、brd_browser 及设备细分值不再接受;改用上表参数。结果改用 format / content / next_page_token,不再返回旧的 general / organic / pagination 结构。