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
-
A single metric to evaluate link quality?
We're using Moz and Ahrefs to monitor backlinks that we're getting to Siftery. Given that there are so many factors that affect the potential quality of a backlink - domain authority, page authority, context, anchor text, etc. - is there a single metric that attempts to quantify the value of a link? I realize that this would be an inexact science, but it would be a helpful view to get a quick directional sense of what are our most valuable backlinks (and be able to tie it to the campaigns that led to them, for example). If there's no "single metric" out there, are there heuristics that people have withstood the test of time? Thanks for your help!
Moz Pro | | ggiaco-siftery0 -
I cant generate my Mozscape API
I have tried to generate my Mozscape API numerous times after waiting at least 20 mins between. Any help would be great.
Moz Pro | | MLMLEADZONE1 -
We're back. THANK YOU SEOMoz!
To all the Mozzers reading this, I joined SEOMoz in a panic when we were seeing the first hints of an impending ranking crisis for our company website in October, 2012. We tanked in late December for our most important keywords. Simply GONE. Holy C---! It was devastating to say the least. Thankfully, we have a lot of work due to current clients and referrals, but the phone got quiet. That's a deadly sound.15 years of comfort zone gone. I still don't know precisely why it happened, it may have been a number of factors. But I've learned a huge amount through this crisis and can honestly say that I'm glad it happened. How weird is that? But what other fire under my butt would have gained me so much curiosity, fascination, engagement and excitement with deepening my scant knowledge? A week ago, we got our first report showing us that we have now gotten back our positions on page 1 for the 10 keywords that matter. It's continuing to improve according to today's report. So now that I've gotten somewhere- and I am well aware that it may not stick and there is still more to do -it's time to shout out a great big "Thank You". Truly, I don't think I could have survived this situation without SEOMoz and all you wonderful Mozers answering my frantic questions and lending your expertise and support to my situation. It wasn't only my own questions and the responses to those that helped me through this. I have been essentially addicted to reading a vast majority of all the posted questions because it's so dang interesting. So I've been learning bucketfuls from other people's questions and responses. My own personal SEOMoz education. It's only just begun. What an incredible culture and community we have here. I feel I can say "we" now because I am beginning to feel a part of it. And I'm not going anywhere anytime soon. I love this place. Thank you!
Moz Pro | | gfiedel11 -
404 errors in SEOMoz crawl tool
I currently have several 404 errors in the latest crawls from SEOMoz. Here is an example of the error. http://dealerplatform.com/blog/2011/10/23/videos-for-auto-dealers/www.dealerplatform.com/ In all cases the error is a result of www.dealerplatform.com being added to the real url. Anyone seen this before? The site is a wordpress mutlisite. I don't see where this incorrect link is showing up anywhere on the website. Any advice would be helpful. Thanks
Moz Pro | | Chris_Gregory0 -
Total number of links in OSE not clear to me.
I have compared 3 sites in open site explorer. The total # of links in the subdomain metrics report for one of the urls is 46,787. Where is that number coming from? There's 125 total external followed links and 132 total external links. I cannot see the number for internal links, but I'm sure it isn't 40000+. So 46,787 is the result of the addition of what? Thanks a lot for your help, and sorry for this newbie question 🙂
Moz Pro | | gerardoH0 -
SEOMOZ Competitive Domain Analysis
Hi, I am just trying to get to the bottom of why I am seeing such wildly different figures in the SEOMOZ link analysis. The SEO company that we use is saying that we have around 331 external links to our website, when I check on Yahoo site explorer, it returns 264 external links, but in my SEOMOZ campaign manager, it says I have 4 external links? I fully appreciate that none of these methods are going to be wholly accurate, and are going to produce different results, but I can't understand why the SEOMOZ results are so vastly different. I also know for a fact there are a number of Followed links that I have added to a couple of websites, that Google has now indexed (as they appear in search results), but don't appear in the campaign manager results. If SEOMOZ use a different method to assess an external link, then no problem - my main concern here is that as a Newbie I am doing something wrong within the SEOMOZ tools, and don't want to take action based on results that may be incorrect because I have set things up incorrectly? Any help is greatly appreciated. Many thanks, Gareth
Moz Pro | | gdavies090319770 -
What is the difference between the link count on OSE and Linkscape?
We notice a huge difference in the number of inbound links . Site explore shows 1,200 as an example and linkscape shows over 100,000 for the same site.
Moz Pro | | JamesBarry0