query_on_demand_data
Fetch real-time social media posts from X and Reddit by source, username, keyword, or date range. Retrieve targeted data for monitoring, research, or analysis.
Instructions
Fetch real-time social media data from X (Twitter) and Reddit through the Macrocosmos SN13 network. IMPORTANT: This tool requires 'source' parameter to be either 'X' or 'REDDIT' (case-sensitive). Parameters:
source (str, REQUIRED): Data platform - must be 'X' or 'REDDIT'
usernames (List[str], optional): Up to 5 usernames to monitor.
For X: '@' symbol is optional (e.g., ['elonmusk', '@spacex'] both work)
NOT available for Reddit
keywords (List[str], optional): Up to 5 keywords/hashtags to search
For X: any keywords or hashtags (e.g., ['AI', 'crypto', '#bitcoin'])
For Reddit: subreddit names (e.g., ['r/astronomy', 'space']) or 'r/all' for all subreddits
start_date (str, optional): Start date/datetime in YYYY-MM-DD or ISO format
Examples: '2024-04-01' or '2024-01-01T00:00:00Z'
Defaults to 24 hours ago from current time if not specified
end_date (str, optional): End date/datetime in YYYY-MM-DD or ISO format
Examples: '2024-04-25' or '2024-06-03T23:59:59Z'
Defaults to current time if not specified
limit (int, optional): Maximum number of results to return (range: 1-1000, default: 10)
keyword_mode (str, optional): How to match keywords - 'any' (default) or 'all'
'any': returns posts matching ANY of the keywords
'all': returns posts matching ALL of the keywords Default Behavior (when dates not specified): The tool searches the last 24 hours (from current time back to 24 hours ago). Usage Examples:
Get recent tweets from specific users: query_on_demand_data(source='X', usernames=['@elonmusk', '@spacex'], limit=20)
Search tweets by keywords in last 24 hours: query_on_demand_data(source='X', keywords=['AI', 'machine learning'], limit=30)
Monitor specific users AND filter by keywords: query_on_demand_data(source='X', usernames=['@nasa'], keywords=['space', 'mars'], limit=20)
Monitor Reddit subreddits: query_on_demand_data(source='REDDIT', keywords=['r/astronomy', 'space'], limit=50)
Search across all of Reddit with date range: query_on_demand_data(source='REDDIT', keywords=['r/all', 'space'], start_date='2025-04-01', end_date='2025-04-02', limit=50)
Strict keyword matching (requires ALL keywords): query_on_demand_data(source='X', keywords=['AI', 'machine learning'], keyword_mode='all', limit=30)
Precise datetime range search: query_on_demand_data(source='X', keywords=['Bitcoin'], start_date='2024-06-01T00:00:00Z', end_date='2024-06-03T23:59:59Z', limit=100)
Returns: JSON object containing:
status: "success" or error information
data: Array of posts/tweets with full content, user information, engagement metrics, timestamps, platform-specific metadata, and media attachments
meta: Processing statistics (miners queried, response rates, items returned, etc.) Platform-Specific Notes:
X (Twitter): '@' symbol is optional for usernames
Reddit: Does NOT support username filtering, only subreddit/keyword searches
All timestamps returned in UTC format
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| source | Yes | ||
| end_date | No | ||
| keywords | No | ||
| usernames | No | ||
| start_date | No | ||
| keyword_mode | No | any |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |