Moz builds tools that make SEO, inbound marketing, link building, and content marketing easy. We can use the Moz API to import data from Moz into Google Sheets. In this tutorial, we’ll show you how to connect the Moz REST API to Google Sheets in 5 steps:
Apipheny is a free API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to API data sources, easily.
1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install
2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.
In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.
Tip: you can open a new Google Sheet by entering this URL in your browser:
Next login to your Moz account. In your API Dashboard, your Access ID and Secret Key will be displayed:
Copy these to a safe location, because you’ll need them later.
In this section, we’ll show you how to browse the Moz API documentation to find the endpoint which retrieves the information you need from your account. If you already know your API URL, or if you want to use the same example URL as us, just skip to Step 4.
First, open the Moz API documentation page: https://moz.com/help/links-api
The menu on the left contains the Links API menu.
If we click the Making Calls With Links API V2 item, the endpoints list will be displayed:
An example endpoint is Final Redirect, which returns the final redirect target of a page after following known redirects in the index. If no redirects are known, it returns an empty response. The is the API URL of that endpoint:
The endpoint’s documentation contains a short description of the endpoint’s purpose, its URI, request syntax, example JSON request, the request parameters, example HTTP request, its HTTP method (POST), example cURL request and example Python request:
All API calls to the Moz API should be made with this base URL: https://lsapi.seomoz.com/v2/
Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the Import tab. With the Import tab open, enter these details into the add-on:
API URL: In Step 2, we explained how you can find the Moz REST API endpoint that you need. Now copy and paste your complete Moz API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).
For this example, we are using the Index Metadata endpoint, which returns an id that changes when the data in the index changes. This is what the whole URL looks like:
Headers: In the Headers section of Apipheny, add one row with the following key and value:
Key: Authorization Value: Basic encoded_string
When entering the header value, replace encoded_string with the Base64-encoded version of your Access ID and Secret Key. You can use https://www.base64encode.org/ to encode your access_id:secret_key string. Just enter your access id and secret key like this “access_id:secret_key” and then click “Encode”. More info about Base64 encoding.
Here’s what our Moz API request looks like in Apipheny:
Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Moz API data to be imported into your Google Sheet. Here’s what our request looked like when completed:
After making a successful request to the Moz API, try querying a different Moz API endpoint, or try using one of the more advanced features in the Apipheny add-on.
Crypto API Tutorials: