AgentQL REST API reference
AgentQL's REST API allows you to query web pages and retrieve the results through HTTP requests from any language.
Query data
Extract data from a webpage by sending a URL and an AgentQL query.
Make sure to replace $AGENTQL_API_KEY
with your actual API key.
{
"data": {
"products": [
{
"product_name": "Qwilfish",
"price": "£77.00"
},
{
"product_name": "Huntail",
"price": "£52.00"
},
...
]
},
"metadata": {
"request_id": "ecab9d2c-0212-4b70-a5bc-0c821fb30ae3"
}
}
Authentication
All requests to the AgentQL API must include an X-API-Key
header with your API key.
You can generate an API key through Dev Portal.
Request body
-
query
stringThe AgentQL query to execute
-
url
stringThe URL of the webpage to query
-
params
object (optional)-
is_screenshot_enabled
booleanEnable/disable screenshot capture. Defaults to
false
. -
wait_for
numberWait time in seconds for page load (max 10 seconds). Defaults to
0
. -
is_scroll_to_bottom_enabled
booleanEnable/disable scrolling to bottom before snapshot. Defaults to
false
.
-
Response
-
data
objectData that matches the query
-
metadata
object-
request_id
stringA UUID for the request
-
screenshot
string | nullBase64 encoded screenshot if enabled, null otherwise. You can convert the Base64 string returned in the
screenshot
field to an image and view it using free online tools like Base64.guru.
-