curl --request POST \
--url https://api.edenai.run/v3/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"model": "<string>",
"max_results": 10,
"search_domain_filter": [
"<string>"
],
"country": "<string>"
}
'import requests
url = "https://api.edenai.run/v3/search"
payload = {
"query": "<string>",
"model": "<string>",
"max_results": 10,
"search_domain_filter": ["<string>"],
"country": "<string>"
}
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: '<string>',
model: '<string>',
max_results: 10,
search_domain_filter: ['<string>'],
country: '<string>'
})
};
fetch('https://api.edenai.run/v3/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.edenai.run/v3/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' => '<string>',
'model' => '<string>',
'max_results' => 10,
'search_domain_filter' => [
'<string>'
],
'country' => '<string>'
]),
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://api.edenai.run/v3/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"model\": \"<string>\",\n \"max_results\": 10,\n \"search_domain_filter\": [\n \"<string>\"\n ],\n \"country\": \"<string>\"\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://api.edenai.run/v3/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"model\": \"<string>\",\n \"max_results\": 10,\n \"search_domain_filter\": [\n \"<string>\"\n ],\n \"country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/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\": \"<string>\",\n \"model\": \"<string>\",\n \"max_results\": 10,\n \"search_domain_filter\": [\n \"<string>\"\n ],\n \"country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"results": [
{
"url": "<string>",
"title": "",
"snippet": "",
"date": "<string>",
"last_updated": "<string>"
}
],
"provider": "<string>",
"cost": 123
}Search
Search the web with a Perplexity-shaped request.
Send a query and the provider as model (tavily, linkup, firecrawl,
deepseek, perplexityai, zai; see GET /v3/search/models), optionally
max_results. search_domain_filter is taken by tavily, linkup and
perplexityai, country by tavily and perplexityai; any other provider
answers either with a 400. Results come back as {title, url, snippet} items; provider
and cost (USD) are Eden AI extensions. With the Perplexity SDK, pass the
provider through extra_body={"model": "tavily"}.
curl --request POST \
--url https://api.edenai.run/v3/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"model": "<string>",
"max_results": 10,
"search_domain_filter": [
"<string>"
],
"country": "<string>"
}
'import requests
url = "https://api.edenai.run/v3/search"
payload = {
"query": "<string>",
"model": "<string>",
"max_results": 10,
"search_domain_filter": ["<string>"],
"country": "<string>"
}
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: '<string>',
model: '<string>',
max_results: 10,
search_domain_filter: ['<string>'],
country: '<string>'
})
};
fetch('https://api.edenai.run/v3/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.edenai.run/v3/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' => '<string>',
'model' => '<string>',
'max_results' => 10,
'search_domain_filter' => [
'<string>'
],
'country' => '<string>'
]),
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://api.edenai.run/v3/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"model\": \"<string>\",\n \"max_results\": 10,\n \"search_domain_filter\": [\n \"<string>\"\n ],\n \"country\": \"<string>\"\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://api.edenai.run/v3/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"model\": \"<string>\",\n \"max_results\": 10,\n \"search_domain_filter\": [\n \"<string>\"\n ],\n \"country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/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\": \"<string>\",\n \"model\": \"<string>\",\n \"max_results\": 10,\n \"search_domain_filter\": [\n \"<string>\"\n ],\n \"country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"results": [
{
"url": "<string>",
"title": "",
"snippet": "",
"date": "<string>",
"last_updated": "<string>"
}
],
"provider": "<string>",
"cost": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for POST /v3/search.
Perplexity's Search API shape (query, max_results, search_domain_filter,
country) plus model, the Eden AI provider that runs the search. Any other
field (search_recency_filter, max_tokens_per_page, depth, ...) is refused
with a 422 naming it (extra="forbid"): the facade maps only these fields onto
each provider, so an unmapped one is never dropped without an error.
The search query. At most 128 characters on deepseek.
1Search provider, e.g. tavily. Optional when the provider is in the path (POST /v3/search/{provider}). List the ids with GET /v3/search/models.
Most results to return (1-20). A provider may return fewer; on zai the results are cut to this number after the search.
1 <= x <= 20Domains to restrict results to, or, with a leading -, domains to exclude (-pinterest.com). Allow and deny entries cannot be mixed. Up to 20.
1 - 20 elementsISO 3166-1 alpha-2 country code to bias results toward, e.g. US.
^[A-Za-z]{2}$Response
Successful Response
Search results, in Perplexity's response shape. provider and cost are Eden extensions.