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!
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
-
I see some links on Youtube.com that look like they are "Do-follow" links am I wrong?
Hi, I have some videos on YouTube.com and I notice many of the links show as "Do-Follow" per the Moz Bar. I have a feeling they are not actually "Dofollow" links because they never show up in Moz Pro, SemRush or any of my other tools. Can some of you people with greater knowledge of YouTube please clarify why the links look like "Do Follow". I am specifically thinking of my own backlinks on the videos and also the links in the "Comments". Best Regards, Bill Dalessi
Moz Pro | | Dalessi0 -
Replacement for Juicy link finder?
Hi, Juicy link finder was really handy to help uncover websites, what is the alternative tool/s people would recommend? Thanks Simon
Moz Pro | | simonsw0 -
Total number of outbound external links?
Hi Mozzers, Is anyone aware of a tool that will tell me how many outbound external links there are on my website? Basically, I have a theory that our website is littered with links to other websites, but need to know the approximate figure. As far as I can tell, none of the Moz tools tell me this? Any help appreciated! Cheers Matt
Moz Pro | | Horizon0 -
How to get the total external links to a page and total external links to the domain using Mozscape API? I could not see an option in the bit flags
Hi, I was trying to get the data for total external links to a page and total external links to the domain using Mozscape API but I can't see a bit flag which can do that. There are bit flags for external followed links to a page and external followed links to a domain but I wanted the total external links data, is there a way to do that using Mozscape API else I would end up copying the data manually from OSE which would be cumbersome and time consuming. Your help is highly appreciated.
Moz Pro | | HQP0 -
Why is Followed Linking Root Domains higher than External Followed Links?
Surely there must be at least one external link for each linking root domain? Some results for smaller sites give a higher number of domains linking in than incoming links - e.g. www.forbesandsawyer.co.uk Under Subdomain metrics: External Followed Links - 1 Followed Linking Root Domains - 2 Surely 2 root domains would mean AT LEAST 2 external followed links? Thanks, Andrew
Moz Pro | | Silktide0 -
Duplicate page error from SEOmoz
SEOmoz's Crawl Diagnostics is complaining about a duplicate page error. I'm trying to use a rel=canonical but maybe I'm not doing it right. This page is the original, definitive version of the content: https://www.borntosell.com/covered-call-newsletter/sent-2011-10-01 This page is an alias that points to it (each month the alias is changed to point to the then current issue): https://www.borntosell.com/covered-call-newsletter/latest-issue The alias page above contains this tag (which is also updated each month when a new issue comes out) in the section: Is that not correct? Is the https (vs http) messing something up? Thanks!
Moz Pro | | scanlin0 -
What is the best way to analyze all of the outgoing links from a website to determine which links are not beneficial?
I've recently been tasked with the SEO on an old site that was ranking somewhere on page two for desirable keyword phrases. The site was taken completely offline for a few months and started ranking on page one for the same desirable keyword phrases. The site has a lot of link partners and I think that some of the links from the site are going to undesirable pages and I'm looking for the best way to get rid of the links that are hurting the sites rankings.
Moz Pro | | kerrick-955310