Overview
The ChatGPT endpoint allows you to extract structured data from ChatGPT about your brand, products, or any topic across various regions. This endpoint processes your prompts through ChatGPT and returns parsed responses with sources & citations.Request Parameters
Required Parameters
prompt(string): The prompt to send to ChatGPT (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 tofalserawResponse(boolean): Include ChatGPT’s raw API response (useful for debugging or advanced parsing). Defaults tofalsesearchQueries(boolean): Include the search queries ChatGPT used to generate the response. Defaults tofalse
Response Format Options
By default, all responses include both text and HTML formats. You can optionally include markdown, the raw provider response, or search queries:| Parameter | Default | Description | Use cases | Cost |
|---|---|---|---|---|
include.markdown | false | Include markdown-formatted response in the result | Documentation, blogs, content management | 5 credits |
include.rawResponse | false | Include ChatGPT’s raw response payload (as returned by the provider) | Debugging, custom parsing, auditing provider-level details | 7 credits |
include.searchQueries | false | Include the search queries ChatGPT used to generate the response | SEO analysis, keyword research, content strategy | 7 credits |
Example Usage
Basic Request
Request with Additional Formats
Response Schema
All successful responses include these fields:| Field | Type | Description |
|---|---|---|
success | boolean | Always true for successful responses |
result.text | string | ChatGPT’s response text |
result.sources | array | Array of sources referenced in the response |
result.html | string | ChatGPT’s response formatted in HTML (always included) |
result.markdown | string | ChatGPT’s response formatted in Markdown (included when include.markdown is true) |
result.rawResponse | array | Array of ChatGPT’s streamed response events (included when include.rawResponse is true) |
result.searchQueries | array | Array of search queries ChatGPT used to generate the response (included when include.searchQueries is true) |
result.model | string | The ChatGPT model used to generate the response |
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)
Error Response Format
All error responses follow this structure:Common Error Responses
400 Bad Request - Validation 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 |
include.rawResponse | ”Expected boolean” | Must be true or false |
include.searchQueries | ”Expected boolean” | Must be true or false |
401 Unauthorized - Authentication Errors
Missing API Key
Invalid API Key Format
Invalid or Expired API Key
403 Forbidden - Permission or Credits Error
Insufficient Permissions
Insufficient Credits
404 Not Found - Route Error
429 Too Many Requests
499 Client Closed Request
500 Internal Server Error
Maximum Retries Exceeded
Generic Internal Error
502 Bad Gateway - External Service Error
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:- Credit limit: Based on your purchased package
- Base cost: 5 credits
- Additional costs: +2 credits only when
include.rawResponseorinclude.searchQueriesare successfully retrieved
include.rawResponse or include.searchQueries are requested but not successfully retrieved, only the base 5 credits are charged.
Credit information is included in response headers:
X-Credits-Remaining: Number of credits remaining in your accountX-Credits-Charged: Number of credits charged for this request (base cost + any successful add-ons)
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
Response Format Selection
Choose the right format based on your use case:| Format | Best For |
|---|---|
| Text + HTML | Web display, position tracking, rich formatting |
| + Markdown | Documentation, blogs, CMS integration |
| + Search Queries | SEO analysis, keyword research |
| + Raw Response | Debugging, custom parsing |
General Guidelines
- Craft Specific Prompts: Be specific about what you want to extract for more accurate structured data from ChatGPT
- Extract Consistently: Set up regular extraction intervals to track changes in ChatGPT responses over time
- Track Regions: Extract responses across different regions to understand geographical ChatGPT behavior differences
- Use Search Queries: Enable
include.searchQueriesto understand what terms ChatGPT researched to generate its response - Implement Caching: Cache structured responses when appropriate to reduce API calls and costs
- Error Handling: Implement robust error handling and retry logic for failed extraction requests
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Request parameters for monitoring ChatGPT responses
The prompt to send to ChatGPT
Required string length:
1 - 10000Example:
"What do you know about Acme Corp?"
Optional country/region code for localized monitoring
Example:
"US"
Optional flags for including additional response formats
Example:
{
"markdown": true,
"rawResponse": true,
"searchQueries": true
}