v1.0.0 ยท updated from bundled OpenAPI
/twitter/post/userThe X posts search by user API allows users to search for relevant links or tweets based on X search queries without leveraging AI-powered models. This API analyze links from X posts that match the given prompt. Billing metadata: successful billable responses include the `X-Desearch-Cost-Usd`, `X-Desearch-Usage-Count`, `X-Desearch-Service`, and `X-Desearch-Currency` headers. JSON object responses also include optional `cost_usd`, `usage_count`, `service`, and `currency` fields. For example, `usage_count=10` at `$0.015 / 1,000` resolves to `cost_usd=0.00015`. JSON arrays, text, and streaming responses keep their body shape and expose billing metadata only through headers.
Base URL
https://api.desearch.aiUse Search X Posts by User when your application needs real-time X datawithout maintaining its own crawler, social-data pipeline, or retrieval infrastructure. The endpoint returns structured data that can be consumed by agents, research tools, dashboards, and retrieval-augmented generation workflows. Keep the request focused on the minimum fields your workflow needs so responses remain fast and easy to validate.
Send requests to GET /twitter/post/user with your Desearch API key in the authorization header. Treat the key as a server-side secret, validate all required parameters before sending the request, and handle non-2xx responses explicitly. Production integrations should use sensible timeouts, retry only transient failures with backoff, and record the response status and request identifier for troubleshooting.
Test the example request below before integrating it into a larger workflow. Confirm that the returned fields, links, and timestamps meet your freshness requirements, then add schema validation at the application boundary. For agentic systems, preserve source URLs with the generated answer so users can inspect evidence and your application can avoid presenting unsupported claims.
userstringrequiredUser to search for
querystringAdvanced search query
Default:
countintegerNumber of tweets to retrieve
Default: 10
Your API key is sent in the Authorization header.
curl -X GET "https://api.desearch.ai/twitter/post/user?user=elonmusk" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json"[
{
"user": {
"id": "123456789",
"url": "https://twitter.com/example_user",
"name": "John Doe",
"username": "johndoe",
"created_at": "2023-01-01T00:00:00Z",
"description": "This is an example user description.",
"favourites_count": 100,
"followers_count": 1500,
"followings_count": 100,
"listed_count": 10,
"media_count": 50,
"profile_image_url": "https://example.com/profile.jpg",
"profile_banner_url": "https://example.com/banner.jpg",
"statuses_count": 500,
"verified": true,
"is_blue_verified": true,
"entities": {},
"can_dm": true,
"can_media_tag": true,
"location": "Jamaica",
"pinned_tweet_ids": [
"123456789",
"987654321"
],
"professional": {
"professional_type": "Business",
"category": []
}
},
"id": "987654321",
"text": "This is an example tweet.",
"reply_count": 10,
"view_count": 1000,
"retweet_count": 5,
"like_count": 100,
"quote_count": 2,
"bookmark_count": 3,
"url": "https://twitter.com/example_tweet",
"created_at": "2023-01-01T00:00:00Z",
"media": [],
"is_quote_tweet": false,
"is_retweet": false,
"lang": "en",
"conversation_id": "987654321",
"in_reply_to_screen_name": "someuser",
"in_reply_to_status_id": "987654320",
"in_reply_to_user_id": "123456789",
"quoted_status_id": "987654319",
"quote": {
"user": {
"id": "123456789",
"url": "https://twitter.com/example_user",
"name": "John Doe",
"username": "johndoe",
"created_at": "2023-01-01T00:00:00Z",
"description": "This is an example user description.",
"favourites_count": 100,
"followers_count": 1500,
"followings_count": 100,
"listed_count": 10,
"media_count": 50,
"profile_image_url": "https://example.com/profile.jpg",
"profile_banner_url": "https://example.com/banner.jpg",
"statuses_count": 500,
"verified": true,
"is_blue_verified": true,
"can_dm": true,
"can_media_tag": true,
"location": "Jamaica",
"pinned_tweet_ids": [
"123456789",
"987654321"
]
},
"id": "987654321",
"text": "This is an example tweet.",
"reply_count": 10,
"view_count": 1000,
"retweet_count": 5,
"like_count": 100,
"quote_count": 2,
"bookmark_count": 3,
"url": "https://twitter.com/example_tweet",
"created_at": "2023-01-01T00:00:00Z",
"media": [],
"is_quote_tweet": false,
"is_retweet": false,
"lang": "en",
"conversation_id": "987654321",
"in_reply_to_screen_name": "someuser",
"in_reply_to_status_id": "987654320",
"in_reply_to_user_id": "123456789",
"quoted_status_id": "987654319",
"quote": {
"id": "987654321",
"text": "This is an example tweet.",
"reply_count": 10,
"view_count": 1000,
"retweet_count": 5,
"like_count": 100,
"quote_count": 2,
"bookmark_count": 3,
"url": "https://twitter.com/example_tweet",
"created_at": "2023-01-01T00:00:00Z",
"media": [],
"is_quote_tweet": false,
"is_retweet": false,
"lang": "en",
"conversation_id": "987654321",
"in_reply_to_screen_name": "someuser",
"in_reply_to_status_id": "987654320",
"in_reply_to_user_id": "123456789",
"quoted_status_id": "987654319",
"display_text_range": [
0,
280
]
},
"replies": [
{}
],
"display_text_range": [
0,
280
],
"entities": {},
"extended_entities": {},
"retweet": {
"id": "987654321",
"text": "This is an example tweet.",
"reply_count": 10,
"view_count": 1000,
"retweet_count": 5,
"like_count": 100,
"quote_count": 2,
"bookmark_count": 3,
"url": "https://twitter.com/example_tweet",
"created_at": "2023-01-01T00:00:00Z",
"media": [],
"is_quote_tweet": false,
"is_retweet": false,
"lang": "en",
"conversation_id": "987654321",
"in_reply_to_screen_name": "someuser",
"in_reply_to_status_id": "987654320",
"in_reply_to_user_id": "123456789",
"quoted_status_id": "987654319",
"display_text_range": [
0,
280
]
}
},
"replies": [
{
"user": {},
"id": "987654321",
"text": "This is an example tweet.",
"reply_count": 10,
"view_count": 1000,
"retweet_count": 5,
"like_count": 100,
"quote_count": 2,
"bookmark_count": 3,
"url": "https://twitter.com/example_tweet",
"created_at": "2023-01-01T00:00:00Z",
"media": [],
"is_quote_tweet": false,
"is_retweet": false,
"lang": "en",
"conversation_id": "987654321",
"in_reply_to_screen_name": "someuser",
"in_reply_to_status_id": "987654320",
"in_reply_to_user_id": "123456789",
"quoted_status_id": "987654319",
"quote": {},
"replies": [],
"display_text_range": [
0,
280
],
"entities": {},
"extended_entities": {},
"retweet": {}
}
],
"display_text_range": [
0,
280
],
"entities": {
"hashtags": [
{}
],
"media": [
{}
],
"symbols": [
{}
],
"timestamps": [],
"urls": [
{}
],
"user_mentions": [
{}
]
},
"extended_entities": {
"media": [
{}
]
},
"retweet": {
"user": {
"id": "123456789",
"url": "https://twitter.com/example_user",
"name": "John Doe",
"username": "johndoe",
"created_at": "2023-01-01T00:00:00Z",
"description": "This is an example user description.",
"favourites_count": 100,
"followers_count": 1500,
"followings_count": 100,
"listed_count": 10,
"media_count": 50,
"profile_image_url": "https://example.com/profile.jpg",
"profile_banner_url": "https://example.com/banner.jpg",
"statuses_count": 500,
"verified": true,
"is_blue_verified": true,
"can_dm": true,
"can_media_tag": true,
"location": "Jamaica",
"pinned_tweet_ids": [
"123456789",
"987654321"
]
},
"id": "987654321",
"text": "This is an example tweet.",
"reply_count": 10,
"view_count": 1000,
"retweet_count": 5,
"like_count": 100,
"quote_count": 2,
"bookmark_count": 3,
"url": "https://twitter.com/example_tweet",
"created_at": "2023-01-01T00:00:00Z",
"media": [],
"is_quote_tweet": false,
"is_retweet": false,
"lang": "en",
"conversation_id": "987654321",
"in_reply_to_screen_name": "someuser",
"in_reply_to_status_id": "987654320",
"in_reply_to_user_id": "123456789",
"quoted_status_id": "987654319",
"quote": {
"id": "987654321",
"text": "This is an example tweet.",
"reply_count": 10,
"view_count": 1000,
"retweet_count": 5,
"like_count": 100,
"quote_count": 2,
"bookmark_count": 3,
"url": "https://twitter.com/example_tweet",
"created_at": "2023-01-01T00:00:00Z",
"media": [],
"is_quote_tweet": false,
"is_retweet": false,
"lang": "en",
"conversation_id": "987654321",
"in_reply_to_screen_name": "someuser",
"in_reply_to_status_id": "987654320",
"in_reply_to_user_id": "123456789",
"quoted_status_id": "987654319",
"display_text_range": [
0,
280
]
},
"replies": [
{}
],
"display_text_range": [
0,
280
],
"entities": {},
"extended_entities": {},
"retweet": {
"id": "987654321",
"text": "This is an example tweet.",
"reply_count": 10,
"view_count": 1000,
"retweet_count": 5,
"like_count": 100,
"quote_count": 2,
"bookmark_count": 3,
"url": "https://twitter.com/example_tweet",
"created_at": "2023-01-01T00:00:00Z",
"media": [],
"is_quote_tweet": false,
"is_retweet": false,
"lang": "en",
"conversation_id": "987654321",
"in_reply_to_screen_name": "someuser",
"in_reply_to_status_id": "987654320",
"in_reply_to_user_id": "123456789",
"quoted_status_id": "987654319",
"display_text_range": [
0,
280
]
}
}
}
]Possible status codes: