Get data from any page
We’ve made it to the final day of Launch Week, and we’re wrapping up with our biggest product offering yet: the AgentQL REST API!
This simple API turns any page into an endpoint for content. With only a URL and a query string, you can query web pages and retrieve the same precise, structured data you have come to expect from our SDKs and Playground—even from dynamic content or complex websites. The possibilities are endless, from scheduling scraping jobs to building data pipelines, or even empowering AI agents to interact with the web in all new ways.
What is the AgentQL REST API?
The AgentQL REST API allows you to send queries via HTTP to retrieve structured data from any publicly available website with a single request. This flexibility makes it a powerful tool for developers, automation experts, and AI agent providers working with dynamic data applications.
Use AgentQL with any programming language or tool that supports HTTP. By integrating with tools like Zapier or embedding it in backend systems, AgentQL’s REST API opens up new possibilities for automating large-scale data acquisition and training data collection. It’s an ideal solution for users who need the precision of AgentQL’s smart locators without the SDK setup—just plug in your query and get your data!
Unlock the Internet’s Data
There’s so much information available on the web that’s been dammed up in HTML soup. We get it. Not every organization can build an API to share their information. That’s why AgentQL was designed to do the heavy lifting for both publishers and consumers!
This REST API is for anyone looking to add fast, precise, structured data collection to their workflows. It’s handy for:
How to Get Started with the AgentQL REST API
1. Get your API key: Every request requires an X-API-Key header. Generate your free API key here—no credit card is required!
2. Define Your Request: Pass the URL you want to fetch data from and an AgentQL query.
{
"url": "https://scrapeme.live/shop",
"query": "{ products[] { product_name product_price } }"
}
3. Set your headers: Before making the API request, include the necessary headers for authentication and content type. These headers authorize the request and specify the data format being sent.
4. Send the Request: Use your preferred HTTP client (like curl, Postman, or an HTTP library in Python or your preferred language) to make a POST request to the AgentQL REST API endpoint.
领英推荐
Copy
curl -X POST "https://api.agentql.com/v1/query-data" \
-H "X-API-Key: $AGENTQL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://scrapeme.live/?s=fish&post_type=product",
"query": "{ products[] { product_name product_price } }"
}'
(Make sure to replace $AGENTQL_API_KEY with your actual API key!)
5. Get Results: The API response will return data as structured JSON, ready to be used directly in applications, AI agents, or analytics workflows.
{
"data": {
"products": [
{
"product_name": "Qwilfish",
"product_price": "£77.00"
},
{
"product_name": "Huntail",
"product_price": "£52.00"
},
...
]
},
"metadata": {
"request_id": "ecab9d2c-0212-4b70-a5bc-0c821fb30ae3"
}
}
Use Cases for the REST API
The REST API unlocks a wide array of possibilities for developers and agent builders:
Ready to get real-time data from the web?
Get started making some AgentQL REST API calls today!
That’s a wrap for Launch Week!
This Launch Week we shared a new JavaScript SDK, Fast Mode, Stealth Mode, Query Generation from Natural Language and now this. We hope the REST API becomes an invaluable part of your toolkit, whether you’re a developer, automation expert, or building the next generation of agentic AI. We'd love to see what you build and are here to help on our community Discord.
Thank you for being part of AgentQL Launch Week! We're working hard to make sure AgentQL is your favorite tool for automation and data retrieval. Please let us know what you think—take our survey!
Happy coding and automating!
—The Tiny Fish Team Building AgentQL