Skip to main content

Get Search Request

Retrieve details of a specific search request by its ID.

Endpoint: GET /api/v1/core/search/{id}/

Request Examples​

from watercrawl import WaterCrawlAPIClient

# Initialize client
client = WaterCrawlAPIClient('your_api_key')

# Get details of a search request
search_id = "123e4567-e89b-12d3-a456-426614174000"
search_request = client.get_search_request(search_id, download=True)

print(f"Search query: {search_request['query']}")
print(f"Status: {search_request['status']}")
print(f"Created at: {search_request['created_at']}")

# If the search is completed and results are available
if search_request['status'] == 'finished' and search_request['result']:
print("\nResults:")
for result in search_request['result']:
print(f"- {result['title']}: {result['url']}")

Response Example​

{
'uuid': '123e4567-e89b-12d3-a456-426614174000',
'query': 'artificial intelligence',
'search_options': {
'depth': 'advanced',
'language': 'en',
'country': null,
'time_range': 'any',
'search_type': 'web'
},
'result_limit': 10,
'status': 'finished',
'created_at': '2024-01-01T00:00:00Z',
'duration': '2.5s',
'result': [
{
'title': 'Artificial Intelligence - Overview',
'url': 'https://example.com/ai-overview',
'description': 'Artificial intelligence (AI) refers to the simulation of human intelligence in machines...',
'order': 1,
'depth': 'advanced'
},
# More results...
]
}

Query Parameters​

ParameterTypeDescription
prefetchedbooleanWhether to include full result data (true) or just URLs (false)

In client libraries, this parameter is often named download for clarity.

Response Details​

FieldTypeDescription
uuidstringUnique identifier for the search request
querystringThe search query
search_optionsobjectThe search options used
result_limitintegerMaximum number of results requested
statusstringCurrent status of the search request
created_atstringTimestamp when the search request was created
durationstringTime taken to complete the search (null if not finished)
resultarray/stringSearch results or null if not completed

Status Values​

Search requests can have the following status values:

  • new: Search request created but not started
  • running: Search is in progress
  • finished: Search completed successfully
  • canceling: Search is being cancelled
  • canceled: Search was cancelled
  • failed: Search failed due to an error

Result Format​

When the search is completed (status is finished), the result field will contain an array of search results, each with the following structure:

FieldTypeDescription
titlestringTitle of the search result
urlstringURL of the result
descriptionstringDescription or snippet of the result
orderintegerResult ranking position
depthstringDepth level of this particular result

Error Responses​

Status CodeErrorDescription
404Not FoundThe specified search request does not exist
401UnauthorizedInvalid or missing API key