curl --request POST \
--url https://api.geekflare.com/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"query": "best running shoes",
"limit": 10,
"time": "d",
"location": "us",
"source": "web",
"category": "code",
"includeDomains": [
"reddit.com",
"stackoverflow.com"
],
"excludeDomains": [
"pinterest.com"
],
"format": "json",
"scrape": false,
"scrapeLimit": 3,
"groundedAnswer": false
}
'import requests
url = "https://api.geekflare.com/search"
payload = {
"query": "best running shoes",
"limit": 10,
"time": "d",
"location": "us",
"source": "web",
"category": "code",
"includeDomains": ["reddit.com", "stackoverflow.com"],
"excludeDomains": ["pinterest.com"],
"format": "json",
"scrape": False,
"scrapeLimit": 3,
"groundedAnswer": False
}
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 running shoes',
limit: 10,
time: 'd',
location: 'us',
source: 'web',
category: 'code',
includeDomains: ['reddit.com', 'stackoverflow.com'],
excludeDomains: ['pinterest.com'],
format: 'json',
scrape: false,
scrapeLimit: 3,
groundedAnswer: false
})
};
fetch('https://api.geekflare.com/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.geekflare.com/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 running shoes',
'limit' => 10,
'time' => 'd',
'location' => 'us',
'source' => 'web',
'category' => 'code',
'includeDomains' => [
'reddit.com',
'stackoverflow.com'
],
'excludeDomains' => [
'pinterest.com'
],
'format' => 'json',
'scrape' => false,
'scrapeLimit' => 3,
'groundedAnswer' => false
]),
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.geekflare.com/search"
payload := strings.NewReader("{\n \"query\": \"best running shoes\",\n \"limit\": 10,\n \"time\": \"d\",\n \"location\": \"us\",\n \"source\": \"web\",\n \"category\": \"code\",\n \"includeDomains\": [\n \"reddit.com\",\n \"stackoverflow.com\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ],\n \"format\": \"json\",\n \"scrape\": false,\n \"scrapeLimit\": 3,\n \"groundedAnswer\": false\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.geekflare.com/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"best running shoes\",\n \"limit\": 10,\n \"time\": \"d\",\n \"location\": \"us\",\n \"source\": \"web\",\n \"category\": \"code\",\n \"includeDomains\": [\n \"reddit.com\",\n \"stackoverflow.com\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ],\n \"format\": \"json\",\n \"scrape\": false,\n \"scrapeLimit\": 3,\n \"groundedAnswer\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.geekflare.com/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 running shoes\",\n \"limit\": 10,\n \"time\": \"d\",\n \"location\": \"us\",\n \"source\": \"web\",\n \"category\": \"code\",\n \"includeDomains\": [\n \"reddit.com\",\n \"stackoverflow.com\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ],\n \"format\": \"json\",\n \"scrape\": false,\n \"scrapeLimit\": 3,\n \"groundedAnswer\": false\n}"
response = http.request(request)
puts response.read_body{
"timestamp": 1783943217189,
"apiStatus": "success",
"apiCode": 200,
"meta": {
"query": "best running shoes",
"count": 10,
"source": "web",
"location": "us",
"time": "d",
"scrape": false,
"scrapeLimit": 3,
"test": {
"id": "mxqx9v9y0742lap6altwdteqd28t23nq"
}
},
"data": [
{
"title": "Best Running Shoes of 2025",
"url": "https://example.com/running-shoes",
"snippet": "We tested over 100 pairs to find the best running shoes...",
"position": 1,
"date": "Dec 18, 2025",
"content": "Full article cleaned for LLM consumption...",
"thumbnail": "https://example.com/thumb.jpg"
}
]
}{
"timestamp": 1700000000000,
"apiStatus": "failure",
"apiCode": 400,
"message": "INVALID_URL",
"details": "The URL must be a valid HTTP or HTTPS URL."
}{
"timestamp": 1700000000000,
"apiStatus": "failure",
"apiCode": 422,
"message": "UNABLE_TO_CONNECT",
"details": "The destination server could not be resolved, refused the connection, timed out, or is redirecting indefinitely."
}{
"timestamp": 1700000000000,
"apiStatus": "failure",
"apiCode": 500,
"message": "SEARCH_FAILED",
"details": "Our search service encountered an error while processing the request."
}Search
Structured search results from the web or news. Strips out ads and HTML noise to provide pure data in JSON, Markdown, or HTML. Fully supports AI-grounded answers, search-with-scrape, image search, and targeted Web or News sourcing.
curl --request POST \
--url https://api.geekflare.com/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"query": "best running shoes",
"limit": 10,
"time": "d",
"location": "us",
"source": "web",
"category": "code",
"includeDomains": [
"reddit.com",
"stackoverflow.com"
],
"excludeDomains": [
"pinterest.com"
],
"format": "json",
"scrape": false,
"scrapeLimit": 3,
"groundedAnswer": false
}
'import requests
url = "https://api.geekflare.com/search"
payload = {
"query": "best running shoes",
"limit": 10,
"time": "d",
"location": "us",
"source": "web",
"category": "code",
"includeDomains": ["reddit.com", "stackoverflow.com"],
"excludeDomains": ["pinterest.com"],
"format": "json",
"scrape": False,
"scrapeLimit": 3,
"groundedAnswer": False
}
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 running shoes',
limit: 10,
time: 'd',
location: 'us',
source: 'web',
category: 'code',
includeDomains: ['reddit.com', 'stackoverflow.com'],
excludeDomains: ['pinterest.com'],
format: 'json',
scrape: false,
scrapeLimit: 3,
groundedAnswer: false
})
};
fetch('https://api.geekflare.com/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.geekflare.com/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 running shoes',
'limit' => 10,
'time' => 'd',
'location' => 'us',
'source' => 'web',
'category' => 'code',
'includeDomains' => [
'reddit.com',
'stackoverflow.com'
],
'excludeDomains' => [
'pinterest.com'
],
'format' => 'json',
'scrape' => false,
'scrapeLimit' => 3,
'groundedAnswer' => false
]),
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.geekflare.com/search"
payload := strings.NewReader("{\n \"query\": \"best running shoes\",\n \"limit\": 10,\n \"time\": \"d\",\n \"location\": \"us\",\n \"source\": \"web\",\n \"category\": \"code\",\n \"includeDomains\": [\n \"reddit.com\",\n \"stackoverflow.com\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ],\n \"format\": \"json\",\n \"scrape\": false,\n \"scrapeLimit\": 3,\n \"groundedAnswer\": false\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.geekflare.com/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"best running shoes\",\n \"limit\": 10,\n \"time\": \"d\",\n \"location\": \"us\",\n \"source\": \"web\",\n \"category\": \"code\",\n \"includeDomains\": [\n \"reddit.com\",\n \"stackoverflow.com\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ],\n \"format\": \"json\",\n \"scrape\": false,\n \"scrapeLimit\": 3,\n \"groundedAnswer\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.geekflare.com/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 running shoes\",\n \"limit\": 10,\n \"time\": \"d\",\n \"location\": \"us\",\n \"source\": \"web\",\n \"category\": \"code\",\n \"includeDomains\": [\n \"reddit.com\",\n \"stackoverflow.com\"\n ],\n \"excludeDomains\": [\n \"pinterest.com\"\n ],\n \"format\": \"json\",\n \"scrape\": false,\n \"scrapeLimit\": 3,\n \"groundedAnswer\": false\n}"
response = http.request(request)
puts response.read_body{
"timestamp": 1783943217189,
"apiStatus": "success",
"apiCode": 200,
"meta": {
"query": "best running shoes",
"count": 10,
"source": "web",
"location": "us",
"time": "d",
"scrape": false,
"scrapeLimit": 3,
"test": {
"id": "mxqx9v9y0742lap6altwdteqd28t23nq"
}
},
"data": [
{
"title": "Best Running Shoes of 2025",
"url": "https://example.com/running-shoes",
"snippet": "We tested over 100 pairs to find the best running shoes...",
"position": 1,
"date": "Dec 18, 2025",
"content": "Full article cleaned for LLM consumption...",
"thumbnail": "https://example.com/thumb.jpg"
}
]
}{
"timestamp": 1700000000000,
"apiStatus": "failure",
"apiCode": 400,
"message": "INVALID_URL",
"details": "The URL must be a valid HTTP or HTTPS URL."
}{
"timestamp": 1700000000000,
"apiStatus": "failure",
"apiCode": 422,
"message": "UNABLE_TO_CONNECT",
"details": "The destination server could not be resolved, refused the connection, timed out, or is redirecting indefinitely."
}{
"timestamp": 1700000000000,
"apiStatus": "failure",
"apiCode": 500,
"message": "SEARCH_FAILED",
"details": "Our search service encountered an error while processing the request."
}Authorizations
API Key required for all endpoints
Body
Search query
2048"best running shoes"
Number of results
1 <= x <= 10010
Time filter (h, d, w, m, y or h2, d7, etc.)
"d"
Country code (ISO alpha-2)
"us"
Search source
web, news, images "web"
Category filter
general, code, pdf, research, linkedin, wiki "code"
Include only these domains
["reddit.com", "stackoverflow.com"]
Exclude these domains
["pinterest.com"]
Output format
json, markdown, html scrape and extract content from SERP result URLs
false
Number of URLs to scrape (requires scrape: true)
1 <= x <= 103
Use AI to synthesize a grounded answer from search results.
false
Response
Search results (format depends on request)
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Timestamp of the request in milliseconds
1783943217189
API status message
success, failure "success"
API status code
200
Show child attributes
Show child attributes
Show child attributes
Show child attributes