This API allows users to search for any information over the web. This replicates a typical search engine experience, where users can search for any information they need.Documentation Index
Fetch the complete documentation index at: https://docs.datura.ai/llms.txt
Use this file to discover all available pages before exploring further.
Using the Basic Web Search API
The following examples demonstrate how to interact with the Basic Web Search API using both multiple coding platform.Request Sample
The below code snippet:- Sends an HTTP GET request to the https://apis.datura.ai/web API to retrieve the latest news related to AI.
- The script defines the API endpoint and sets query parameters, including a search query for “latest news on AI” the number of results to fetch (num: 10), and the starting index (start: 0).
- Additionally, it specifies headers, including an Authorization key (which needs to be replaced with a valid API key) and a Content-Type set to application/json.
- The request is then sent using requests.get, but there is a mistake in the method call—the “GET” string should not be included, as requests.get(url, params=params, headers=headers) is the correct syntax.
- Finally, the script prints the response content, displaying the retrieved news data.
Parameters
Required
-
url: The endpoint for the Basic Web Search API. -
payload/queryquery: The search query string, e.g., ‘latest news on AI’.
Optional
num: Count of results to get, e.g., 10start: How many results to skip (used for pagination with num), e.g., 0