Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Tip
At Microsoft Ignite 2026? Find all Web IQ resources in one place: documentation, training, code samples, and how to contact the team.
Make your first Microsoft Web IQ API call in a few minutes. Search the web, inspect the response, and extract query-focused passages from a known URL. Additional examples show Places Search and Auto evidence retrieval.
If you don't already have a Web IQ resource, create one using the Azure portal or Azure CLI before continuing.
Choose an SDK or REST example at the top of this page to switch all examples together. The SDKs handle authentication, retries, and response types for you.
API keys are the fastest way to evaluate Web IQ. For production workloads, use Microsoft Entra ID.
Prerequisites
- A Web IQ API key from Profile Management.
Note
If your application runs in China, call https://api.microsoftol.com/v3 instead of https://api.microsoft.ai/v3 for search endpoints. In the REST examples, replace the URL. When constructing an SDK client, set the same base URL with Python's base_url argument, TypeScript's baseUrl option, Rust's WebIqClient::builder().base_url(...), Java's WebIQClientOptions.builder().baseUrl(...), or .NET's WebIQClientOptions.BaseUrl property. See Base URL.
Tip
Prefer a guided start without code? Follow Get started in the Web IQ Developer Portal: select your app profile, create an API key, send a request from the Playground, copy the generated code, and check your usage.
1. Store your API key
Put the key in an environment variable so the request examples do not repeat it or place it in your source code.
macOS or Linux
export WEBIQ_API_KEY="your-api-key"
Windows PowerShell
$env:WEBIQ_API_KEY="your-api-key"
Warning
Don't commit your key to source control or expose it in browser or client-side code. Store production credentials in a secret manager.
2. Search the web
Use Web Search when you have a question or query and want Web IQ to discover and rank relevant pages.
We recommend setting maxResults = 10, contentFormat = passage, and maxLength = 3000 on every request as an optimized operating point. From there, you can fine-tune these settings based on your use case.
Endpoint: POST https://api.microsoft.ai/v3/search/web
curl --request POST "https://api.microsoft.ai/v3/search/web" \
--header "x-apikey: $WEBIQ_API_KEY" \
--header "content-type: application/json" \
--data '{
"query": "latest developments in retrieval augmented generation",
"maxResults": 10,
"contentFormat": "passage",
"maxLength": 3000
}'
Install the SDK with python -m pip install webiq==1.2.1 (Python 3.11 or later), then run:
import os
from webiq import WebIQClient
from webiq.types import ContentFormat
with WebIQClient(api_key=os.environ["WEBIQ_API_KEY"]) as client:
results = client.web.search(
"latest developments in retrieval augmented generation",
max_results=10,
content_format=ContentFormat.passage,
max_length=3000,
)
for result in results.webResults or []:
print(result.title, result.url)
Install the SDK with npm install @microsoft/webiq@1.2.1 (Node.js 22.18+ on 22.x, or 24+). Save this example as search.mts and run it with node search.mts.
import { WebIQClient, ContentFormat } from "@microsoft/webiq";
async function main() {
const client = new WebIQClient({ apiKey: process.env.WEBIQ_API_KEY });
try {
const results = await client.web.search(
"latest developments in retrieval augmented generation",
{
maxResults: 10,
contentFormat: ContentFormat.PASSAGE,
maxLength: 3000,
},
);
for (const result of results.webResults ?? []) {
console.log(result.title, result.url);
}
} finally {
await client.close();
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
In a Rust 1.88 or later project, run cargo add webiq@1.2.1 and cargo add tokio --features macros,rt-multi-thread. Save this example as src/main.rs and run cargo run.
use webiq::{ContentFormat, WebIqClient, WebSearchOptions};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = WebIqClient::new(std::env::var("WEBIQ_API_KEY")?)?;
let results = client.web().search(
"latest developments in retrieval augmented generation",
WebSearchOptions::new()
.max_results(10)
.content_format(ContentFormat::Passage)
.max_length(3000),
).await?;
for result in results.web_results.unwrap_or_default() {
println!("{:?} {:?}", result.title, result.url);
}
Ok(())
}
In a Maven project configured for Java 11 or later, add this dependency to pom.xml:
<dependency>
<groupId>com.microsoft.webiq</groupId>
<artifactId>webiq</artifactId>
<version>1.2.1</version>
</dependency>
Save this example as src/main/java/Search.java and run mvn compile exec:java -Dexec.mainClass=Search.
import com.microsoft.webiq.WebIQClient;
import com.microsoft.webiq.models.ContentFormat;
import com.microsoft.webiq.models.WebResponse;
import com.microsoft.webiq.models.WebResult;
import com.microsoft.webiq.resources.WebSearchOptions;
public class Search {
public static void main(String[] args) {
try (WebIQClient client = WebIQClient.withApiKey(System.getenv("WEBIQ_API_KEY"))) {
WebResponse results = client.web.search(
"latest developments in retrieval augmented generation",
WebSearchOptions.builder()
.maxResults(10)
.contentFormat(ContentFormat.PASSAGE)
.maxLength(3000)
.build());
if (results.getWebResults() != null) {
for (WebResult result : results.getWebResults()) {
System.out.println(result.getTitle() + " " + result.getUrl());
}
}
}
}
}
In a .NET 8 or later console project, run dotnet add package Microsoft.WebIQ --version 1.2.1. Save this example as Program.cs and run dotnet run.
using Microsoft.WebIQ;
using Microsoft.WebIQ.Models;
string apiKey = Environment.GetEnvironmentVariable("WEBIQ_API_KEY")
?? throw new InvalidOperationException("Set WEBIQ_API_KEY before running this example.");
using var client = new WebIQClient(apiKey);
var results = await client.Web.SearchAsync(
"latest developments in retrieval augmented generation",
request =>
{
request.MaxResults = 10;
request.ContentFormat = ContentFormat.Passage;
request.MaxLength = 3000;
});
foreach (var result in results.WebResults ?? [])
Console.WriteLine($"{result.Title} {result.Url}");
import os
import json
import requests
response = requests.post(
"https://api.microsoft.ai/v3/search/web",
headers={
"x-apikey": os.environ["WEBIQ_API_KEY"],
"content-type": "application/json",
},
json={
"query": "latest developments in retrieval augmented generation",
"maxResults": 10,
"contentFormat": "passage",
"maxLength": 3000,
},
timeout=30,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))
Save this example as search.mjs and run it with node search.mjs.
const response = await fetch("https://api.microsoft.ai/v3/search/web", {
method: "POST",
headers: {
"x-apikey": process.env.WEBIQ_API_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
query: "latest developments in retrieval augmented generation",
maxResults: 10,
contentFormat: "passage",
maxLength: 3000,
}),
});
if (!response.ok) {
throw new Error(`Web Search failed: ${response.status} ${await response.text()}`);
}
console.log(JSON.stringify(await response.json(), null, 2));
3. Understand the response
A successful Web Search returns a webResults array. This abbreviated example shows the fields you will use most often:
{
"webResults": [
{
"title": "Example result",
"url": "https://example.com/article",
"content": "The query-relevant passage extracted from the page...",
"crawledAt": "2026-07-18T12:00:00Z"
}
],
"traceId": "00000000000000000000000000000000"
}
titleandurlidentify the source.contentcontains the query-relevant passage because the request usedcontentFormat: "passage".traceIdhelps Web IQ Support investigate a request.
Across REST responses and MCP tool results, model fields with null or empty string ("") values are omitted, including fields of nested result objects; empty list/array ([]) fields are kept, except in Places, where list fields can also be absent. Treat an absent field as unavailable and an empty or absent list as having no items. Whitespace-only strings, false, 0, empty dictionaries, individual array/dictionary entries, and embedded raw JSON are preserved. Root arrays and protocol-envelope collections such as MCP content are unchanged.
See the Web Search API reference for all parameters and response fields.
4. Choose an endpoint
| Start with | Use | What you get |
|---|---|---|
| A question or search query | Web Search | Ranked pages with query-relevant content |
| A specific URL | Browse | Extracted content from that page |
| A place or local-business query | Places | Structured place details, such as addresses and opening hours |
| A query that needs automatically selected answer types | Auto through REST or SDKs 1.2.1 and later | Typed evidence with result-scoped citations |
A common grounding workflow uses both endpoints: search for relevant sources, select a result URL, then browse that URL to extract passages relevant to a follow-up question.
5. Extract content from a URL
Use Browse when you already know which page you want to read. Set contentFormat to passage and provide a nonblank query to retrieve the parts of the page most relevant to your question.
liveCrawl: "fallback" asks Web IQ to crawl the page when it is not already available in the index. Live crawling is subject to publisher politeness restrictions and availability; fallback doesn't guarantee an actual crawl.
All examples request query-focused passages, the recommended format for grounding. The selection query must be nonblank and no longer than 1000 characters; maxLength separately controls the amount of returned content. Full-document formats (text, html, and markdown) require full document access.
Endpoint: POST https://api.microsoft.ai/v3/browse
curl --request POST "https://api.microsoft.ai/v3/browse" \
--header "x-apikey: $WEBIQ_API_KEY" \
--header "content-type: application/json" \
--data '{
"url": "https://techcommunity.microsoft.com/blog/azuredevcommunityblog/why-ai-agents-need-external-grounding/4565283",
"query": "How fast is Web IQ",
"contentFormat": "passage",
"maxLength": 3000,
"liveCrawl": "fallback"
}'
Install the SDK with python -m pip install webiq==1.2.1 (Python 3.11 or later), then run:
import os
from webiq import WebIQClient
from webiq.types import BrowseContentFormat
with WebIQClient(api_key=os.environ["WEBIQ_API_KEY"]) as client:
page = client.browse.fetch(
"https://techcommunity.microsoft.com/blog/azuredevcommunityblog/why-ai-agents-need-external-grounding/4565283",
query="How fast is Web IQ",
content_format=BrowseContentFormat.passage,
max_length=3000,
live_crawl="fallback",
)
print(page.content)
Install the SDK with npm install @microsoft/webiq@1.2.1 (Node.js 22.18+ on 22.x, or 24+). Save this example as browse.mts and run it with node browse.mts.
import { WebIQClient, BrowseContentFormat, LiveCrawlMode } from "@microsoft/webiq";
async function main() {
const client = new WebIQClient({ apiKey: process.env.WEBIQ_API_KEY });
try {
const page = await client.browse.fetch(
"https://techcommunity.microsoft.com/blog/azuredevcommunityblog/why-ai-agents-need-external-grounding/4565283",
{
query: "How fast is Web IQ",
contentFormat: BrowseContentFormat.PASSAGE,
maxLength: 3000,
liveCrawl: LiveCrawlMode.FALLBACK,
},
);
console.log(JSON.stringify(page, null, 2));
} finally {
await client.close();
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
In a Rust 1.88 or later project, run cargo add webiq@1.2.1 and cargo add tokio --features macros,rt-multi-thread. Save this example as src/main.rs and run cargo run.
use webiq::{BrowseContentFormat, BrowseOptions, LiveCrawlMode, WebIqClient};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = WebIqClient::new(std::env::var("WEBIQ_API_KEY")?)?;
let page = client.browse().fetch(
"https://techcommunity.microsoft.com/blog/azuredevcommunityblog/why-ai-agents-need-external-grounding/4565283",
BrowseOptions::new()
.query("How fast is Web IQ")
.content_format(BrowseContentFormat::Passage)
.max_length(3000)
.live_crawl(LiveCrawlMode::Fallback),
).await?;
println!("{}", page.content.unwrap_or_default());
Ok(())
}
In a Maven project configured for Java 11 or later, add this dependency to pom.xml:
<dependency>
<groupId>com.microsoft.webiq</groupId>
<artifactId>webiq</artifactId>
<version>1.2.1</version>
</dependency>
Save this example as src/main/java/Browse.java and run mvn compile exec:java -Dexec.mainClass=Browse.
import com.microsoft.webiq.WebIQClient;
import com.microsoft.webiq.models.BrowseContentFormat;
import com.microsoft.webiq.models.BrowseResponse;
import com.microsoft.webiq.models.LiveCrawlMode;
import com.microsoft.webiq.resources.BrowseFetchOptions;
public class Browse {
public static void main(String[] args) {
try (WebIQClient client = WebIQClient.withApiKey(System.getenv("WEBIQ_API_KEY"))) {
BrowseResponse page = client.browse.fetch(
"https://techcommunity.microsoft.com/blog/azuredevcommunityblog/why-ai-agents-need-external-grounding/4565283",
BrowseFetchOptions.builder()
.query("How fast is Web IQ")
.contentFormat(BrowseContentFormat.PASSAGE)
.maxLength(3000)
.liveCrawl(LiveCrawlMode.FALLBACK)
.build());
System.out.println(page.getContent());
}
}
}
In a .NET 8 or later console project, run dotnet add package Microsoft.WebIQ --version 1.2.1. Save this example as Program.cs and run dotnet run.
using Microsoft.WebIQ;
using Microsoft.WebIQ.Models;
string apiKey = Environment.GetEnvironmentVariable("WEBIQ_API_KEY")
?? throw new InvalidOperationException("Set WEBIQ_API_KEY before running this example.");
using var client = new WebIQClient(apiKey);
var page = await client.Browse.FetchAsync(
"https://techcommunity.microsoft.com/blog/azuredevcommunityblog/why-ai-agents-need-external-grounding/4565283",
request =>
{
request.ContentFormat = BrowseContentFormat.Passage;
request.Query = "How fast is Web IQ";
request.MaxLength = 3000;
request.LiveCrawl = LiveCrawlMode.Fallback;
});
Console.WriteLine(page.Content);
import os
import json
import requests
response = requests.post(
"https://api.microsoft.ai/v3/browse",
headers={
"x-apikey": os.environ["WEBIQ_API_KEY"],
"content-type": "application/json",
},
json={
"url": "https://techcommunity.microsoft.com/blog/azuredevcommunityblog/why-ai-agents-need-external-grounding/4565283",
"query": "How fast is Web IQ",
"contentFormat": "passage",
"maxLength": 3000,
"liveCrawl": "fallback",
},
timeout=30,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))
Save this example as browse.mjs and run it with node browse.mjs.
const response = await fetch("https://api.microsoft.ai/v3/browse", {
method: "POST",
headers: {
"x-apikey": process.env.WEBIQ_API_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
url: "https://techcommunity.microsoft.com/blog/azuredevcommunityblog/why-ai-agents-need-external-grounding/4565283",
query: "How fast is Web IQ",
contentFormat: "passage",
maxLength: 3000,
liveCrawl: "fallback",
}),
});
if (!response.ok) {
throw new Error(`Browse failed: ${response.status} ${await response.text()}`);
}
console.log(JSON.stringify(await response.json(), null, 2));
A successful 200 response includes the page url, title, extracted content, and a traceId. A live crawl can return 202 with retryAfter, an ISO 8601 UTC timestamp; wait until that time, then send the same request again. See the Browse API reference for the complete response contract.
6. Search for places (optional)
Use Places Search for structured information about local businesses and other places. The SDK examples use the 1.2.1 packages installed in step 2.
Endpoint: POST https://api.microsoft.ai/v3/search/places
curl --request POST "https://api.microsoft.ai/v3/search/places" \
--header "x-apikey: $WEBIQ_API_KEY" \
--header "content-type: application/json" \
--data '{
"query": "coffee in Seattle",
"maxResults": 5,
"language": "en",
"region": "US",
"location": "lat:47.6062;long:-122.3321"
}'
import os
from webiq import WebIQClient
with WebIQClient(api_key=os.environ["WEBIQ_API_KEY"]) as client:
places = client.places.search(
"coffee in Seattle",
max_results=5,
language="en",
region="US",
location="lat:47.6062;long:-122.3321",
)
for place in places.placeResults or []:
print(place.name, place.businessUrl)
Save this example as places.mts and run it with node places.mts.
import { WebIQClient } from "@microsoft/webiq";
async function main() {
const client = new WebIQClient({ apiKey: process.env.WEBIQ_API_KEY });
try {
const places = await client.places.search("coffee in Seattle", {
maxResults: 5,
language: "en",
region: "US",
location: "lat:47.6062;long:-122.3321",
});
for (const place of places.placeResults ?? []) {
console.log(place.name, place.businessUrl);
}
} finally {
await client.close();
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Use the Tokio setup from step 2. Save this example as src/main.rs and run cargo run.
use webiq::{PlacesSearchOptions, WebIqClient};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = WebIqClient::new(std::env::var("WEBIQ_API_KEY")?)?;
let places = client.places().search(
"coffee in Seattle",
PlacesSearchOptions::new()
.max_results(5)
.language("en")
.region("US")
.location("lat:47.6062;long:-122.3321"),
).await?;
for place in places.place_results.unwrap_or_default() {
println!("{:?} {:?}", place.name, place.business_url);
}
Ok(())
}
Save this example as src/main/java/Places.java in the Maven project from step 2 and run mvn compile exec:java -Dexec.mainClass=Places.
import com.microsoft.webiq.WebIQClient;
import com.microsoft.webiq.models.PlaceItem;
import com.microsoft.webiq.models.PlacesResponse;
import com.microsoft.webiq.resources.PlacesSearchOptions;
public class Places {
public static void main(String[] args) {
try (WebIQClient client = WebIQClient.withApiKey(System.getenv("WEBIQ_API_KEY"))) {
PlacesResponse places = client.places.search("coffee in Seattle",
PlacesSearchOptions.builder().maxResults(5)
.language("en").region("US")
.location("lat:47.6062;long:-122.3321").build());
if (places.getPlaceResults() != null) {
for (PlaceItem place : places.getPlaceResults()) {
System.out.println(place.getName() + " " + place.getBusinessUrl());
}
}
}
}
}
In the .NET console project from step 2, save this example as Program.cs and run dotnet run.
using Microsoft.WebIQ;
string apiKey = Environment.GetEnvironmentVariable("WEBIQ_API_KEY")
?? throw new InvalidOperationException("Set WEBIQ_API_KEY before running this example.");
using var client = new WebIQClient(apiKey);
var places = await client.Places.SearchAsync("coffee in Seattle", request =>
{
request.MaxResults = 5;
request.Language = "en";
request.Region = "US";
request.Location = "lat:47.6062;long:-122.3321";
});
foreach (var place in places.PlaceResults ?? [])
Console.WriteLine($"{place.Name} {place.BusinessUrl}");
import os
import json
import requests
response = requests.post(
"https://api.microsoft.ai/v3/search/places",
headers={
"x-apikey": os.environ["WEBIQ_API_KEY"],
"content-type": "application/json",
},
json={
"query": "coffee in Seattle",
"maxResults": 5,
"language": "en",
"region": "US",
"location": "lat:47.6062;long:-122.3321",
},
timeout=30,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))
Save this example as places.mjs and run it with node places.mjs.
const response = await fetch("https://api.microsoft.ai/v3/search/places", {
method: "POST",
headers: {
"x-apikey": process.env.WEBIQ_API_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
query: "coffee in Seattle",
maxResults: 5,
language: "en",
region: "US",
location: "lat:47.6062;long:-122.3321",
}),
});
if (!response.ok) {
throw new Error(`Places failed: ${response.status} ${await response.text()}`);
}
console.log(JSON.stringify(await response.json(), null, 2));
Read results from placeResults. The list and individual fields can be absent, so check for missing values before using addresses, opening hours, or other details. See the Places API reference.
7. Retrieve evidence with Auto
Use Auto when you want Web IQ to select retrieval sources and return typed evidence with supporting citations. Ask a complete natural-language question, keeping relevant constraints such as dates, locations, and units. These examples omit mode to use the default and allow 60 seconds per request attempt. Set mode to advanced for Auto Advanced when you need more comprehensive retrieval for complex questions.
Auto returns evidence for your application to use, not a generated final answer. Read each evidence result with its own citations; don't treat citations from one result as support for another. The SDK examples use version 1.2.1 of all five SDKs, installed in step 2.
Endpoint: POST https://api.microsoft.ai/v3/auto
curl --request POST "https://api.microsoft.ai/v3/auto" \
--max-time 60 \
--header "x-apikey: $WEBIQ_API_KEY" \
--header "content-type: application/json" \
--data '{
"query": "What are the latest developments in retrieval-augmented generation?",
"maxResponseLength": 30000,
"maxCitations": 5
}'
import os
from webiq import WebIQClient
with WebIQClient(api_key=os.environ["WEBIQ_API_KEY"]) as client:
evidence = client.auto.search(
"What are the latest developments in retrieval-augmented generation?",
max_response_length=30000,
max_citations=5,
timeout=60.0,
)
for result in evidence.results or []:
print(result.evidence)
for citation in result.citations or []:
print(citation.title, citation.url)
Save this example as auto.mts and run it with node auto.mts.
import { WebIQClient } from "@microsoft/webiq";
async function main() {
const client = new WebIQClient({ apiKey: process.env.WEBIQ_API_KEY });
try {
const evidence = await client.auto.search(
"What are the latest developments in retrieval-augmented generation?",
{ maxResponseLength: 30000, maxCitations: 5, timeout: 60_000 },
);
for (const result of evidence.results ?? []) {
console.log(result.evidence);
for (const citation of result.citations ?? []) {
console.log(citation.title, citation.url);
}
}
} finally {
await client.close();
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Use the Tokio setup from step 2. Save this example as src/main.rs and run cargo run.
use webiq::{AutoSearchOptions, WebIqClient};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = WebIqClient::new(std::env::var("WEBIQ_API_KEY")?)?;
let evidence = client.auto().search(
"What are the latest developments in retrieval-augmented generation?",
AutoSearchOptions::new()
.max_response_length(30000)
.max_citations(5)
.timeout(std::time::Duration::from_secs(60)),
).await?;
for result in evidence.results.unwrap_or_default() {
println!("{:?}", result.evidence);
for citation in result.citations.unwrap_or_default() {
println!("{:?} {:?}", citation.title, citation.url);
}
}
Ok(())
}
Save this example as src/main/java/Auto.java in the Maven project from step 2 and run mvn compile exec:java -Dexec.mainClass=Auto.
import com.microsoft.webiq.WebIQClient;
import com.microsoft.webiq.models.AutoEvidenceCitation;
import com.microsoft.webiq.models.AutoEvidenceResult;
import com.microsoft.webiq.models.SearchAutoEvidenceResponse;
import com.microsoft.webiq.resources.AutoSearchOptions;
public class Auto {
public static void main(String[] args) {
try (WebIQClient client = WebIQClient.withApiKey(System.getenv("WEBIQ_API_KEY"))) {
SearchAutoEvidenceResponse evidence = client.auto.search(
"What are the latest developments in retrieval-augmented generation?",
AutoSearchOptions.builder()
.maxResponseLength(30000).maxCitations(5)
.timeout(java.time.Duration.ofSeconds(60)).build());
if (evidence.getResults() != null) {
for (AutoEvidenceResult result : evidence.getResults()) {
System.out.println(result.getEvidence());
if (result.getCitations() != null) {
for (AutoEvidenceCitation citation : result.getCitations()) {
System.out.println(citation.getTitle() + " " + citation.getUrl());
}
}
}
}
}
}
}
In the .NET console project from step 2, save this example as Program.cs and run dotnet run.
using Microsoft.WebIQ;
using System.Text.Json;
string apiKey = Environment.GetEnvironmentVariable("WEBIQ_API_KEY")
?? throw new InvalidOperationException("Set WEBIQ_API_KEY before running this example.");
using var client = new WebIQClient(apiKey);
var evidence = await client.Auto.SearchAsync(
"What are the latest developments in retrieval-augmented generation?",
request =>
{
request.MaxResponseLength = 30000;
request.MaxCitations = 5;
}, timeout: TimeSpan.FromSeconds(60));
foreach (var result in evidence.Results ?? [])
{
Console.WriteLine(JsonSerializer.Serialize(result.Evidence));
foreach (var citation in result.Citations ?? [])
Console.WriteLine($"{citation.Title} {citation.Url}");
}
import os
import json
import requests
response = requests.post(
"https://api.microsoft.ai/v3/auto",
headers={
"x-apikey": os.environ["WEBIQ_API_KEY"],
"content-type": "application/json",
},
json={
"query": "What are the latest developments in retrieval-augmented generation?",
"maxResponseLength": 30000,
"maxCitations": 5,
},
timeout=60,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))
Save this example as auto.mjs and run it with node auto.mjs.
const response = await fetch("https://api.microsoft.ai/v3/auto", {
method: "POST",
signal: AbortSignal.timeout(60_000),
headers: {
"x-apikey": process.env.WEBIQ_API_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
query: "What are the latest developments in retrieval-augmented generation?",
maxResponseLength: 30000,
maxCitations: 5,
}),
});
if (!response.ok) {
throw new Error(`Auto failed: ${response.status} ${await response.text()}`);
}
console.log(JSON.stringify(await response.json(), null, 2));
A successful response contains a results array. Each result pairs a typed evidence object with its supporting citations. An empty or absent results array has no evidence to process. See the Auto API reference for evidence types, response examples, and request limits.
Troubleshooting
| Status | What to check |
|---|---|
401 Unauthorized |
Confirm WEBIQ_API_KEY is set and the request sends it in the x-apikey header. |
415 Unsupported Media Type |
Send content-type: application/json. |
429 Too Many Requests |
Wait before retrying and reduce request frequency. |
Browse 404 Not Found |
Confirm the URL is public and valid. Use liveCrawl: "fallback" when indexed content might be unavailable. |
Browse 202 Accepted |
Wait until the time in retryAfter (an ISO 8601 UTC timestamp), then send the same request again. |
Auto 403 Forbidden |
Check that Auto is listed under Allowed Services in Profile Management. If it isn't, open a Web IQ Support request with your AppID. |
For other failures, save the traceId and see Error Handling. To contact Web IQ Support, include the traceId and your AppID, or your company name and the name of your Web IQ resource if you don't have the AppID.
Next steps
- Explore the Web Search and Browse API references.
- Retrieve structured local-business data with Places, or automatically selected evidence with Auto.
- Use the Python, TypeScript, Rust, Java, and .NET SDKs.
- Install the MCP server in Claude Code, Cursor, or VS Code.
- Set up production authentication with Microsoft Entra ID.
- Run complete examples from the Web IQ code samples on GitHub.
- Take the training module Integrate web-based knowledge into your agent with Web IQ.
- Watch Grounding agents with real-world intelligence, the Web IQ episode of the Microsoft IQ Series.