Query API
Ask questions about any webpage and get structured, AI-powered answers. Define custom response formats to extract exactly the information you need.
Endpoint
HTTP
GET/POST https://opengraph.io/api/1.1/query/{encoded_url}?app_id=YOUR_APP_IDParameters
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| encoded_url | string | Required. URL-encoded target URL |
Query/Body Parameters
| Parameter | Type | Description |
|---|---|---|
| app_id | string | Required. Your API key |
| query | string | Required. The question to ask about the page |
| responseStructure | object | Optional JSON schema for structured responses |
| modelSize | string | AI model size: nano (default), mini, or standard |
| full_render | boolean | Enable JavaScript rendering (default: false) |
| cache_ok | boolean | Allow cached results (default: true) |
| use_proxy | boolean | Use standard proxy for protected sites |
| use_premium | boolean | Use residential proxy |
| use_superior | boolean | Use mobile proxy (highest success rate) |
Example Requests
curl "https://opengraph.io/api/1.1/query/https%3A%2F%2Fexample.com?app_id=YOUR_APP_ID&query=What%20is%20this%20page%20about%3F"Example Response
Response
{
"answer": {
"headline": "Welcome to Example",
"products": [
"Product A",
"Product B",
"Product C"
]
},
"requestInfo": {
"host": "example.com",
"responseCode": 200
}
}Tip: When using responseStructure, the AI will format its answer to match your schema, making it easy to parse programmatically.
Response Structure Examples
The responseStructure parameter lets you define exactly how you want the answer formatted:
Extract a list
List of strings
{
"responseStructure": {
"items": ["string"]
}
}Extract structured data
Complex structure
{
"responseStructure": {
"title": "string",
"price": "number",
"features": ["string"],
"available": "boolean"
}
}Nested objects
Nested structure
{
"responseStructure": {
"company": {
"name": "string",
"founded": "number"
},
"products": [
{
"name": "string",
"price": "number"
}
]
}
}Use Cases
- Extract specific information from documentation pages
- Summarize long-form content
- Parse product information from e-commerce sites
- Extract contact information or addresses
- Answer questions about page content for chatbots
- Automated research and data collection
MCP Tool
This endpoint is available as the Query Site tool in the OpenGraph MCP Server. Your AI assistant can query page content directly without writing any code.