SheetMagicSheetMagic

Scrape X (Twitter) Mentions to Google Sheets in Minutes

Turn brand mentions into a sortable report: =TWITTERSEARCH() exports X posts to Google Sheets with author, text, likes, retweets and follower counts at 2 scraping credits per post.

Phil Nguyen · 5 min read

=TWITTERSEARCH("yourbrand", "Latest") pulls X (Twitter) posts about your brand, a competitor or a hashtag into Google Sheets with the author, text, date, likes, retweets, replies and follower count on every row. It costs 2 scraping credits per post, so the default 20 posts cost 40 credits.

Think of a social media manager who builds a weekly mentions report by searching X, screenshotting posts and pasting them into a slide. Twenty mentions at a few minutes each eats most of an hour, and the screenshots cannot be sorted or counted. One formula puts the same posts in rows you can sort, count and chart.

How do I search X (Twitter) from Google Sheets?

Type the formula into any empty cell:

=TWITTERSEARCH(searchTerms, sort, tweetLanguage, maxResults)
  • searchTerms: plain words, hashtags or @handles, like "acme crm", "#productivity" or "@acme". A range of terms works too.
  • sort: "Top" for the posts with the most engagement, or "Latest" for newest first. The default is Top.
  • tweetLanguage: optional lowercase two-letter code, like "en" or "es".
  • maxResults: optional total number of posts across all your terms. The default is 20 and the maximum is 500.

X's own search operators work inside the search term, so "acme since:2026-11-01" or "acme min_faves:50" narrow the results without extra arguments.

The cell shows ⏳ Scraping... first. When the run finishes, SheetMagic writes the posts to a new tab called Twitter Scraper Results.

What data does each post include?

Every row has Author, Handle, Text, Date, Retweets, Likes, Replies, Is Retweet, URL, Author Bio, Author Followers, Author Following and Verified, followed by Quotes, Bookmarks, Language, Posted From, Is Reply, Is Quote, Author URL and Tweet ID.

Example output (illustrative rows, not real data):

HandleTextLikesRetweetsAuthor Followers
@opsjaneSwitched our team to Acme last week, setup took 10 minutes34512,400
@devmikeAcme export keeps timing out on big files, anyone else?81860
@growthkateAcme vs Beta for small teams? Thread1202248,900

What can I do with the results?

  1. Reply to the accounts that matter first. Sort by Author Followers. A complaint from an account with 50,000 followers deserves a reply before one with 50, and you can see the order in seconds.
  2. Catch complaints before they spread. In a new column of the results tab, point AITEXT at the Text cell, for example =AITEXT("Is this positive, negative or neutral? One word.", D2), and drag it down. Column A of the results tab is Source, so Text sits in column D. Filter for negative and route those posts to support. A complaint answered early is a customer you may keep.
  3. Build the weekly report in minutes. Count rows per week or per sentiment with a pivot table instead of screenshotting posts. In this example, 20 mentions at about 3 minutes each by hand is an hour; one formula is about a minute and 40 scraping credits.
  4. Mine competitor mentions for content. Search a competitor's name and read what people ask about it. Each repeated question is a post or landing page you can write.

How do I scale to several brands or terms?

Put your terms in a column and pass the range: =TWITTERSEARCH(A2:A6, "Latest", "en", 100). maxResults is the total across all terms, so 100 here means about 100 posts in all, not 100 per term. If you need a fixed number per term, give each term its own formula.

How much does it cost?

X search costs 2 scraping credits per post delivered, with no start fee.

PostsCredits
20 (default)40
100200
500 (maximum)1,000

Scenario: tracking 5 brand terms with 20 posts each every week is 100 posts, so 200 credits a week. If nothing is found, the cell says so and you are not charged. If your balance cannot cover the run, SheetMagic shrinks it to fit and adds a row saying it was limited.

Paid plans include 10,000 scraping credits a month on Solo, 45,000 on Growth and 115,000 on Scale. The Free plan includes 100 scraping credits.

What are the common pitfalls?

  • Do not nest TWITTERSEARCH inside AITEXT. The formula returns a ⏳ Scraping... placeholder and the posts land later in the results tab. Put AITEXT in its own column and point it at the Text cells there.
  • Text is cut at 500 characters. Open the URL for the full post.
  • Retweets are included. Filter the Is Retweet column to FALSE when you only want original posts.
  • maxResults is a total, not per term. Raise it, or split terms into separate formulas, when you search several terms at once.

For more scrapers that run from a cell, see the web scraping guide. To turn the rows into charts and summaries, see data analysis, and for the same workflow on Instagram, see scrape Instagram to Google Sheets.

Text and scraping formulas run on the free allowance. Install from the Google Workspace Marketplace, no card, no expiry.

Install free for Google Sheets

About the author

Phil NguyenPhil builds SheetMagic, the Google Sheets add-on that brings AI and web scraping into the spreadsheet, used by 6,300+ people. He writes these guides from the formulas he runs on his own sheets.