Clicky

Steal Our SEO API Stack For Easy SEO Automation

If you’re looking to automate boring SEO tasks or create custom SEO reporting dashboards, APIs can be a major time-saver.

So, I asked our team for recommendations for a well-balanced SEO API stack that covers everything you’ll likely ever need.

I’m excited to share this list with you, so let’s get straight to it.

Ahrefs’ API gives you access to all kinds of useful, industry-leading SEO metrics and data, like:

  • Keyword data: Pull metrics like search volume or Keyword Difficulty (KD) for a keyword or lists of keywords, as well as the top 100 search results.
  • Backlink data: Pull metrics like referring domains and anchor text or programmatically discover the best pages by links for any domain.
  • Search performance data: Pull metrics like estimated organic traffic, Traffic Value, and paid search traffic. You can even pull a site’s best pages by traffic.

But lots of APIs offer this kind of data, right? So why use Ahrefs?

First, our API is powered by seriously big data. Our crawler is one of the most active on the web (it’s up there with Google’s and Bing’s crawlers) and discovers data about websites 24/7.

Second, our data is way more granular than the competition. For example, there are 77 response fields returned by our Backlinks endpoint vs. only 22 response fields in Semrush’s endpoint for the backlinks report type.

Third, our API is super easy to use. Just click our nifty API button in any report you want to export metrics from and instantly convert it into a cURL or URL API request:

Plus, our API is also really well documented, and you can get requests in multiple languages:

All the languages Ahrefs' SEO API delivers requests in.

Now, let’s look at how you can use other powerful APIs in tandem with Ahrefs in your SEO API stack.

IndexNow tells search engines when a change has been made on a website. If you add, update, remove, or redirect pages, participating search engines can pick up on the changes faster.

The good news is that many CMSs, CDNs, and web hosts already use IndexNow and automatically ping participating search engines anytime changes are made.

However, you can also use the free IndexNow API if you have some technical chops. Try these steps as shared by Bing if your website doesn’t already use IndexNow:

  1. Generate your free IndexNow API key
  2. Host the API key on your site’s root directory in txt format
  3. Submit your key location as a URL parameter
  4. Receive details on how many URLs have been discovered by participating search engines

If you haven’t already heard, we’ve also just dropped some seriously epic features by supporting IndexNow within Ahrefs. Check out Patrick’s update about it.

Here’s a quick snapshot of how IndexNow will work with Ahrefs:

How Ahrefs' real-time site audit will work with IndexNow.

By supporting IndexNow, we’ve created a win-win situation for both search engines and webmasters.

  • Webmasters can fix errors ASAP and ensure content is indexed by search engines faster and more reliably.
  • Search engines can reduce costs and environmental impact by strategically crawling pages only after changes are made.

Whether you use it through your CMS, CDN, or Ahrefs, IndexNow is the shortcut you’ve been looking for that gets your content indexed faster and more reliably.

Wayback Machine records visual snapshots of webpages over time and is very useful when evaluating the history of a website.

With its free Save Page Now 2 API, you can keep your own record of visual snapshots. These help to benchmark projects before you start work on them or automate snapshots being taken in order to maintain a visual history of key pages on your website.

Example of historical snapshot of Ahrefs' Backlink Checker page taken by Wayback machine.

Wayback Machine is your best option for automatically completing things like:

  • Analyzing the history of a list of expired domains
  • Automatically restoring the historical content on a website
  • Confirming past visual redesigns and reskins of a client’s or prospect’s website
  • Linking design changes to SEO performance changes
  • Documenting or benchmarking a webpage

There are also more nuanced and specific use cases to which you can apply the API, like automating some elements of competitive intelligence. For instance, you can see how competitors’ social profiles have grown, assess their websites’ historical visual or messaging changes, or check out A/B tests they’ve run.

Or you can use the Wayback CDX Server API and pull archived snapshots and body text to programmatically handle tasks like redirect mapping on large websites. Check out exactly how Patrick does this with his free redirect matching script.

Either way, there are some super cool Wayback Machine applications in your SEO API stack!

The Seach Console API allows you to pull data directly from Google Search Console (GSC) into any interface or dashboard you like. Its biggest advantage is overcoming the 16-month data storage limit within the GSC dashboard.

I recommend integrating the GSC API with your Ahrefs account. We’ll automatically store all your GSC data in Ahrefs’ Rank Tracker. From the moment you connect your account, you’ll have the last 16 months automatically imported, and then we’ll continue to add all future data so you can access it without limitations.

Ahrefs' integration with GSC store data beyond 16 months.

You can also access custom visualizations of your performance by device or click-through distributions…

Ahrefs delivers unique data visualizations and graphs using your GSC data.

… along with a quick-and-easy cannibalization report exclusively using your GSC data. In the Keywords report in Rank Tracker, check out all the URLs that rank for a specific keyword to identify any instances of cannibalization that might be hindering your site’s performance.

Ahrefs' Rank Tracker report showing how many URLs rank for a single keyword according to GSC.

