Search web content
curl --request POST \
--url https://app.dumplingai.com/api/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "best running shoes",
"scrapeResults": true
}
'import requests
url = "https://app.dumplingai.com/api/v1/search"
payload = {
"query": "best running shoes",
"scrapeResults": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'best running shoes', scrapeResults: true})
};
fetch('https://app.dumplingai.com/api/v1/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://app.dumplingai.com/api/v1/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',
'scrapeResults' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.dumplingai.com/api/v1/search"
payload := strings.NewReader("{\n \"query\": \"best running shoes\",\n \"scrapeResults\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.dumplingai.com/api/v1/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"best running shoes\",\n \"scrapeResults\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dumplingai.com/api/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"best running shoes\",\n \"scrapeResults\": true\n}"
response = http.request(request)
puts response.read_body{
"searchParameters": {
"q": "<string>",
"type": "<string>",
"engine": "<string>",
"gl": "<string>",
"hl": "<string>"
},
"organic": [
{
"title": "<string>",
"link": "<string>",
"snippet": "<string>",
"position": 123,
"sitelinks": [
{
"title": "<string>",
"link": "<string>"
}
],
"date": "<string>",
"scrapeOutput": {
"title": "<string>",
"metadata": {},
"url": "<string>",
"format": "<string>",
"cleaned": true,
"content": "<string>"
}
}
],
"featuredSnippet": {
"title": "<string>",
"link": "<string>",
"snippet": "<string>",
"position": 123,
"type": "<string>"
},
"relatedSearches": [
{
"query": "<string>"
}
],
"peopleAlsoAsk": [
{
"question": "<string>",
"snippet": "<string>",
"title": "<string>",
"link": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Data APIs
Search
Perform a federated web search returning organic results, snippets, and metadata.
POST
/
api
/
v1
/
search
Search web content
curl --request POST \
--url https://app.dumplingai.com/api/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "best running shoes",
"scrapeResults": true
}
'import requests
url = "https://app.dumplingai.com/api/v1/search"
payload = {
"query": "best running shoes",
"scrapeResults": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'best running shoes', scrapeResults: true})
};
fetch('https://app.dumplingai.com/api/v1/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://app.dumplingai.com/api/v1/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',
'scrapeResults' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.dumplingai.com/api/v1/search"
payload := strings.NewReader("{\n \"query\": \"best running shoes\",\n \"scrapeResults\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.dumplingai.com/api/v1/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"best running shoes\",\n \"scrapeResults\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dumplingai.com/api/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"best running shoes\",\n \"scrapeResults\": true\n}"
response = http.request(request)
puts response.read_body{
"searchParameters": {
"q": "<string>",
"type": "<string>",
"engine": "<string>",
"gl": "<string>",
"hl": "<string>"
},
"organic": [
{
"title": "<string>",
"link": "<string>",
"snippet": "<string>",
"position": 123,
"sitelinks": [
{
"title": "<string>",
"link": "<string>"
}
],
"date": "<string>",
"scrapeOutput": {
"title": "<string>",
"metadata": {},
"url": "<string>",
"format": "<string>",
"cleaned": true,
"content": "<string>"
}
}
],
"featuredSnippet": {
"title": "<string>",
"link": "<string>",
"snippet": "<string>",
"position": 123,
"type": "<string>"
},
"relatedSearches": [
{
"query": "<string>"
}
],
"peopleAlsoAsk": [
{
"question": "<string>",
"snippet": "<string>",
"title": "<string>",
"link": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Description
This endpoint performs a Google web search and optionally scrapes the content of the top search results, returning both search results and scraped content.Endpoint
POST https://app.dumplingai.com/api/v1/search
Headers
- Content-Type:
application/json - Authorization: Bearer
<API_KEY>(required)
Request Body
{
"query": "string", // Required. The search query.
"country": "string", // Optional. Country code for location bias (e.g., "US" for United States).
"location": "string", // Optional. Specific location to focus the search (e.g., "New York, NY").
"language": "string", // Optional. Language code for the search results (e.g., "en" for English).
"dateRange": "string", // Optional. Can be "anyTime", "pastHour", "pastDay", "pastWeek", "pastMonth", or "pastYear".
"page": "number", // Optional. Page number for paginated results.
"scrapeResults": "boolean", // Optional. Whether to scrape top search results. Default: false.
"numResultsToScrape": "number", // Optional. Number of top results to scrape. Default: 3. Max: 10.
"scrapeOptions": {
// Optional. Options for scraping, if scrapeResults is true.
"format": "string", // Optional. The format of the output. Valid values: "markdown", "html", "screenshot". Default: "markdown".
"cleaned": "boolean" // Optional. Whether the output should be cleaned. Default: true.
}
}
Responses
Success (200)
Returns the search results and optionally scraped content.{
"searchParameters": {
"q": "string", // The search query
"type": "string", // e.g., "search"
"engine": "string", // e.g., "google"
"gl": "string", // Optional. Google country code
"hl": "string" // Optional. Host language
},
"organic": [
{
"title": "string",
"link": "string",
"snippet": "string",
"position": "number",
"sitelinks": [
{
"title": "string",
"link": "string"
}
],
"date": "string", // Optional. Publication date if available
"scrapeOutput": {
// Optional. Present only if scraping was requested
"title": "string",
"metadata": "object",
"url": "string",
"format": "string", // "markdown", "html", or "screenshot"
"cleaned": "boolean",
"content": "string"
}
}
],
"featuredSnippet": {
"title": "string",
"link": "string",
"snippet": "string",
"position": "number",
"type": "string"
},
"relatedSearches": [
{
"query": "string"
}
],
"peopleAlsoAsk": [
{
"question": "string",
"snippet": "string",
"title": "string",
"link": "string"
}
]
}
- Content-Type: application/json
- X-RateLimit-Limit: The rate limit for the user.
- X-RateLimit-Remaining: The remaining number of requests for the user.
Bad Request (400)
Returned if the request is invalid.{
"error": "Error message describing the issue"
}
Unauthorized (401)
Returned if the API key is invalid or missing.{
"error": "Invalid or missing Authorization header"
}
Internal Server Error (500)
Returned if there’s an error during the search or scraping process.{
"error": "Failed to perform search: [error message]"
}
Example Request
curl -X POST https://app.dumplingai.com/api/v1/search \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"query": "DumplingAI",
"country": "US",
"language": "en",
"dateRange": "pastMonth",
"scrapeResults": true,
"numResultsToScrape": 3,
"scrapeOptions": {
"format": "html",
"cleaned": false
}
}'
Notes
- The maximum number of results that can be scraped is 10.
- If
numResultsToScrapeis set higher than 10, it will be capped at 10. - If
numResultsToScrapeis not provided, the default value is 3. - Credit usage:
- Base cost for search: 30 credits per page of results
- Additional credits for scraping are charged normally on the /scrape endpoint.
- If
scrapeResultsis false, no URLs will be scraped and thescrapeOutputfield will not be present in the organic results. - The
scrapeOptionsfield allows customization of the scraping process:formatcan be “markdown”, “html”, or “screenshot”. If not specified, “markdown” is used.cleaneddetermines whether the output should be cleaned. If not specified, it defaults to true.
- The
dateRangeparameter can be used to filter results by date. Valid values are “anyTime”, “pastHour”, “pastDay”, “pastWeek”, “pastMonth”, or “pastYear”. - The
countryparameter should be a two-letter country code (e.g., “US” for United States). - The
locationparameter can be used to focus the search on a specific area. You can find a list of supported locations at GET:/api/v1/google-locations - The
languageparameter can be used to specify the desired language for the search results. - Usage is recorded with detailed parameters for each request.
- Events may be logged for analytics purposes if enabled.
Rate Limiting
Rate limit headers (X-RateLimit-Limit and X-RateLimit-Remaining) are included in the response to indicate the user’s current rate limit status.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
2-letter country code forwarded as gl.
Free-form location context forwarded to the provider.
Interface language forwarded as hl.
Temporal filter applied to the search results.
Available options:
pastHour, pastDay, pastWeek, pastMonth, pastYear, anyTime Required range:
x >= 1When true, the service will scrape top organic results for rich content.
Required range:
1 <= x <= 10Show child attributes
Show child attributes
Optional identifier describing where the API request originated.
Available options:
API, WEB, MAKE_DOT_COM, ZAPIER, N8N, PLAYGROUND, DEFAULT_AUTOMATION, AGENT_PREVIEW, AGENT_LIVE, AUTOPILOT, STUDIO