Web Link Search
Search links using all tools except X Search.
This API allows users to search for links related to a given query (prompt) using multiple tools, excluding X Search.
The API returns a list of relevant sources from selected platforms such as web pages, YouTube, Wikipedia, and ArXiv.
Using Web Link Search API
The following examples demonstrate how to interact with the Web Link Search API using multiple coding platform.
Request Sample
The below script:
-
Sends a POST request to the Desearch AI Search API https://apis.datura.ai/desearch/ai/search/links/web.
-
This call fetches search results related to the "Tesla Space Program" from various sources, including Web Search, YouTube, Wikipedia, and ArXiv.
-
The script communicates with the API, providing an authorization key and specifying the request body in JSON format.
-
The search query is processed using the NOVA AI model, which retrieves relevant links.
-
The API response is then printed in JSON format, containing the search results.
import requests
url = "https://apis.datura.ai/desearch/ai/search/links/web"
headers = {
"Authorization": "<your-api-key>",
"Content-Type": "application/json"
}
data = {
"prompt": "Tesla Space Program",
"tools": [
"Web Search", "Youtube Search", "Wikipedia Search", "ArXiv Search"
],
"model": "NOVA"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = "https://apis.datura.ai/desearch/ai/search/links/web";
const headers = {
"Authorization": "<your-api-key>",
"Content-Type": "application/json"
};
const data = {
prompt: "Tesla Space Program",
tools: [
"Web Search", "Youtube Search", "Wikipedia Search", "ArXiv Search"
],
model: "NOVA"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
const axios = require('axios');
const url = "https://apis.datura.ai/desearch/ai/search/links/web";
const headers = {
"Authorization": "<your-api-key>",
"Content-Type": "application/json"
};
const data = {
prompt: "Tesla Space Program",
tools: [
"Web Search", "Youtube Search", "Wikipedia Search", "ArXiv Search"
],
model: "NOVA"
};
axios.post(url, data, { headers })
.then(response => console.log(response.data))
.catch(error => console.error("Error:", error));
<?php
$url = "https://apis.datura.ai/desearch/ai/search/links/web";
$headers = [
"Authorization: <your-api-key>",
"Content-Type: application/json"
];
$data = [
"prompt" => "Tesla Space Program",
"tools" => [
"Web Search", "Youtube Search", "Wikipedia Search", "ArXiv Search"
],
"model" => "NOVA"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import Foundation
let url = URL(string: "https://apis.datura.ai/desearch/ai/search/links/web")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("<your-api-key>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestData: [String: Any] = [
"prompt": "Tesla Space Program",
"tools": [
"Web Search", "Youtube Search", "Wikipedia Search", "ArXiv Search"
],
"model": "NOVA"
]
do {
request.httpBody = try JSONSerialization.data(withJSONObject: requestData, options: [])
} catch {
print("Error serializing JSON:", error)
}
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error:", error)
return
}
if let data = data {
print(String(data: data, encoding: .utf8) ?? "Invalid response")
}
}
task.resume()
Parameters
Required
-
url
: The endpoint for the Web Link Search API. -
payload
/body
: A JSON string or dictionary containing:prompt
: A string representing the search query.tools
: A list of tools to be used for the search, e.g., [
"Web Search", "Hacker News Search", "Reddit Search", "Wikipedia Search", "Youtube Search", "ArXiv Search" ].model
: The model to be used for processing, e.g., "NOVA".
Response Sample
Based on the above code, here is how the response is retrieve as JSON. Each coding language has its own way of retrieving data from the below JSON.
{
"search_results": {
"organic_results": [
{
"type": "searchResult",
"title": "SpaceX put a Tesla sportscar into space five years ago. Where is it ...",
"link": "https://www.cnn.com/2023/02/06/world/spacex-elon-musk-tesla-roadster-five-years-scn/index.html",
"visible_link": "www.cnn.com ⺠2023/02/06 ⺠world ⺠spacex-elon-musk-tesla-roadster-fiv...",
"snippet": "As of Monday, February 6, the cherry-colored sports car has officially been in space for exactly five years."
},
{
"position": 11,
"title": "Spectacular Space X Launch Sends Tesla Roadster Into Orbit",
"link": "https://www.youtube.com/watch?v=qk6qxprCuGY",
"displayed_link": "1.6M+ views · 7 years ago",
"thumbnail": "https://i.ytimg.com/vi/qk6qxprCuGY/mqdefault.jpg?sqp=-oaymwEFCJQBEFM&rs=AMzJL3mUs2Nw2Xzi3xVfCNzBlg-RNaKVyQ",
"favicon": "https://serpapi.com/searches/67add007d2a22aeda8a2d16e/images/786de005266f699b9feec3b008e1929fc858a4b8af689d619b6eff42ee4822ae.png",
"snippet": "Elon Musk pulls off an engineering feat he sent his own kind of rocket man on board a Tesla Roadster into orbit.",
"duration": "2:25",
"video_link": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcTZYPRVpk2IW9vgM2ShkPfjx_Ztcr5z3ckhLg",
"source": "YouTube · KPIX | CBS NEWS BAY AREA"
}
],
"news_results": [],
"video_results": []
},
"youtube_search_results": [],
"wikipedia_search_results": [],
"arxiv_search_results": []
}
Models
Nova 1.0
Quick insights, broad coverage.
Orbit 1.0
Balanced analysis, targeted relevance.
Horizon 1.0
In-depth exploration, profound insights.
Tools
Web Search
To find information and resources across the internet.
To gather community-driven insights and discussions.
YouTube
For video content and tutorials.
Hacker News
To find tech-related news and discussions.
Wikipedia
For detailed and comprehensive information on a wide range of topics.
To gather real-time updates and discussions.
arXiv
For accessing research papers and preprints in various fields.
Test API
To experiment with the Web Link Search API and see it in action, visit the Web Link Search API.
Updated about 11 hours ago