Check out the documentation on getting started with the Search Console API. It’s free but subject to usage limits explained in the documentation. Otherwise, you can keep things easy by following the prompts within Ahrefs’ Rank Tracker to connect any project to your Google account:

How to connect your Google Account to Ahrefs.

Similar to the Search Console API, the Analytics Data API is from Google and gives you direct access to your website’s GA4 performance data.

With this data, you can better understand how people discover and use your website.

You can also use the Measurement Protocol for server-side tracking (instead of client-side) or to write data to your analytics from internet-connected devices, like a point-of-sale system. It’s also helpful in connecting online and offline events, measuring offline conversions, or capturing events on apps or devices where automatic collection isn’t available, like kiosks and watches.

The most common ways I’ve seen this API used is to:

  • Automate complex reporting for agency clients or internal stakeholders
  • Connect website usage data to metrics and KPIs reported in other business applications
  • Run batch reports with a single API call
  • Analyze and export audience metrics

I find that due to GA4’s flexibility, fewer people need to use the API to customize reports when they only want to look at different views of their GA4 data. However, if you want to connect this data with anything that’s not native to GA4, that’s where the API will most likely come in handy.

For example, you can use the API to pull GA4 organic conversion data that you can then use to build predictive lead-scoring models for your sales team to know which SEO leads are worth following up with and which are likely to be tire kickers.

Examples of lead scoring based on GA4 data.

No matter your use case, you can get started with this API for free, though it is also subject to some usage limits.

Google’s Natural Language API allows developers to gain insights from unstructured text using machine learning.

This API can do many different things. Unlike the other APIs listed so far, which you’d mainly use to pull specific types of data, this API can help you do more interesting things, like:

  • Analyzing the sentiment and predominant emotional opinion from text
  • Entity extraction and analysis from unstructured text
  • Analyzing syntax to quickly figure out what a piece of text is about
  • Tagging parts of speech in a body of text or list of keywords

These applications are very useful for reputation management, semantic SEO, competitive analysis, and also for automated content auditing processes.

You can also use the API to programmatically create website taxonomies based on known entities. For instance, say you have thousands of products for your ecommerce store and need to create tags and categories to organize these products. You can get a decent part of the job done with the help of the Natural Language API.

Check out the documentation for a more in-depth look at all its capabilities. It’s available on a freemium pricing model where you can get up to 5,000 credits for free each month.

OpenAI has a number of APIs with very versatile uses. The main benefit of adding OpenAI to your SEO API stack is that you can programmatically leverage generative AI technologies and prompt large language models in bulk.

These are incredibly useful for many SEO tasks, from obvious uses like creating content programmatically to analyzing, sorting, and categorizing bulk text or image-based data. Of course, with Google’s latest algorithm updates, you have to be careful not to go overboard with programmatic content that contributes to the internet’s existing spam problem.

Having said that, the sky is the limit with such a versatile set of APIs, but here are some interesting examples of how they can be handy for SEO projects.

You can use chain prompting to automate various SEO tasks, from digital PR to article outline generation. Check out Kristin Tynski’s scripts for ideas on how to get started.

Or, you can build a custom ChatBot for your blog content using the embedding model. Flow SEO did this on their blog.

How Flow SEO uses GPT-3 to create a chatbot trained on it's blog content.

Another of my favorite examples is sorting, tagging, and classifying images in bulk for large ecommerce stores or marketplaces using GPT-4.

Visual representation of tagging and classifying ecommerce images with GPT-4

All of OpenAI’s models are paid and based on usage. Despite this, it’s still worth considering OpenAI for your SEO API tech stack, as you can help automate a great variety of SEO tasks.

PageSpeed Insights API helps monitor desktop and mobile performance metrics like Core Web Vitals, lighthouse metrics, and mobile issues.

You can pull these metrics to assess issues or potential website improvements:

  • Field data from CrUX
  • Lab data from the Lighthouse test
  • Bulk page-level core web vitals data

However, instead of querying the data yourself, you can connect PageSpeed insights to Ahrefs’ Site Audit tool to do the heavy lifting for you. We have multiple graphs in the Performance reports that can help you drill deeper into your pages.

Data from PageSpeed Insights in Performance report, via Ahrefs' Site Audit

Another advantage to connecting the PSI API to your Ahrefs account is that you can automatically receive alerts if recent website changes affect performance.

For example, with the combination of IndexNow + PageSpeed Insights + Ahrefs Alerts, you can set up a workflow that looks a bit like this:

The workflow between Ahrefs' Site Audit, PageSpeed Insights API and IndexNow.

This is a very powerful workflow that only Ahrefs can help you automate compared to other SEO tools, and it is largely thanks to our integration of IndexNow.

Final thoughts

With the right SEO API stack, the possibilities for how you can automate SEO strategy, auditing, and reporting are endless.

With Ahrefs in your corner, you can unlock some seriously cool functionalities that no other tool offers, especially now that we use IndexNow’s capabilities to offer constant crawling and automated performance updates following any website change.

Chat with our enterprise team if you’d like more info on how Ahrefs can be your competitive edge when it comes to SEO data or automating your SEO strategy.