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
-
Finding Broken Links
My campaign report says I have a 404 error for a sub page located at domain/products/contact.aspx My contact page is not in the /products directory so what I'm wondering is if this means that somewhere on a site I have a link pointed to /products/contact.aspx. I've looked everywhere and cannot find the link if it is out there somewhere.
Moz Pro | | kadesmith0 -
Do SEOmoz private questions get answered?
I submitted a question on September 30 and never received a response. I then followed up on October 6 and had an exchange with the support staff, who first told me that the question would be answered and then a couple of days later told me that they had no record of the question. By chance, I had taken a screen shot showing confirmation that the question had been sent (just something I did to remind myself to follow up if I didn't get a response!), which I sent to them along with the question again. That was four days ago, and I've heard nothing since then - not even an automated email saying that the question was received. Is it common for it to take almost a month before a response is received, and to have to follow up multiple times just to get an answer?
Moz Pro | | csmm0 -
How often does SEOMoz refresh their link analysis data?
I know that my link profile has changed within the last month, yet both SEOMoz campaign link analysis and Open Site Explorer have shown the exact same number of links for more than a month. Majestic SEO fluctuates as I would expect, but Moz data is unchanged.
Moz Pro | | Aggie0 -
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 -
Reg. internal followed links
Our site is new. So far we have a 534 pages. Our competitors have around 5000. I'm working on building more, but that's a lot of catching up. The report says we have only 174 internal followed links. Why is that? I have all links set in the site to be nofollow links, but not the inside links. I also have lots of landing pages, which are not added to the main menu, obviously. But the the main menu shows up on all landing pages. Just wondering if either the nofollow has anything to do with it or the landing pages set up, or the numbers are accurate. Any ideas? Thanks!
Moz Pro | | FinanceSite0 -
How often do you update Link Analysis tool?
Wondering how often SEOMOZ updates their Link Analysis pages? I have had the same status for a month or so - although I know we have added links, etc.
Moz Pro | | findachristianjob0 -
API Key
I am a Pro user and I am trying to find a way to create an SEOmoz API key but cannot find how to do...
Moz Pro | | netbuilder0 -
What is domain linking and linking root domains?
Hey guys! I am proud to be a new SEOMOZ Pro member! I ran the report on my site and it says what I am primarily missing is domain linking.... What is this? it says I only have 3 of them for the specific term / subpage I am going after. In addition what does Linking Root Domains mean in my report? Thanks much!
Moz Pro | | shandaman1