curl --request POST \
--url https://api.hydrafetch.com/v1/web/search \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"query": "best open source vector databases",
"limit": 5,
"scrapeResults": false,
"scrapeOptions": {
"formats": [
"markdown"
],
"onlyMainContent": true,
"includeTags": [
"<string>"
],
"excludeTags": [
"<string>"
],
"removeBase64Images": true,
"blockAds": true,
"includeLinks": true,
"waitFor": 15000,
"timeout": 50500,
"location": {
"country": "us",
"languages": [
"en-US",
"en"
]
},
"headers": {},
"preferStructure": true,
"maxAge": 302400000
},
"timeRange": "week",
"country": "us",
"includeDomains": [
"github.com",
"arxiv.org"
],
"excludeDomains": [
"pinterest.com"
]
}
'import requests
url = "https://api.hydrafetch.com/v1/web/search"
payload = {
"query": "best open source vector databases",
"limit": 5,
"scrapeResults": False,
"scrapeOptions": {
"formats": ["markdown"],
"onlyMainContent": True,
"includeTags": ["<string>"],
"excludeTags": ["<string>"],
"removeBase64Images": True,
"blockAds": True,
"includeLinks": True,
"waitFor": 15000,
"timeout": 50500,
"location": {
"country": "us",
"languages": ["en-US", "en"]
},
"headers": {},
"preferStructure": True,
"maxAge": 302400000
},
"timeRange": "week",
"country": "us",
"includeDomains": ["github.com", "arxiv.org"],
"excludeDomains": ["pinterest.com"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'best open source vector databases',
limit: 5,
scrapeResults: false,
scrapeOptions: {
formats: ['markdown'],
onlyMainContent: true,
includeTags: ['<string>'],
excludeTags: ['<string>'],
removeBase64Images: true,
blockAds: true,
includeLinks: true,
waitFor: 15000,
timeout: 50500,
location: {country: 'us', languages: ['en-US', 'en']},
headers: {},
preferStructure: true,
maxAge: 302400000
},
timeRange: 'week',
country: 'us',
includeDomains: ['github.com', 'arxiv.org'],
excludeDomains: ['pinterest.com']
})
};
fetch('https://api.hydrafetch.com/v1/web/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hydrafetch.com/v1/web/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'best open source vector databases',
'limit' => 5,
'scrapeResults' => false,
'scrapeOptions' => [
'formats' => [
'markdown'
],
'onlyMainContent' => true,
'includeTags' => [
'<string>'
],
'excludeTags' => [
'<string>'
],
'removeBase64Images' => true,
'blockAds' => true,
'includeLinks' => true,
'waitFor' => 15000,
'timeout' => 50500,
'location' => [
'country' => 'us',
'languages' => [
'en-US',
'en'
]
],
'headers' => [
],
'preferStructure' => true,
'maxAge' => 302400000
],
'timeRange' => 'week',
'country' => 'us',
'includeDomains' => [
'github.com',
'arxiv.org'
],
'excludeDomains' => [
'pinterest.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hydrafetch.com/v1/web/search"
payload := strings.NewReader("{\n \"query\": \"best open source vector databases\",\n \"limit\": 5,\n \"scrapeResults\": false,\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"timeRange\": \"week\",\n \"country\": \"us\",\n \"includeDomains\": [\n \"github.com\",\n \"arxiv.org\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hydrafetch.com/v1/web/search")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"best open source vector databases\",\n \"limit\": 5,\n \"scrapeResults\": false,\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"timeRange\": \"week\",\n \"country\": \"us\",\n \"includeDomains\": [\n \"github.com\",\n \"arxiv.org\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hydrafetch.com/v1/web/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"best open source vector databases\",\n \"limit\": 5,\n \"scrapeResults\": false,\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"timeRange\": \"week\",\n \"country\": \"us\",\n \"includeDomains\": [\n \"github.com\",\n \"arxiv.org\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"query": "best open source vector databases",
"status": "ok",
"results": [
{
"title": "Best open source vector databases",
"url": "https://example.com/vector-databases",
"snippet": "A rundown of the leading open source vector databases and how they compare.",
"rank": 1,
"data": {
"url": "https://example.com",
"finalUrl": "https://example.com/",
"redirected": false,
"status": 200,
"cached": false,
"metadata": {
"title": "Example Domain",
"structure": "markdown",
"pageType": "article",
"wordCount": 214,
"description": "A short summary of the page, as published by the page itself.",
"language": "en",
"author": "Jane Doe",
"siteName": "Example Blog",
"publishedTime": "2026-01-05",
"image": "https://example.com/cover.png"
},
"warning": "<string>",
"usage": {
"creditsUsed": 1,
"creditsRemaining": 4999,
"freshness": "fresh"
},
"quality": {
"confidence": 0.94,
"complete": true,
"blocked": false
},
"markdown": "<string>",
"html": "<string>",
"rawHtml": "<string>",
"links": {
"internal": [
"<string>"
],
"external": [
"<string>"
]
},
"structured": {
"entities": [
{
"type": "Product",
"source": "json-ld",
"properties": {}
}
],
"jsonLd": [
{}
],
"microdata": [
{}
],
"opengraph": [
{}
],
"rdfa": [
{}
],
"appState": [
"<string>"
]
},
"summary": "<string>",
"json": {}
}
}
]
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "url must be a valid URL"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Missing X-API-Key header. Agents: https://hydrafetch.com/auth.md"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "WORKSPACE_BANNED",
"message": "This workspace has been suspended and cannot make API requests."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Job not found"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "UPSTREAM_UNREACHABLE",
"message": "The origin did not respond to any attempt we made."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit exceeded for this workspace and plan."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "The summary and json formats are not available."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}Search the web
Search the web for a query and get back ranked results: title, url and snippet. Costs 1 credit. Set scrapeResults to true to also fetch each result as clean data, which costs 1 additional credit per page scraped.
curl --request POST \
--url https://api.hydrafetch.com/v1/web/search \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"query": "best open source vector databases",
"limit": 5,
"scrapeResults": false,
"scrapeOptions": {
"formats": [
"markdown"
],
"onlyMainContent": true,
"includeTags": [
"<string>"
],
"excludeTags": [
"<string>"
],
"removeBase64Images": true,
"blockAds": true,
"includeLinks": true,
"waitFor": 15000,
"timeout": 50500,
"location": {
"country": "us",
"languages": [
"en-US",
"en"
]
},
"headers": {},
"preferStructure": true,
"maxAge": 302400000
},
"timeRange": "week",
"country": "us",
"includeDomains": [
"github.com",
"arxiv.org"
],
"excludeDomains": [
"pinterest.com"
]
}
'import requests
url = "https://api.hydrafetch.com/v1/web/search"
payload = {
"query": "best open source vector databases",
"limit": 5,
"scrapeResults": False,
"scrapeOptions": {
"formats": ["markdown"],
"onlyMainContent": True,
"includeTags": ["<string>"],
"excludeTags": ["<string>"],
"removeBase64Images": True,
"blockAds": True,
"includeLinks": True,
"waitFor": 15000,
"timeout": 50500,
"location": {
"country": "us",
"languages": ["en-US", "en"]
},
"headers": {},
"preferStructure": True,
"maxAge": 302400000
},
"timeRange": "week",
"country": "us",
"includeDomains": ["github.com", "arxiv.org"],
"excludeDomains": ["pinterest.com"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'best open source vector databases',
limit: 5,
scrapeResults: false,
scrapeOptions: {
formats: ['markdown'],
onlyMainContent: true,
includeTags: ['<string>'],
excludeTags: ['<string>'],
removeBase64Images: true,
blockAds: true,
includeLinks: true,
waitFor: 15000,
timeout: 50500,
location: {country: 'us', languages: ['en-US', 'en']},
headers: {},
preferStructure: true,
maxAge: 302400000
},
timeRange: 'week',
country: 'us',
includeDomains: ['github.com', 'arxiv.org'],
excludeDomains: ['pinterest.com']
})
};
fetch('https://api.hydrafetch.com/v1/web/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hydrafetch.com/v1/web/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'best open source vector databases',
'limit' => 5,
'scrapeResults' => false,
'scrapeOptions' => [
'formats' => [
'markdown'
],
'onlyMainContent' => true,
'includeTags' => [
'<string>'
],
'excludeTags' => [
'<string>'
],
'removeBase64Images' => true,
'blockAds' => true,
'includeLinks' => true,
'waitFor' => 15000,
'timeout' => 50500,
'location' => [
'country' => 'us',
'languages' => [
'en-US',
'en'
]
],
'headers' => [
],
'preferStructure' => true,
'maxAge' => 302400000
],
'timeRange' => 'week',
'country' => 'us',
'includeDomains' => [
'github.com',
'arxiv.org'
],
'excludeDomains' => [
'pinterest.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hydrafetch.com/v1/web/search"
payload := strings.NewReader("{\n \"query\": \"best open source vector databases\",\n \"limit\": 5,\n \"scrapeResults\": false,\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"timeRange\": \"week\",\n \"country\": \"us\",\n \"includeDomains\": [\n \"github.com\",\n \"arxiv.org\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hydrafetch.com/v1/web/search")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"best open source vector databases\",\n \"limit\": 5,\n \"scrapeResults\": false,\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"timeRange\": \"week\",\n \"country\": \"us\",\n \"includeDomains\": [\n \"github.com\",\n \"arxiv.org\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hydrafetch.com/v1/web/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"best open source vector databases\",\n \"limit\": 5,\n \"scrapeResults\": false,\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"timeRange\": \"week\",\n \"country\": \"us\",\n \"includeDomains\": [\n \"github.com\",\n \"arxiv.org\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"query": "best open source vector databases",
"status": "ok",
"results": [
{
"title": "Best open source vector databases",
"url": "https://example.com/vector-databases",
"snippet": "A rundown of the leading open source vector databases and how they compare.",
"rank": 1,
"data": {
"url": "https://example.com",
"finalUrl": "https://example.com/",
"redirected": false,
"status": 200,
"cached": false,
"metadata": {
"title": "Example Domain",
"structure": "markdown",
"pageType": "article",
"wordCount": 214,
"description": "A short summary of the page, as published by the page itself.",
"language": "en",
"author": "Jane Doe",
"siteName": "Example Blog",
"publishedTime": "2026-01-05",
"image": "https://example.com/cover.png"
},
"warning": "<string>",
"usage": {
"creditsUsed": 1,
"creditsRemaining": 4999,
"freshness": "fresh"
},
"quality": {
"confidence": 0.94,
"complete": true,
"blocked": false
},
"markdown": "<string>",
"html": "<string>",
"rawHtml": "<string>",
"links": {
"internal": [
"<string>"
],
"external": [
"<string>"
]
},
"structured": {
"entities": [
{
"type": "Product",
"source": "json-ld",
"properties": {}
}
],
"jsonLd": [
{}
],
"microdata": [
{}
],
"opengraph": [
{}
],
"rdfa": [
{}
],
"appState": [
"<string>"
]
},
"summary": "<string>",
"json": {}
}
}
]
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "url must be a valid URL"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Missing X-API-Key header. Agents: https://hydrafetch.com/auth.md"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "WORKSPACE_BANNED",
"message": "This workspace has been suspended and cannot make API requests."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Job not found"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "UPSTREAM_UNREACHABLE",
"message": "The origin did not respond to any attempt we made."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit exceeded for this workspace and plan."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "The summary and json formats are not available."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}Authorizations
Body
What to search the web for.
500"best open source vector databases"
How many ranked results to return. Omit for the default.
1 <= x <= 155
When true, each result also comes back with its page fetched and returned as clean data, at 1 additional credit per page scraped. Defaults to false, which returns just the ranked title, url and snippet for the flat search credit.
false
Show child attributes
Show child attributes
Restrict results to a recency window relative to now.
day, week, month, year "week"
ISO 3166 alpha-2 country code to bias results toward a region.
"us"
Only return results from these domains.
15["github.com", "arxiv.org"]
Drop results from these domains.
15["pinterest.com"]
Response
The ranked search results.
Show child attributes
Show child attributes
Was this page helpful?