Log every campaign hashtag tweet to Airtable
Every 30 minutes, capture every new public X post that uses your campaign hashtag and save it to Airtable as a clean dataset for reporting.
Build a code workflow that captures every public X post using my campaign hashtag and logs each one as a row in Airtable, so my marketing team has a clean dataset for reporting.
Trigger: cron, every 30 minutes. The workflow runs continuously for the duration of the campaign.
Configurable inputs: the X search query (default a single hashtag like "#YourLaunch2026", but any TwitterAPI.io advanced-search query is valid), the Airtable base ID, and the Airtable table ID. The tweet ID column in Airtable should be named tweet_id.
Step 1. Call TwitterAPI.io Advanced Search with the configured query and a sinceTime cursor. On the first run, set sinceTime to the workflow start time. On every subsequent run, set sinceTime to the largest createdAt seen on the previous run, stored in workflow state, so we never miss tweets and never reprocess pages. Paginate by passing the response's next_cursor back as cursor, and keep calling until has_next_page is false OR the returned data array is empty. TwitterAPI.io's has_next_page flag can flap true past the end of data, so always also stop when the data array comes back empty. Collect every tweet returned across all pages into a single batch.
Step 2. For each tweet, build a row with these columns: tweet_id (string, from id), posted_at (ISO string, from createdAt), author_handle (string, from author.userName), author_followers (number, from author.followers), text (string, from text), link (string, from url), like_count (number, from likeCount), reply_count (number, from replyCount), retweet_count (number, from retweetCount), quote_count (number, from quoteCount), has_media (boolean, true if entities.media exists and is non-empty), is_reply (boolean, from isReply).
Step 3. Call Airtable Create Records to append the rows to the configured base and table. Airtable accepts a maximum of 10 records per call, so chunk the batch into groups of 10 and make sequential calls until every row is written. Pass typecast=true so Airtable converts strings into the right cell types where possible.
Step 4. After all writes succeed, update workflow state with the new sinceTime cursor (the max createdAt from this batch) so the next run picks up exactly where this one stopped. If no tweets were returned this run, leave the cursor unchanged.
Important notes to surface in the table setup help so the user knows what to configure in Airtable before enabling the workflow: mark the tweet_id field as a Unique Field in Airtable so any accidental retry is rejected before it creates a duplicate row; and the field names in the Airtable table must match the column names above exactly.
Keep this purely deterministic: no AI summarization, no scoring, no sentiment, no judgment. Just clean ingestion so the marketing team can pivot, filter, and chart in Airtable.
Additional information
What does this prompt do?
- Runs on a 30-minute schedule for the entire life of your campaign, so nothing slips through.
- Pulls every new public X post that matches your campaign hashtag, no matter who wrote it.
- Saves each post to Airtable with the author handle, follower count, body, link, and live engagement counts.
- Uses the post ID as a dedupe key, so re-running the workflow never creates duplicate rows.
What do I need to use this?
- A TwitterAPI.io account and API key
- An Airtable account, plus a base and table set up to receive the rows
- The campaign hashtag (or any X search query you want to track)
How can I customize it?
- Swap the hashtag, or combine multiple hashtags and mentions in one query (e.g. #LaunchA OR #LaunchB).
- Change how often the workflow runs (every 15 minutes for a flash campaign, hourly for a longer one).
- Add or remove columns in Airtable to track extra fields like language, country, or attached media.
Frequently asked questions
Does this capture every post, or just the popular ones?
How do I stop duplicate rows from showing up?
Can I track more than one hashtag at a time?
Will this pick up posts from private accounts?
How long does it keep running?
Stop spending Monday mornings copying tweets into a spreadsheet.
Connect TwitterAPI.io and Airtable once, and Geni logs every new campaign tweet every 30 minutes.