X Twitter Posts Search avatar

X Twitter Posts Search

Pricing

$19.99/month + usage

Go to Apify Store
X Twitter Posts Search

X Twitter Posts Search

Search and extract posts from X (Twitter) by keyword, hashtag, or topic. Collect tweet text, usernames, timestamps, likes, reposts, replies, and more. Perfect for trend tracking, sentiment analysis, and social media research with clean, structured data output.

Pricing

$19.99/month + usage

Rating

0.0

(0)

Developer

ScrapeLabs

ScrapeLabs

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

0

Monthly active users

a day ago

Last modified

Share

X Twitter Posts Search is an Apify actor that searches and extracts public posts from X (Twitter) by profile, keyword, or query. It solves the manual, time-consuming process of collecting tweet text, engagement metrics, author details, and media by delivering clean, structured records at scale. Built for marketers, developers, data analysts, and researchers, it powers trend tracking, sentiment analysis, and social media research with automated, reliable pipelines.

What data / output can you get?

Below are the exact fields the actor saves to the dataset for each post. Examples illustrate typical values.

Data typeDescriptionExample value
idTweet ID (rest_id)"1765432109876543210"
urlDirect link to the post"https://x.com/wikipedia/status/1765432109876543210"
user_postedAuthor username (handle)"wikipedia"
nameAuthor display name"Wikipedia"
descriptionFull post text"Today in history: The first programmable computer..."
date_postedISO timestamp (UTC)"2026-03-22T14:05:12.000Z"
likesLike count128
repliesReply count42
repostsRepost count19
quotesQuote count7
viewsView/impressions count15432
bookmarksBookmark count3
is_verifiedAuthor verified statustrue
followersAuthor followers count1234567
followingAuthor following count12
posts_countAuthor total posts54321
profile_image_linkAuthor avatar URL"https://pbs.twimg.com/profile_images/.../avatar_normal.jpg"
biographyAuthor bio text"Free encyclopedia that anyone can edit."
hashtagsArray of hashtags (without #) or null["history", "OTD"]
tagged_usersArray of mentioned usernames or null["exampleuser"]
photosURL of a photo if present, else null"https://pbs.twimg.com/media/abcd1234.jpg"
videosArray of MP4 video URLs sorted by quality, else null["https://video.twimg.com/.../vid/720x1280/video.mp4"]
quoted_postQuoted post summary object{"data_posted":"2026-03-21T10:30:00.000Z","description":"Original post text","post_id":"1765000000000000001","profile_id":"6253282","profile_name":"Original Author","url":null,"videos":null}
external_urlAuthor profileโ€™s external URL if set, else null"https://www.wikipedia.org"
inputSource context for this row (query or URL){"searchQuery":"climate change"}

Note: You can export your dataset in JSON, CSV, or Excel directly from Apify.

Key features

  • ๐Ÿ”Ž Keyword, hashtag, and profile modes Query X via search (multi-word text or the โ€œsearch:โ€ prefix) or collect timeline posts from profiles (URLs, @handles, or usernames). Single-tweet links (/status/โ€ฆ) are intentionally skipped.

  • ๐Ÿงญ Top vs Latest search modes Choose searchType "top" for popular/relevant ordering or "latest" for newest-first results. โ€œLatestโ€ is ideal for time-sensitive monitoring.

  • โฑ๏ธ Time-window filtering (Latest) Combine searchType "latest" with timeWindow to keep only posts from the last N days (UTC) for both keyword searches and profile timelines.

  • ๐Ÿงฑ Proxy-ready with automatic fallback Configure proxyConfiguration to use Apify Proxy. The actor can escalate proxy tiers when requests throw (e.g., to datacenter and then RESIDENTIAL) to mitigate network blocks.

  • ๐ŸŽฅ Media-aware extraction Captures photos and MP4 video variants (sorted by bitrate), plus hashtags and mentions for richer analysis.

  • ๐Ÿ“Š Complete engagement & author metadata Collect likes, replies, reposts, quotes, views, bookmarks, and author fields like followers, following, posts_count, profile_image_link, biography, and is_verified.

  • ๐Ÿง  Robust session bootstrapping Automatically launches a headless browser to capture a guest bearer token and current GraphQL operation IDs for reliable, login-free scraping.

  • ๐Ÿ“ฆ Clean, structured dataset output Each record follows a consistent 25-field schema to streamline analysis, exports, and downstream integrations.

How to use X Twitter Posts Search - step by step

  1. Create or log in to your Apify account Open the Apify Console to access the actor.

  2. Add targets to startUrls Enter one target per row. Examples:

    • "https://x.com/wikipedia"
    • "@NASA"
    • "climate change"
    • "search: python from:NASA" Note: Links to a single tweet (/status/โ€ฆ) are skipped.
  3. Choose the Search mode Set searchType to "top" (default) or "latest" depending on your goal.

  4. (Optional) Limit to recent posts If you need freshness, set timeWindow (days) and use searchType = "latest".

  5. (Optional) Control volume Set maxTweets to cap how many posts are saved per target (1โ€“1000).

  6. (Optional) Configure proxy Under proxyConfiguration, enable Apify Proxy. For X, residential IPs work best. The actor can escalate proxy tiers automatically if requests throw.

  7. Start the run The actor bootstraps a session via Playwright, discovers GraphQL endpoints, and begins fetching results. Tweets are saved to the dataset as theyโ€™re collected.

  8. Export your data Open the runโ€™s Dataset and export to JSON, CSV, or Excel for reporting, enrichment, or pipelines.

Pro tip: Multi-word inputs trigger a live search; a single word or profile URL targets that accountโ€™s timeline. Use "search:" for advanced queries like search: python from:NASA.

Use cases

Use caseDescription
Social media analytics & reportingTrack engagement, hashtags, and content performance by collecting likes, replies, reposts, quotes, views, and bookmarks.
Trend & news monitoringMonitor โ€œLatestโ€ results within a defined timeWindow to capture breaking topics and real-time conversations.
Brand & competitor trackingAggregate timeline posts for specific accounts to benchmark messaging, cadence, and audience reactions.
Academic & market researchBuild clean corpora of tweet text, hashtags, and metadata for sentiment analysis and topic modeling.
Campaign & hashtag analysisAnalyze keyword or hashtag searches at scale with structured outputs for BI dashboards.
API/ETL pipelinesFeed structured JSON into data warehouses or automation tools for enrichment, alerting, and downstream workflows.

This actor focuses on precision, automation, and reliability for production data pipelines.

  • โœ… Structured, consistent output with 25 well-defined fields
  • ๐Ÿ”’ Proxy-aware with automatic escalation to handle challenging networks
  • โšก Scales to 1โ€“1000 posts per target with pagination and cursor handling
  • ๐Ÿงฐ Developer-friendly on Apify: datasets, exports, and SDK integrations
  • ๐Ÿงช No login required: captures guest bearer + cookies in a headless session
  • ๐ŸŽž๏ธ Media- and metadata-rich records for deeper analytics
  • ๐Ÿงผ Cleaner than ad-hoc scripts or extensions, with fewer duplicates and noise

In short: a production-ready alternative to unstable browser plugins and manual scraping workflows.

Yesโ€”when used responsibly. This actor targets publicly available content on X (Twitter) and does not access private profiles or authenticated data.

Guidelines:

  • Only collect public information and respect the platformโ€™s terms.
  • Comply with applicable regulations (e.g., GDPR, CCPA) when processing data.
  • Avoid scraping private accounts or attempting to bypass protections.
  • Validate your specific use case with your legal team if in doubt.

Input parameters & output format

Example input

{
"startUrls": [
"https://x.com/wikipedia",
"@NASA",
"climate change",
"search: python from:NASA"
],
"maxTweets": 50,
"timeWindow": 3,
"searchType": "latest",
"proxyConfiguration": {
"useApifyProxy": true
}
}

Parameter details

  • startUrls (array, required)

    • Description: Add one row per target. Works: https://x.com/username ยท @user ยท username ยท climate change ยท search: python from:NASA. Skipped: links to a single tweet (โ€ฆ/status/123โ€ฆ). Multi-word = search. One word / profile URL = that accountโ€™s posts.
    • Default: none
  • maxTweets (integer)

    • Description: Cap how many posts to collect per URL, user, or keyword (1โ€“1000). Higher = longer run & more API load.
    • Default: 10
    • Min/Max: 1โ€“1000
  • timeWindow (integer)

    • Description: Keep posts newer than this many days (UTC). Requires Search type โ†’ Latest + a number here. Applies to keyword search and profile timelines. Leave empty if you want all posts up to Max posts.
    • Default: none
    • Minimum: 1
  • searchType (string, required; enum: top, latest)

    • Description: Top โ†’ popular/relevant ordering. Latest โ†’ newest first (best for news + Time window). On profile runs this mainly changes sort order of saved posts.
    • Default: "top"
  • proxyConfiguration (object)

    • Description: Off = direct connection (fast, but X may block datacenter IPs). On = Apify Proxy โ€” pick groups in the proxy UI. The actor can escalate to other Apify proxy tiers if a request throws (network errors). For stubborn blocks, try RESIDENTIAL.
    • Default: {"useApifyProxy": false}

Example output

[
{
"id": "1765432109876543210",
"url": "https://x.com/wikipedia/status/1765432109876543210",
"user_posted": "wikipedia",
"name": "Wikipedia",
"description": "Today in history: The first programmable computer was demonstrated. #history #OTD",
"date_posted": "2026-03-22T14:05:12.000Z",
"likes": 128,
"replies": 42,
"reposts": 19,
"quotes": 7,
"views": 15432,
"bookmarks": 3,
"is_verified": true,
"followers": 1234567,
"following": 12,
"posts_count": 54321,
"profile_image_link": "https://pbs.twimg.com/profile_images/1234567890/avatar_normal.jpg",
"biography": "Free encyclopedia that anyone can edit.",
"hashtags": ["history", "OTD"],
"tagged_users": ["exampleuser"],
"photos": "https://pbs.twimg.com/media/abcd1234.jpg",
"videos": [
"https://video.twimg.com/amplify_video/1765432109876543210/vid/720x1280/sample.mp4"
],
"quoted_post": {
"data_posted": "2026-03-21T10:30:00.000Z",
"description": "Original post text",
"post_id": "1765000000000000001",
"profile_id": "6253282",
"profile_name": "Original Author",
"url": null,
"videos": null
},
"external_url": "https://www.wikipedia.org",
"input": {
"searchQuery": "climate change"
}
}
]

Notes:

  • For search queries, input contains {"searchQuery": "..."}.
  • For profile timelines, input contains {"url": "https://x.com/{screen_name}/status/{id}/"}.
  • photos is a single image URL if present; videos is an array of MP4 URLs sorted by quality; both may be null.

FAQ

Does it support single-tweet URLs?

No. Single tweet links that contain โ€œ/status/...โ€ are intentionally skipped. Provide a profile, username/@handle, or a search query instead.

How many posts can I collect per target?

Up to 1,000 per target. Control this with the maxTweets parameter (1โ€“1000). Higher limits increase run time and API load.

Do I need to log in to X (Twitter)?

No. The actor bootstraps a guest session in a headless browser, captures a bearer token and cookies, and uses Xโ€™s GraphQL endpoints without a user login.

How do I get only recent posts?

Set searchType to "latest" and provide timeWindow with the number of days (UTC). This filter applies to both keyword searches and profile timelines.

Can I search by keyword or hashtag?

Yes. Use multi-word inputs (e.g., "climate change") or the "search:" prefix (e.g., "search: python from:NASA") to trigger a live search on X.

Can I target profiles by URL or @handle?

Yes. Provide https://x.com/username, @user, or a plain username to collect that accountโ€™s timeline posts.

What fields are included in the output?

Each record includes id, url, user_posted, name, description, date_posted, likes, replies, reposts, quotes, views, bookmarks, is_verified, followers, following, posts_count, profile_image_link, biography, hashtags, tagged_users, photos, videos, quoted_post, external_url, and input.

How can I reduce blocks or failures?

Enable proxyConfiguration with Apify Proxy. The actor can escalate to other proxy tiers when requests throw. For stubborn blocks, use RESIDENTIAL proxies.

Final thoughts

X Twitter Posts Search is built to collect clean, structured X (Twitter) post data for analytics, monitoring, and research. With flexible targeting (profiles or search), time-window filtering, media extraction, and proxy-aware reliability, it serves marketers, analysts, and developers alike. Export to JSON/CSV/Excel, or plug the dataset into your automation pipeline to start extracting smarter social insights today.