How to Collect Ron Filipkowski X Data with TwexAPI
When you need data from a public X account, start with a narrow collection plan. For the Ron Filipkowski account, that usually means collecting profile metadata, recent timeline posts, and a search-filtered view of posts when you need a specific topic.
This guide uses RonFilipkowski as the example screen name. If the account handle changes, replace the screen name in the examples before running the requests.
Collection Plan
Use three TwexAPI endpoints depending on what you need:
| Task | Endpoint | When to use it |
|---|---|---|
| Get public account metadata | GET /twitter/{screen_name}/about | Capture profile fields before collecting posts. |
| Page through the account timeline | POST /twitter/{screen_name}/timeline/page | Collect recent account posts with cursor pagination. |
| Search within public X results | POST /twitter/advanced_search/page | Filter by query, such as from:RonFilipkowski election, and paginate search results. |
For reporting or research, store raw responses as well as normalized rows. That gives you an audit trail if you later change your parsing logic.
Get Account Metadata
curl --request GET \
--url https://api.twexapi.io/twitter/RonFilipkowski/about \
--header 'Authorization: Bearer <token>'Use the profile response to store the screen name, display name, user ID, description, and public counters returned by the API. Keep this record separate from timeline posts so later snapshots can show when profile fields changed.
Page Through Timeline Posts
POST /twitter/{screen_name}/timeline/page accepts count and next_cursor. Leave next_cursor empty for the first page, then reuse the returned cursor while has_next_page is true.
curl --request POST \
--url https://api.twexapi.io/twitter/RonFilipkowski/timeline/page \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"count": 20
}'The response includes data, has_next_page, next_cursor, requested_count, effective_count, and parsed_count.
{
"code": 200,
"msg": "success",
"data": [],
"has_next_page": true,
"next_cursor": "DAAHCgAB...",
"requested_count": 20,
"effective_count": 20,
"parsed_count": 20
}Python Collector
This example collects a bounded number of timeline pages and normalizes the fields that are usually useful in a review table.
1import os
2from typing import Any
3
4import requests
5
6TOKEN = os.environ["TWEXAPI_BEARER_TOKEN"]
7SCREEN_NAME = "RonFilipkowski"
8BASE_URL = "https://api.twexapi.io"
9
10def twexapi_headers() -> dict[str, str]:
11 return {"Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json"}
12
13def get_profile(screen_name: str) -> dict[str, Any] | None:
14 response = requests.get(
15 f"{BASE_URL}/twitter/{screen_name}/about",
16 headers=twexapi_headers(),
17 timeout=30,
18 )
19 response.raise_for_status()
20 return response.json().get("data")
21
22def get_timeline_page(
23 screen_name: str,
24 *,
25 count: int = 20,
26 next_cursor: str | None = None,
27) -> dict[str, Any]:
28 payload: dict[str, Any] = {"count": count}
29 if next_cursor:
30 payload["next_cursor"] = next_cursor
31
32 response = requests.post(
33 f"{BASE_URL}/twitter/{screen_name}/timeline/page",
34 headers=twexapi_headers(),
35 json=payload,
36 timeout=30,
37 )
38 response.raise_for_status()
39 return response.json()
40
41def normalize_post(post: dict[str, Any]) -> dict[str, Any]:
42 return {
43 "tweet_id": post.get("tweet_id") or post.get("id"),
44 "created_at": post.get("created_at_datetime") or post.get("created_at"),
45 "text": post.get("full_text") or post.get("text") or "",
46 "favorite_count": post.get("favorite_count") or 0,
47 "retweet_count": post.get("retweet_count") or 0,
48 "reply_count": post.get("reply_count") or 0,
49 "quote_count": post.get("quote_count") or 0,
50 "url": f"https://x.com/i/status/{post.get('tweet_id') or post.get('id')}",
51 }
52
53def collect_timeline(screen_name: str, max_pages: int = 3) -> list[dict[str, Any]]:
54 rows: list[dict[str, Any]] = []
55 cursor = None
56
57 for _ in range(max_pages):
58 page = get_timeline_page(screen_name, count=20, next_cursor=cursor)
59 rows.extend(normalize_post(post) for post in page.get("data", []))
60
61 if not page.get("has_next_page"):
62 break
63 cursor = page.get("next_cursor")
64 if not cursor:
65 break
66
67 return rows
68
69if __name__ == "__main__":
70 profile = get_profile(SCREEN_NAME)
71 rows = collect_timeline(SCREEN_NAME, max_pages=2)
72 print(profile.get("screen_name") if profile else SCREEN_NAME, len(rows))Optional Topic Search
Timeline collection gives you posts from the account. When you need posts matching a topic, use advanced search by page with a query such as from:RonFilipkowski keyword.
curl --request POST \
--url https://api.twexapi.io/twitter/advanced_search/page \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"searchTerms": ["from:RonFilipkowski election"],
"sortBy": "Latest"
}'This returns search result pages with data, has_next_page, and next_cursor. Store the search query alongside each result so you know why the post was collected.
Data Hygiene
- Record
screen_name, collection time, endpoint, query, and cursor for every run. - Deduplicate by
tweet_id. - Keep raw JSON for auditability.
- Do not infer intent, stance, or truthfulness from engagement counts alone.
- Review quoted posts, media, and replies manually before using them in reports.
Wrap-up
For a public account such as RonFilipkowski, the clean workflow is: fetch the profile, page through the timeline, optionally run topic-specific advanced searches, and normalize the results into rows you can review.
That keeps the article practical and avoids turning account collection into unsupported analysis claims.