Automated Majestic Backlink Data in Google Sheets

Automated Majestic Backlink Data in Google Sheets


We use a variety tools to monitor backlink health, but I’ve always been drawn to the simplicity of Majestic SEO. Better still, Majestic’s API is fairly easy to incorporate into a Google Script – making automated data pulls a snap.

If you want to pull Majestic data directly into a Google Sheet, here’s how – but first, you need to have the appropriate API account. Details on that are available here.

Once you have your API code, create a new spreadsheet with a tab called “MajesticData”. Now open Google Scripts (Tools > Script Editor) and plunk down this bit of code:

Next, we need to tweak the URL variable in the second line of code. Replace “APIKEY” with your organization’s API key (obvious) and replace “DOMAIN” with the domain you want information on (doubly obvious). Once that’s done, run the script and grant any necessary permissions.

The script will return the raw JSON response, parse it and extract four data points: external backlinks, referring domains, Trust Flow and Citation Flow. This information is then appended to your “MajesticData” tab and sorted by newest first.

If you want the script to run at regular intervals, it’s easy to set up a trigger. While in the Script Editor, click “Resources” > “Current Project Triggers”, select the “majestic” function and set a time for the script to run. The nice thing about the appendRow method is that you’re never deleting any data – anytime the script runs, the new data just gets added to the existing information.

It’s worth noting that Majestic’s API can produce a host of different data points. This particular script calls the GetIndexItemInfo function, which includes other metrics such as last crawl date, referring IPs and subnets, redirects – most anything you can find in the web-based Majestic interface. There are quite a few other commands for retrieving different types of data – you can find a complete list on Majestic’s site.

What to do with all this data? That, my friends, is entirely up to you (within Majestic’s terms of service, of course). I use this script to check backlinks across our individual clients and ping the appropriate analysts when needed.

If you come up with a clever use for Majestic’s API, feel free to let us know!

Your law firm is the next growth story

Explore all the case studies

Ready to learn how we'd help your law firm?

Check out the latest episode from
the Sterling Family Law Show Podcast

Listen to all the past episodes

Get the Book that Explains the Strategy

The Waterfall Method: A Growth Model for Family Law Firms

Build a firm that runs on clarity, not chaos. In The Waterfall Method, Anthony Karls hands you the metric-by-metric playbook to turn leads into predictable revenue and scale with confidence. Grab your copy and start compounding wins today.

Get all the recent news from the blog

Read 1,000s of articles from the experts

Meeting your law firm where you are

Get Started Today—No Strings Attached

Our Family Law Quick Audit is your opportunity to uncover hidden revenue in your law firm’s digital marketing and operational processes. There’s no obligation, and you’ll receive actionable insights that you can implement however you choose.

Meet the people behind the growth

Clients we've helped grow

Empowering Business Growth Online

Fill out the form below or call 262-437-2334

What Our Clients Have to Say

Facebook Certified Planning Professional
Bing Partner