create_gravity_task
Set up large-scale data collection from X (Twitter) or Reddit for up to 7 days; receive an email notification when the dataset is ready for download.
Instructions
Create a Gravity task for large-scale data collection from X (Twitter) or Reddit. Use this for collecting large datasets over time (up to 7 days). For quick queries (up to 1000 results), use query_on_demand_data instead.
The task registers on the network within 20 minutes and collects data for 7 days. You'll receive an email notification when the dataset is ready for download.
Parameters:
tasks (List[dict], REQUIRED): List of task objects, each containing:
platform (str): 'x' or 'reddit'
topic (str): The hashtag/subreddit to monitor
For X: MUST start with '#' or '$' (e.g., '#ai', '$BTC') - plain keywords are rejected!
For Reddit: subreddit name (e.g., 'r/MachineLearning')
keyword (str, optional): Additional keyword filter within the topic
Filters posts to only those containing this keyword
Example: topic='#Bittensor', keyword='dTAO' -> only #Bittensor posts mentioning 'dTAO'
name (str, optional): Name for the task (helps organize multiple tasks)
email (str, optional): Email address for notification when dataset is ready
redirect_url (str, optional): URL to redirect to from the email notification
Returns:
gravity_task_id: Unique identifier to track and manage the task
Examples:
Basic collection: create_gravity_task( tasks=[{"platform": "x", "topic": "#ai"}], name="AI Tweets" )
With keyword filter: create_gravity_task( tasks=[{"platform": "x", "topic": "#Bittensor", "keyword": "dTAO"}], name="Bittensor dTAO mentions" )
Multiple platforms: create_gravity_task( tasks=[ {"platform": "x", "topic": "#ai", "keyword": "LLM"}, {"platform": "reddit", "topic": "r/MachineLearning"} ], name="AI Data Collection", email="user@example.com" )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| No | |||
| tasks | Yes | ||
| redirect_url | No | https://app.macrocosmos.ai/ |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |