Print

Import Moz Data to Google Sheets

In this guide, we’ll walk through how to pull data from the Moz API directly into Google Sheets, using the API Connector add-on for Sheets.

For this guide we'll show how to use their free API plan, but you can of course use their paid plans if you have access. We'll first get our Moz API credentials, and then set up a request to pull in data to your spreadsheet.

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Get Your Moz API Key

  1. If you haven't already, log into Moz.com
  2. Click Products > Moz Links API > Get Connected, or navigate directly to https://moz.com/products/api/pricing
  3. Click the Try it free! link. The free plan allows for one request every ten seconds, up to 2,500 rows per month.
    moz-tryfree
  4. On the next page you'll need to enter your credit card details, even if you don't plan to upgrade. You won't be charged unless you upgrade to a paid account.
  5. Proceed through their payment form, accept their terms and conditions, and click Sign Up
    moz-signup
  6. You'll now be presented with your credentials.

  7. To encode your token, enter your credentials in the format access_id:secret_key into this form (i.e. your access ID, then a colon, and then your secret key).

    The encoding script runs in your browser, and none of your credentials are seen or stored by this site.

     

Part 2: Pull Moz API Data into Sheets

You can create a request using any of the endpoints and parameters described in Moz's API documentation. For this example we'll get a list of Top pages on a target domain. Substitute your encoded credentials from above where it says your_encoded_credentials.

  1. Open up Google Sheets and click Extensions > API Connector > Open > Create request.
  2. The MOZ API top pages endpoint requires constructing a request body containing all the filters and conditions of your request. So, in this example we will use "target", "scope" and "limit" in our request body
    • { "target": "moz.com", "scope": "root_domain", "limit": 1 }
  3. In the request form enter the following:
    • Application: Custom
    • Method: POST
    • Request URL: https://lsapi.seomoz.com/v2/top_pages
    • Headers:
      • AuthorizationBasic your_encoded_credentials
    • Request body:  { "target": "moz.com", "scope": "root_domain", "limit": 20 }


  4. Create a new tab and click Set current to use that tab as your data destination.
  5. Name your request and click Run. A moment later you’ll see Coda data populate your sheet.

Part 3: More Example API URLS

  1. Anchor Text
    • Method: POST
    • Request URL: https://lsapi.seomoz.com/v2/anchor_text
    • Request body: {"target": "string", "scope": "string", "limit": number, "next_token: "string"}
  2. URL Metrics
    • Method: POST
    • Request URL: https://lsapi.seomoz.com/v2/url_metrics
    • Request body: {"targets": ["string"], "daily_history_deltas": ["string"], "daily_history_values": ["string"], "monthly_history_deltas": ["string"], "monthly_history_values": ["string"], "distributions": boolean}
  3. For other example of requests that can be made, do check the official Moz API documentation

Part 5: API Documentation

Official API documentationhttps://moz.com/help/links-api

Leave a Comment

Jump To