Back to Ayrshare in Google Sheets
SheetXAI logo
Ayrshare logo
Ayrshare · Google Sheets Guide

Pull Ayrshare Post History With Engagement Metrics Into a Google Sheet

2026-05-13
5 min read

The Scenario

You built the social reporting template six months ago. It worked fine when someone on the team ran it manually — open Ayrshare, grab the export, paste the rows, reformat the headers, done. That someone left the company in March. Now it's you, and you've inherited the process along with everything else on your plate.

The monthly content performance review is tomorrow at 10 AM. You need 90 days of post history — post text, platform, publish date, likes, shares, and impressions — in the sheet before you can build the summary charts that go into the slide deck.

The bad version:

  • Open Ayrshare, navigate to Analytics, set the date range, and export whatever CSV it offers — only to find the columns are in a different order than your sheet and the date format is a month/day/year string that Excel and Sheets both misread as text.
  • Spend 15 minutes reformatting the dates, renaming headers, and manually reordering columns so the data lands in the right place.
  • Repeat next month, because none of this cleanup has been automated — it's just a thing you do.

The real issue is not that it takes 30 minutes. It's that this is supposed to be analysis work, and instead you're doing data janitorial work that the person who built this template apparently never thought to document. Nobody hired you to wrangle CSV headers every four weeks.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Google Sheet. It connects to Ayrshare directly, pulls whatever data you describe, and writes it into your sheet in one pass — with the column names and order you specify.

Here is the prompt for this task:

Fetch the Ayrshare post history for the last 90 days and write post ID, platform, post text, publish date, likes, shares, and impressions into this sheet one row per post.

What You Get

  • One row per post, written into the sheet starting at row 2
  • Columns: Post ID, Platform, Post Text, Publish Date, Likes, Shares, Impressions — in that order, with those exact headers
  • Dates formatted as YYYY-MM-DD so your charts and date formulas read them correctly
  • Any posts that returned incomplete data flagged with a note in the row rather than silently dropped

What If the Data Is Not Quite Ready

The date range in the sheet doesn't match what came back

Sometimes "last 90 days" returns more or fewer posts than expected depending on how Ayrshare calculates the window. If you need a precise range:

Fetch all Ayrshare posts published between the dates in cells B1 and B2 and write post ID, platform, post text, published_at, likes, shares, and impressions into this sheet starting at row 2.

You only want posts from one platform

If your review covers Instagram performance specifically and you don't want every platform mixed into the same report:

Pull the last 90 days of Ayrshare post history for Instagram only and write post ID, post text, publish date, likes, comments, shares, and reach into columns A through H of this sheet.

Your sheet has a lookup table for platform display names

If column E in your existing sheet already uses a different naming convention — "IG" instead of "instagram," "LI" instead of "linkedin" — and your chart ranges depend on those values:

Fetch the Ayrshare post history for the last 90 days and write post ID, post text, and published_at into columns A through C. For column D, look up the platform value against the reference table in the 'Platforms' tab where column A is the Ayrshare platform name and column B is the display label, and write the display label.

Full cleanup and reporting in one shot

If the sheet is half-populated with stale data from last month and you want a clean pull with a summary row at the top:

Clear rows 2 through 500 in this sheet, fetch the Ayrshare post history for the last 90 days, write post ID, platform, post text, publish date, likes, shares, and impressions starting at row 2, then write the total likes and total impressions as a summary into cells B1 and C1.

The cleaner approach is to ask for the reset and the pull in the same prompt — one pass, one result to review.

Try It

Get the 7-day free trial of SheetXAI and open any Google Sheet with an Ayrshare reporting tab — even a blank one with just your column headers — then ask it to pull the last 90 days of post history. Also see: Bulk Delete Ayrshare Posts From a Google Sheet List and the Ayrshare integration overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more