Using the X Posts Search API
The following examples demonstrate how to interact with the X Posts Search API using multiple coding platform.Request Sample
This script sends:- A POST request to the AI-powered search API endpoint https://apis.datura.ai/desearch/ai/search/links/twitter.
- The request body (payload) contains a “prompt” field with the query “What are the recent sport events?” and specifies “model”: “NOVA” as the AI model to be used.
- The Authorization header includes an API key, and the Content-Type is set to “application/json”.
- The script sends the request , passing the url, payload, and headers, and then prints the raw response text.
Parameters
Required
-
url: The endpoint for the X (Twitter) Posts Search API. -
payload/body: A JSON string or dictionary containing:prompt: A string representing the search query.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.Models
Nova 1.0
Quick insights, broad coverage.
Orbit 1.0
Balanced analysis, targeted relevance.
Horizon 1.0
In-depth exploration, profound insights.