This API allows users to search for links related to a given query (prompt) using multiple tools, excluding X (Twitter) Search. The API returns a list of relevant sources from selected platforms such as web pages, YouTube, Wikipedia, and ArXiv.

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 Datura 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 communicate 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())

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.

Reddit

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.

X (Twitter)

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.