How to Monitor New Public Serenity Posts on X
If Serenity publishes a market-moving public post, you may want to know before the discussion has already spread. TwexAPI's Advanced Twitter Search by Page endpoint can be polled with from:aleabitoreddit and sortBy: Latest to catch new public matches.
This is a polling workflow, not a streaming connection. The important part is state: store previously seen tweet_id values, treat the first run as a baseline, and alert only on posts that appear after the monitor is running.
Monitoring Model
A small monitor should do five things in order:
- Fetch the latest
from:aleabitoredditresults. - On the first run, seed
seen_idswithout sending alerts. - On later runs, compare each
tweet_idwith stored IDs. - Save the raw post before sending Slack, email, or webhook alerts.
- Sleep for a reasonable interval, usually 5 to 15 minutes.
API Endpoint
POST https://api.twexapi.io/twitter/advanced_search/page
Authorization: Bearer <your_token>
Content-Type: application/jsoncurl --request POST \
--url https://api.twexapi.io/twitter/advanced_search/page \
--header 'Authorization: Bearer <your_token>' \
--header 'Content-Type: application/json' \
--data '{
"searchTerms": ["from:aleabitoreddit"],
"sortBy": "Latest"
}'Python Polling Example
This example keeps seen_ids in memory to show the control flow. Use a database, Redis, or a small durable file for real monitoring.
1import time
2import requests
3
4TOKEN = "<your_token>"
5URL = "https://api.twexapi.io/twitter/advanced_search/page"
6HEADERS = {"Authorization": f"Bearer {TOKEN}"}
7seen_ids = set()
8initialized = False
9
10def fetch_latest():
11 response = requests.post(
12 URL,
13 headers=HEADERS,
14 json={"searchTerms": ["from:aleabitoreddit"], "sortBy": "Latest"},
15 timeout=30,
16 )
17 response.raise_for_status()
18 return [tweet for tweet in response.json().get("data", []) if tweet]
19
20while True:
21 latest = fetch_latest()
22
23 if not initialized:
24 seen_ids.update(tweet["tweet_id"] for tweet in latest if tweet.get("tweet_id"))
25 initialized = True
26 print(f"Initialized with {len(seen_ids)} existing posts")
27 else:
28 for tweet in reversed(latest):
29 tweet_id = tweet.get("tweet_id")
30 if tweet_id and tweet_id not in seen_ids:
31 seen_ids.add(tweet_id)
32 print("NEW", tweet_id, tweet.get("text", ""))
33
34 time.sleep(300)Before Running in Production
- Persist
seen_idsin a database, key-value store, or durable local file instead of memory. - Decide whether the first run should seed a baseline or alert on all currently visible posts.
- Run the poller every 5 to 15 minutes based on your freshness needs and credit budget.
- Save the raw response before sending Slack, email, or webhook alerts.
- Add alert throttling so retries do not notify the same post multiple times.
- Use cashtag search separately to observe the wider public conversation.
Related Resources
- Advanced Search by Page API Reference
- Get Serenity Tweets and Replies
- Export Serenity Tweets Page by Page
Disclaimer
This monitor surfaces public posts for research. It does not evaluate financial claims and is not investment advice.