POST /v1/extract
Published
Fetches and extracts clean content from a public HTTP or HTTPS URL.
Request Parameters
Strict JSON body: exactly one object containing one non-empty string url; valid UTF-8; maximum 16 KiB; no unknown or duplicate fields. Use application/json with no charset or UTF-8, and no content encoding or identity.
Request Example
- 1
- 2
- 3
- 4
curl -X POST https://api.anysearch.com/v1/extract \
-H "Authorization: Bearer YOUR_ANYSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/article"}'
Response Format
Response Example
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
{
"code": 0,
"message": "success",
"request_id": "b84e2c71-5f36-4a9d-8c42-1e7b63d5f290",
"data": {
"url": "https://example.com/article",
"title": "Example Article",
"content": "Extracted page content..."
}
}
Error Responses
Search and Extract use the same error envelope. The table lists only the HTTP status and its meaning; endpoint-specific fields remain visible in the JSON examples.
- 1
- 2
- 3
- 4
- 5
- 6
{
"code": -1,
"message": "URL is invalid.",
"request_id": "4d9f6a32-7c18-4b5e-a260-9f31d8c74b52",
"error_code": "invalid_extract_url"
}
Authentication error example (no error_code):
- 1
- 2
- 3
- 4
- 5
{
"code": -1,
"message": "Invalid API key.",
"request_id": "1c7b9e42-6a53-4d81-8f20-3b5e7a96c104"
}