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 -
SEOMoz Ranking section only showing my Homepage
My competition has a few pages showing for each term, but only my homepage shows for those terms. My SEO shouldn't be so bad that no inner pages show. What's happening? Do I have something set up incorrectly?
Moz Pro | | Ocularis0 -
Difference between Webmaster and SEOMoz back-link stats?
Hi there, I just noticed that there are differences between the links to my site showing on my Google Webmaster account and what is showing on my link analysis on SEOMoz. Has anyone noticed this? In webmaster I am showing 857 links to my site from 92 different domains. In SEOMoz I am showing 816 links to my site from 53 total linking root domains and only 39 followed domains? Does anyone know why this there is a difference? Are the links showing in Webmaster all indexed and followed links? Thanks in advance 🙂 Karl
Moz Pro | | onlineexpression0 -
SEOMoz Keyword Limit
I am trying to add keywords to my SEOMoz campaign and it says I have reached my 300 KW limit eventhough I have only added 1 word! Any suggestions? uwt2V
Moz Pro | | theLotter0 -
OpenSiteExplorer is not seeing all my inbound links
I know I have back links to my site from about 5 or 6 websites and most of them even show in my Google webmaster account but according to OSE I only have 1 inbound link. Is it normal for the OSE stats to be wrong? I really want to use it but am worried the info isn't going to be accurate.
Moz Pro | | JasonHegarty0 -
Seomoz Toolbar - Mozilla 6.0
Hi there, when will the toolbar be compatible with Mozilla 6.0? Thank you for your feedback. BR, Ive
Moz Pro | | NeroSolutions0 -
Competitive link finder not working
Hi guys, I just wanted to check the status of the Competitive Link Finder. I've been trying to use it for well over a week, literally trying it every day and every single time I get the "we may be a little busy" message. Are there any plans to upgrade it? I realise its a labs tool, but its actually a really useful tool which I just don't seem to be able to benefit from whatsoever. Would love to hear what the plans for this tool are. Thanks Al
Moz Pro | | dotcentric0 -
How do I get a list of my non-followed links
Our site has a lot of non-followed links showing up on the latest SEOMoz Competitive Link Analysis update and I would like to know how to get a list of the sites that aresettin no-follow.
Moz Pro | | oznappies0