Ask Copilot
curl --request GET \
--url https://scrapebadger.com/v1/copilot/ask \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/copilot/ask"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/copilot/ask', 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://scrapebadger.com/v1/copilot/ask",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$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://scrapebadger.com/v1/copilot/ask"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/copilot/ask")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/copilot/ask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"prompt": "<string>",
"answer": "<string>",
"answer_markdown": {},
"citations": [
{
"url": "<string>",
"title": {},
"snippet": {},
"domain": {},
"site_name": {},
"ref_index": {},
"start_index": {},
"end_index": {},
"matched_text": {}
}
],
"search_results": [
{}
],
"source_domains": [
"<string>"
],
"search_queries": [
"<string>"
],
"web_search_triggered": true,
"truncated": true,
"cached": true,
"conversation_id": {},
"market": "<string>",
"country": "<string>",
"answer_length": 123,
"citation_count": 123,
"latency_ms": 123,
"created_utc": {},
"created_at": {}
}Ask
Ask Copilot
Send a prompt to Microsoft Copilot (Copilot Search in Bing) and get the grounded answer as structured JSON, with its claim-level citations and every web source it retrieved.
GET
/
v1
/
copilot
/
ask
Ask Copilot
curl --request GET \
--url https://scrapebadger.com/v1/copilot/ask \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/copilot/ask"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/copilot/ask', 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://scrapebadger.com/v1/copilot/ask",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$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://scrapebadger.com/v1/copilot/ask"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/copilot/ask")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/copilot/ask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"prompt": "<string>",
"answer": "<string>",
"answer_markdown": {},
"citations": [
{
"url": "<string>",
"title": {},
"snippet": {},
"domain": {},
"site_name": {},
"ref_index": {},
"start_index": {},
"end_index": {},
"matched_text": {}
}
],
"search_results": [
{}
],
"source_domains": [
"<string>"
],
"search_queries": [
"<string>"
],
"web_search_triggered": true,
"truncated": true,
"cached": true,
"conversation_id": {},
"market": "<string>",
"country": "<string>",
"answer_length": 123,
"citation_count": 123,
"latency_ms": 123,
"created_utc": {},
"created_at": {}
}Ask Microsoft Copilot (Copilot Search in Bing), Microsoft’s public Copilot
answer engine at
Only
The answer comes back in Japanese from the
bing.com/copilotsearch, a question anonymously and get the
answer back as JSON, plus every source Copilot retrieved, which of those it
cited, and the searches it ran.
Accepts GET (query params) or POST (JSON body) with identical fields.
Credits: 20
A fresh answer usually takes 15–25 s, and retries across exits can add
more, so raise your client timeout well above the 5–10 s default (the
examples use 120 s). When Copilot serves its own recent cached answer for the
same prompt, the call returns in under 1 s with
cached: true.Authorization
Query Parameters
The question to ask. Maximum 2,000 characters. Each request is standalone,
so include all the context you need here.
ISO-3166 alpha-2 country, e.g.
US, DE, JP. The ask egresses from that
country and, unless you set market, is answered in that country’s Bing
market (e.g. JP: ja-JP).The egress is best-effort: when no exit in that country answers, the last
retry may egress from the US and the response country says so. Set
strict_country to forbid that.Bing market code in
language-COUNTRY form, e.g. ja-JP, en-GB. Defaults
to the market of country, otherwise en-US. See
List Markets for the curated
list; any well-formed language-COUNTRY code is also accepted.Answer only from an exit in
country, never another one. When no exit there
answers the call fails with 503 and
detail.code = "country_unavailable". It is not billed (only 2xx
responses are). Requires country — 400 otherwise. A JSON boolean on
POST.Response
Claim-level citations. Each one anchors a span of
answer (by character
offsets) to the source that supports it, identified by ref_index.Show Citation
Show Citation
Everything Copilot retrieved:
url, title, snippet, domain,
site_name, ref_index, plus cited (boolean, true when the answer
cites it). When cached is true, this lists only the cited sources.The country the ask egressed from. Without
strict_country it can differ from the country you asked for.Errors
| Status | detail.code | When | Billed |
|---|---|---|---|
400 | — | Empty prompt, prompt over 2,000 characters, strict_country without country, or a malformed country/market | No |
422 | content_refused | Copilot declined to answer the prompt | No |
502 | empty_answer, blocked, throttled | Upstream failure at Copilot | No |
503 | country_unavailable | strict_country set and no exit in country answered | No |
2xx responses are billed.
Example
curl -G "https://scrapebadger.com/v1/copilot/ask" \
-H "X-API-Key: YOUR_API_KEY" \
--data-urlencode "prompt=法人向けクラウド会計ソフトの日本市場シェアランキングを教えてください" \
--data-urlencode "country=JP" \
--data-urlencode "strict_country=true" \
--max-time 120
const res = await fetch("https://scrapebadger.com/v1/copilot/ask", {
method: "POST",
headers: {
"X-API-Key": process.env.SCRAPEBADGER_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "法人向けクラウド会計ソフトの日本市場シェアランキングを教えてください",
country: "JP",
strict_country: true,
}),
signal: AbortSignal.timeout(120_000),
});
const data = await res.json();
console.log(data.market, data.cached, data.answer);
import requests
res = requests.post(
"https://scrapebadger.com/v1/copilot/ask",
headers={"X-API-Key": "YOUR_API_KEY"},
json={
"prompt": "法人向けクラウド会計ソフトの日本市場シェアランキングを教えてください",
"country": "JP",
"strict_country": True,
},
timeout=120,
)
data = res.json()
for c in data["citations"]:
print(c["ref_index"], c["domain"], "->", c["matched_text"])
ja-JP market, names products such
as freee会計, マネーフォワード クラウド会計 and 弥生会計 Next, and cites sources
such as it-trend.jp. An abridged response:
200 Response (abridged)
{
"prompt": "法人向けクラウド会計ソフトの日本市場シェアランキングを教えてください",
"answer": "… freee会計 … マネーフォワード クラウド会計 … 弥生会計 Next …",
"citations": [
{
"url": "https://it-trend.jp/…",
"domain": "it-trend.jp",
"ref_index": 1,
"start_index": 0,
"end_index": 42,
"matched_text": "…"
}
],
"web_search_triggered": true,
"truncated": false,
"cached": false,
"market": "ja-JP",
"country": "JP"
}
Strict country
By defaultcountry is best-effort, so a country that is short of exits still
gets an answer, possibly from a US exit on the last retry. Check the response
country to see where the ask egressed. When the country matters more than the
answer (local rankings, per-country visibility tracking), set
strict_country=true. If no exit there answers you get a 503, which is not
billed. Retry later rather than dropping strict_country:
503 Response
{
"detail": {
"code": "country_unavailable",
"message": "…"
}
}
Copilot is non-deterministic. The same prompt can return different wording
and different sources on each call, and a
cached: true answer reflects
whatever Copilot cached recently. For tracking, sample on a schedule and
aggregate.
