X (Twitter) Posts Search avatar

X (Twitter) Posts Search

Pricing

from $0.20 / 1,000 result items

Go to Apify Store
X (Twitter) Posts Search

X (Twitter) Posts Search

✨ Search for X (formerly Twitter) posts using keywords or hashtags. Retrieve post URLs, content, publication dates, author details, and engagement metrics. Ideal for monitoring brand mentions on X over time.

Pricing

from $0.20 / 1,000 result items

Rating

5.0

(2)

Developer

Scraper One

Scraper One

Maintained by Community

Actor stats

23

Bookmarked

3.1K

Total users

460

Monthly active users

2 days ago

Last modified

Features

Limited permissions

Share

Apify Actor

This Apify Actor searches for posts on X (formerly Twitter) based on keywords or hashtags. The results include post URL, content, publication date, author information, and engagement metrics.

It's a powerful tool for monitoring public conversations on X, tracking brand mentions, staying updated on trending topics, and discovering high-engagement posts in real time. Stay ahead of potential reputation risks, detect viral content, and join relevant discussions 🚀

Features

  • 🔍 Search by keywords or hashtags
  • 🕐 Filter by time window (e.g. posts from the last 7 days)
  • 🧵 Choose between top or latest results
  • 🎥 Retrieve media (images, videos, gifs) from posts
  • 📊 Extract engagement metrics (likes, reposts, replies, quotes)

Input Parameters

ParameterTypeRequiredDescription
querystring✅Keyword or hashtag to search posts for.
resultsCountnumber❌Maximum number of posts to extract. If not set, only a few of the first posts will be returned.
timeWindowHoursinteger❌Posts from the last n hours, counted back from the start of the run. Omit or set to 0 to disable.
timeWindowinteger❌Posts from the last n days (24 hours each), counted back from the start of the run. Omit or set to 0 to disable.
sincestring❌Inclusive start: YYYY-MM-DD at midnight UTC, or ISO 8601 date/time. A missing timezone means UTC.
untilstring❌YYYY-MM-DD includes the entire UTC day. An ISO 8601 date/time is an exclusive upper bound; a missing timezone means UTC.
searchTypestring✅"top" (Most popular / relevant) or "latest" (newest first). The input form selects "top" by default.

Dates and time windows

All date fields and time windows work with Latest and Most popular / Top. You can choose a fixed date range, posts from a start date onward, posts up to an end date, or a rolling window such as the last four hours. Top ranks matching posts by popularity/relevance; Latest lists matching posts newest first.

For the separate since and until fields:

  • Use YYYY-MM-DD for whole UTC days. The start date is included, and the end date includes the entire day. Setting both fields to 2026-11-03 selects November 3 only.
  • For exact hours, use ISO 8601. The start is included; the end time is excluded. For example, 12:00:00Z to 13:00:00Z includes 12:00 but excludes 13:00.
  • A missing timezone means UTC: 2026-11-03T12:00:00 and 2026-11-03T12:00:00Z are equivalent. An explicit offset is also accepted: 2026-11-03T13:00:00+01:00 identifies the same instant.
  • You may leave either boundary empty. An invalid date is ignored individually, with a short warning in the run log; the other valid boundary still applies. If both dates are invalid, neither date restriction applies.
  • If the end is earlier than the start (after accounting for the whole-day rule), until is ignored with a warning and since still applies.
  • Posts have one-second timestamp precision. Equal start/end times select an empty range, while equal date-only fields select the entire UTC day.

Time filter priority

If more than one time filter is supplied, only the highest-priority source is used:

  1. Date/time operators in query: since:, until:, since_time:, until_time: or within_time:.
  2. A nonzero timeWindowHours.
  3. A nonzero timeWindow.
  4. The separate since and until fields, used together as one range.

For example, timeWindowHours: 4 overrides timeWindow: 7 and both separate date fields. If query already contains a date/time operator, all four date/window fields are ignored, even if the query supplies only one boundary. Operator names inside quoted search phrases, such as "since:2026-11-03", are treated as search text.

Dates written directly in query retain X's date and timezone rules. They are independent of the UTC rules of the separate date fields.

For existing users: existing query formats and window fields remain supported. Two combinations now have different behavior: windows also apply to Top searches, and dates in query take priority over windows rather than being restricted by them. Saved inputs using these combinations may return different results.

