Sends your prompt to Microsoft Copilot Search (AI Mode on bing.com) as a logged-out visitor and returns its answer as markdown and plain text, with the sources it read and cited (citations: title, url, source, snippet) and the model feed when shown. search_queries is null and related_questions empty: Copilot Search does not show them to logged-out visitors. Some prompts (often shopping) get plain search results instead of an AI answer; those calls fail with 502 and are not charged. Each call is a new conversation. The prompt is sent as-is (max 2,000 characters). Answers take about 15-30 s. Every response includes credits_used: the credits this call cost.
Parameters
name
type
description
promptrequired
string
The question, as you would type it into Copilot (max 2,000 characters; also accepted as q). Example: What is the tallest building in Europe?
country
string
Ask from this country (two-letter code; default US). Example: US Default: US
import os, requests
res = requests.get(
"https://api.api.sh/copilot/v1/ask",
params={"prompt": "What is the tallest building in Europe?"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json()
const url = new URL("https://api.api.sh/copilot/v1/ask");
url.searchParams.set("prompt", "What is the tallest building in Europe?");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json();
Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).
The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.