Overview
The Microsoft Copilot endpoint allows you to extract structured data from Microsoft Copilot about your brand, products, or any topic across various regions. This endpoint processes your prompts through Microsoft Copilot and returns parsed responses with sources & citations.Request Parameters
Required Parameters
prompt(string): The prompt to send to Microsoft Copilot (1-10,000 characters)
Optional Parameters
country(string): Optional country/region code for localized data extraction. Defaults to"US"include(object): Optional flags for including additional response formatsmarkdown(boolean): Include markdown-formatted response in the result. Defaults tofalse
Response Format Options
By default, all responses include both text and HTML formats. You can optionally include markdown:| Parameter | Default | Description | Use cases | Cost |
|---|---|---|---|---|
include.markdown | false | Include markdown-formatted response in the result | Documentation, content integration | 3 credits |
Example Usage
Basic Request
Request with Markdown Format
Response Schema
All successful responses include these fields:| Field | Type | Description |
|---|---|---|
success | boolean | Always true for successful responses |
result.text | string | Microsoft Copilot’s response text |
result.sources | array | Array of sources referenced in the response |
result.html | string | Microsoft Copilot’s response formatted in HTML (always included) |
result.markdown | string | Microsoft Copilot’s response formatted in Markdown (included when include.markdown is true) |
Error Responses
The API returns standard HTTP status codes to indicate the success or failure of requests. All error responses follow a consistent format with an error object containing a code, message, details, and timestamp.Status Codes
200- Success400- Bad Request (validation error)401- Unauthorized (authentication error)403- Forbidden (insufficient permissions or credits)404- Not Found (route not found)409- Conflict (resource conflict)429- Too Many Requests499- Client Closed Request (request was canceled)500- Internal Server Error502- Bad Gateway (external service error)
Validation Errors
| Field | Error | Description |
|---|---|---|
prompt | ”Prompt cannot be empty” | Must be 1-10,000 characters |
prompt | ”Prompt is too long” | Exceeds 10,000 character limit |
country | ”Invalid country code” | Must be valid ISO 3166-1 alpha-2 code |
include.markdown | ”Expected boolean” | Must be true or false |
Concurrency Information
Concurrency information is included in response headers:X-Concurrent-Limit: Maximum number of concurrent requests allowedX-Concurrent-Current: Current number of concurrent requestsX-Concurrent-Remaining: Number of remaining concurrent slots available
Credits System
This endpoint uses a credit-based billing system:- Base cost: 3 credits per request
- Additional costs: +0 credits (markdown format is included at no extra charge)
X-Credits-Remaining: Number of credits remaining in your accountX-Credits-Charged: Number of credits charged for this request
Supported Country Codes
The API accepts ISO 3166-1 alpha-2 country codes for thecountry parameter to extract data from different regions. For a complete list of supported country codes, see the Countries endpoint.
Common Examples:
US- United StatesGB- United KingdomCA- CanadaAU- AustraliaDE- GermanyFR- FranceJP- JapanCN- ChinaIN- IndiaBR- Brazil
Best Practices
Prompt Guidelines
- Be Specific: Include specific topics, technologies, or Microsoft products for more accurate Copilot responses
- Development Context: Frame prompts around development, coding, or technical scenarios for better results
- Microsoft Integration: Ask about Microsoft ecosystem integration for optimal responses
Implementation Guidelines
- Handle Source Data: Process the sources array to provide Microsoft documentation links
- Use Markdown: Enable markdown format when integrating with documentation or wikis
- Error Handling: Implement robust error handling for failed extraction requests
- Rate Limiting: Respect concurrency limits and implement proper retry logic
- Data Validation: Validate source URLs and content before using them in your application
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Request parameters for monitoring Copilot responses