Examples

Search without a time restriction:

{
"query": "SpaceX",
"resultsCount": 30,
"searchType": "top"
}

Get the newest matching posts from the last four days:

{
"query": "NASA",
"resultsCount": 30,
"timeWindow": 4,
"searchType": "latest"
}

Get Top results from the last four hours:

{
"query": "bitcoin OR ethereum",
"resultsCount": 30,
"searchType": "top",
"timeWindowHours": 4
}

Get Top results from one complete UTC day:

{
"query": "NASA",
"resultsCount": 30,
"searchType": "top",
"since": "2026-11-03",
"until": "2026-11-03"
}

Get posts from 12:00 UTC up to, but excluding, 13:00 UTC:

{
"query": "bitcoin",
"resultsCount": 30,
"searchType": "latest",
"since": "2026-11-03T12:00:00Z",
"until": "2026-11-03T13:00:00Z"
}

Timezone is optional; these times are also interpreted as UTC:

{
"query": "bitcoin",
"searchType": "top",
"since": "2026-11-03T12:00:00",
"until": "2026-11-03T13:00:00"
}

If the end precedes the start, keep the start date and ignore the end with a warning:

{
"query": "NASA",
"searchType": "latest",
"since": "2026-11-05",
"until": "2026-11-03"
}

Use the four-hour window; the seven-day window and separate dates are ignored:

{
"query": "bitcoin",
"searchType": "top",
"timeWindowHours": 4,
"timeWindow": 7,
"since": "2026-11-01",
"until": "2026-11-03"
}

Keep a date-filtered query; timeWindowHours is ignored:

{
"query": "bitcoin since_time:1793664000 until_time:1793750400",
"searchType": "latest",
"timeWindowHours": 4
}

Output Data

The actor returns an array of JSON objects representing individual X posts.

Example Output

[
{
"postText": "#Iceland hospital\nAnd\nPolice hell !! See you soon on court 😉 https://t.co/axWj1bexPl",
"postUrl": "https://x.com/Maj33Majewska/status/1905313916126736649",
"timestamp": 1743097211000,
"conversationId": "1905313916126736649",
"postId": "1905313916126736649",
"media": [
{
"mediaUrlHttps": "https://pbs.twimg.com/amplify_video_thumb/1905313794902966272/img/0HvmBic_wjBJQa3b.jpg",
"type": "video",
"id": "1905313794902966272"
}
],
"author": {
"name": "Natalie",
"screenName": "Maj33Majewska",
"followersCount": 142,
"favouritesCount": 300,
"friendsCount": 171,
"description": "Strict and intelligent person is curious about @SpaceX"
},
"replyCount": 3,
"quoteCount": 4,
"repostCount": 4,
"favouriteCount": 11
}
]

✅ Let us know if you'd like to include additional data fields or filters.

Usage

  1. Create an Apify account and open the actor page.
  2. Configure input parameters in the Apify UI or via API.
  3. Run the actor and monitor logs for progress.
  4. Download extracted posts in JSON, CSV, or Excel format.

Limitations & Notes

  • Ensure your usage of X's data complies with their Terms of Service.
  • Avoid excessive scraping to reduce the risk of IP blocking or rate limiting.
  • Media content is linked directly from X and may expire or be removed.
  • Free users can retrieve up to 100 posts per search query.
  • Free users are rate-limited to a certain number of actually processed search queries per day.
  • For higher usage limits, upgrade to a paid Apify plan. Contact us if you need custom limits!

Works Best With

For best results, use this actor together with X Post Replies Scraper.

First, search for posts (tweets) matching your criteria using X Posts Search, then pass the postUrl values from selected results into X Post Replies Scraper's postUrls input to extract replies and enrich your dataset. ✅

Best Use Case Flow

  • 🔎 Run X Posts Search → Find relevant posts based on keywords or hashtags
  • 📥 Feed postUrl values into X Post Replies Scraper's postUrls input → Get replies for each selected post
  • 📊 Gain insights → Analyze engagement, sentiment, and conversation threads

This combination provides a powerful workflow for understanding discussions around specific topics on X. 🚀

If you're working with multiple platforms or want additional data sources, check out these scrapers:

Support & Contact

📬 Need help or found a bug? Open an issue or contact us at scraper1one@gmail.com