GET · leads:read
Read task results
Read one page of saved leads. Keep the filters and fields unchanged when you follow next_cursor.
Set up with your AI assistant
Paste the prompt into your coding assistant. It includes setup steps and a read-only connection check.
Request
Endpoint
GET https://leadsagent.io/api/v1/tasks/{id}/resultsSet LEADSAGENT_API_KEY in your local environment. Send it in the X-API-Key header.
Bash · API base URL
export LEADSAGENT_API_BASE="https://leadsagent.io/api/v1"
# For a local backend:
# export LEADSAGENT_API_BASE="http://127.0.0.1:8001/api/v1"Bash · curl
curl --fail-with-body --silent --show-error --request GET "$LEADSAGENT_API_BASE/tasks/$TASK_ID/results?fields=business_name,email&limit=50" -H "X-API-Key: $LEADSAGENT_API_KEY"Replace TASK_ID with data.id from a task response. In PowerShell, use curl.exe and $env:LEADSAGENT_API_KEY. Save JSON in a file and pass --data-binary @request.json.
- id (UUID)
- Required. The task ID.
- fields (comma-separated strings)
- Optional. Defaults to business_name, category, address, phone, email, website, rating, reviews. Request 1–30 documented fields.
- limit (integer)
- Optional. 1–1,000 rows; default 50.
- cursor (string)
- Optional. Use next_cursor from the previous page.
- has_email, has_website, has_phone (boolean)
- Optional row filters. Keep the same values while paging.
- Use export-results when you need every row in one file.
- A cursor is bound to the task, list version, fields and filters.
Response
data contains rows, counts, has_more and next_cursor. A page can contain fewer rows to stay within the 256 KiB REST response budget.
Example response
{
"request_id": "6c4d0c26-8aa3-44b0-a50a-51b832b29465",
"status": "success",
"data": {
"task_id": "73bd1ccb-1a44-4b41-84da-4ea7a5ad03f4",
"rows": [
{
"business_name": "Austin Dental",
"email": "hello@example.test"
}
],
"total_count": 1,
"matching_count": 1,
"returned_count": 1,
"has_more": false,
"next_cursor": null
},
"meta": {}
}Errors and retries explains status codes and retry rules. A successful request does not mean a background task has finished.
Read as Markdown