The Scenario
A client meeting is Friday. Your job this week is to put together an income analysis for their eight dividend-paying holdings — specifically, how much each stock has paid out over the past five years, whether the dividend has been growing, and what the current yield looks like against their cost basis.
You have the tickers in column A of a Google Sheet. You have a Marketstack API key. What you do not have is the dividend history, because pulling it means calling a different endpoint for each ticker, parsing a different response shape than OHLCV, and assembling the records into a usable table before you can even start the analysis.
The bad version:
- Open Marketstack's dividend endpoint documentation, construct the URL for the first ticker, call it, and inspect the JSON response to figure out which fields are the ex-dividend date, the dividend amount, and the payment date
- Copy the records into the sheet one by one — realizing partway through that the API returns them in reverse chronological order and your table is going to need a sort pass
- Repeat for the remaining seven tickers, then discover that two of them have 60+ dividend records and you have been manually pasting for 45 minutes and are only halfway through
The client presentation is not about data entry. The data entry is what is standing between you and the actual work.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Google Sheet. It reads the ticker list in column A and through its Marketstack integration it can pull the full dividend payment history for every holding and write it into the sheet in a usable format.
For each ticker in column A, fetch all available dividend data from Marketstack and write ex-dividend date, dividend amount, and payment date into a new tab per ticker, sorted by date ascending
What You Get
- A new tab for each ticker, named after the symbol
- Three columns: Ex-Dividend Date, Dividend Amount, Payment Date
- Records sorted oldest to newest so growth trends are immediately visible
- Any ticker with no dividend history gets a tab noting that no dividend records were found
What If the Data Is Not Quite Ready
You only want the last 5 years of dividends
For each ticker in column A, fetch all dividends from Marketstack from January 2021 through today and write ex-dividend date, dividend amount, and payment date into a new tab per ticker
You want everything in a single combined table instead of per-ticker tabs
Pull all dividend records for every ticker in column A from Marketstack and write them into a single sheet called Dividend History with columns for ticker, ex-dividend date, dividend amount, and payment date — sorted by ticker and then by date
Some tickers are ADRs and you want the currency flagged
For each ticker in column A, fetch dividend history from Marketstack and write ex-dividend date, amount, and payment date into a per-ticker tab — add a column for currency so I can see which dividends are in USD versus a foreign currency
Full pipeline: pull dividends, calculate annualized yield per year, write summary
For each ticker in column A, fetch all dividends from Marketstack from 2020 through today, write them into a per-ticker tab, then build a Summary tab showing each ticker's total dividend paid per calendar year from 2020 to 2025
Doing the data pull and the annual aggregation in the same prompt means the summary table is ready to share, not a second task you still have to schedule.
Try It
Get the 7-day free trial of SheetXAI and open the sheet with your income holdings in column A, then ask it to pull the full dividend history from Marketstack for every ticker. The Marketstack integration is included in every SheetXAI plan.
See also: building an adjusted total-return series and refreshing a watchlist with latest prices.
