How do I collect all links through the SEOMoz API?
-
How do I collect all links through the SEOMoz API?
Yes, I know how to pull url metrics info but want to pull the inbound links only via php script w/out having to go to the OSE page to pull.
any suggestions would be great!
-
hey got it workin, I sent u a private message with a Q for a sort.
cheers!
-
No problem, feel free to send me a private message if you need help with the code.
-
thanks Casey, let me have a run and let you know.
cheers!
-
Please check out the authentication wiki page: http://apiwiki.seomoz.org/w/page/29574176/SignedAuthentication
$objectURL = $domain_url;$accessID = "member-XXXXXXXXXXX";
$secretKey = "XXXXXXXXXXXXXXX";
$expires = mktime() + 300;
// The request is good for the next 5 minutes, or 300 seconds from now.
$stringToSign = $accessID."\n".$expires;
// Get the "raw" or binary output of the hmac hash.
$binarySignature = hash_hmac('sha1', $stringToSign, $secretKey, true);
// We need to base64-encode it and then url-encode that.
$urlSafeSignature = urlencode(base64_encode($binarySignature));
// You don't have to use fopen and can't in some scenarios. CURL is a better choice for production.
$handle = fopen($urlToFetch, "r");$links_contents = ''; while (!feof($handle)) { $links_contents .= fread($handle, 8192);} fclose($handle);
echo $links_contents;
?>
Here is how we are pulling it in. Replace $accessID with your API code, you can sort and filter through the different link calls. Replace "Limit" with however much you want to pull in. The code will return a json response, from there you can parse the data however you want.
I hope that helps!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Old links that need to be removed
We are having a problem trying to get rid of old links that have been removed from a website that no longer exists. See links below-There are several more that we need to deal with. We have tried putting them into Google Search Console, but they keep reappearing with Moz. Since our new website is hosted on Hubspot now and not on WordPress, which these links are referring to, we are trying to determine how to remove them from being indexed since they don't exist anymore? http://intouch-marketing.com/wp-content/uploads/2015/03/mas.png
Moz Pro | | InTouchMK
19 Redirect to 4xx http://intouch-marketing.com/wp-content/uploads/2014/03/TWITTER-HASHTAG.jpg
19 Redirect to 4xx http://intouch-marketing.com/wp-content/uploads/2016/04/Tweet-Activity-analytics-for-DCuevasIM-November-January.png
19 Redirect to 4xx0 -
I have a site that is showing Internal 0 Equity-Passing Links, 0 Internal links, and every page bar the homepage has a PageAuthority of 0\. Any suggestions on why this could be?
The website has been around for several years, although did undergo a significant redesign at the end of last year. I greatly appreciate any help.
Moz Pro | | embracedarrenhughes0 -
Total External Links
Hi There, I'm looking at my link profile and my Total External Links dropped uber dramatically back in April. Any way to figure out what the heck happened? My only idea is that this was around the time we launched a new version of the website but I'm not sure it corresponds exactly and anyway the domain didn't change. Possibly some urls did but all have been redirected. Any ideas? Thanks, site is www.nationalpardon.org
Moz Pro | | NationalPardon0 -
SEOMoz On-Page Report Card
This question is for one of the SEOMoz staff. With the ongoing changes and improvement in algorithms, does the SEOMoz team keep the "On-page Report Card" up to date with best practices?
Moz Pro | | tdawson090 -
Changing linked analytics account
When setting up a new campaign, I attempted to add GA. I entered the wrong GA account to this profile. How do I change the GA profile that is linked to this campaign?
Moz Pro | | sgavin0 -
SEOMoz Crawling Only 1 Page
I entered a new site into my dashboard 2 days ago - everything looked kosher, there were a few hundred pages crawled and a whole bunch of errors. I came back this morning to start work on the site and SEOMoz has crawled the site again, this time returning only 1 page and 0 errors. I haven't even logged in to the site since the first crawl, so I couldn't have broken anything. Has anyone seen this before?
Moz Pro | | Junction0 -
How are our competitors getting these inbound linking domains?
I'm currently managing SEO for my company's website, and I'm getting into link building for the first time. As part of the process, I'm using Open Site Explorer to see who's linking into our competitor sites, to get a better sense of what's available to us in our particular avenue of e-commerce. However, I'm finding that our competitors are getting inbound links from high-authority sites pretty far afield from selling jewelry - census.gov, parallels.com, warnerbros.com, and others. I try clicking through to these links, but each link starts a download of a file. I've seen .f4v, .7z, and .apk files listed as inbound links to our competitor. How is this happening? Again, I'm new to link building, so there may be a simple answer here, and if so I apologize for asking. However, this seems really strange to me, and a difficult situation to confront.
Moz Pro | | jozaksut0 -
SEOmoz application suggestion
I would like to suggest the ranking changes be broken into two categories, You and Competition, right now it seems everything is lumped in together... Screen shot attached. Thanks. A24tp.jpg
Moz Pro | | CouponCactus0