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
-
What SeoMoz tool am I thinking of?
A few months ago I found a tool on Moz that did keyword link research. It is not keyword analysis either. It took a word and turned it into links such as dir:cabinet. I can't find it or remember or it. Does anyone else know? (I know this description sucks, sorry about that)
Moz Pro | | EcommerceSite0 -
Is seomoz rogerbot only crawling the subdomains by links or as well by id?
I´m new at seomoz and just set up a first campaign. After the first crawling i got quite a few 404 errors due to deleted (spammy) forum threads. I was sure there are no links to these deleted threads so my question is weather the seomoz rogerbot is only crawling my subdomains by links or as well by ids (the forum thread ids are serially numbered from 1 to x). If the rogerbot crawls as well serially numbered ids do i have to be concerned by the 404 error on behalf of the googlebot as well?
Moz Pro | | sauspiel0 -
Compare link metrics - What time frame is this in?
Hi, I'm comparing three sites and one of them I know is quite popular however a few of the social statistics are puzzling me; they've got a small amount of Facebook likes and times shared on twitter - Which just can't be right if it's all time. What's the time frame of this data? The last three months or? Thanks, Dan
Moz Pro | | Sparkstone0 -
Archiving Campaigns in SEOmoz
First off, I love the campaign archive feature. Very useful for my purposes. My question is: Is there a limit to how many campaigns I can archive? Thanks in advance!
Moz Pro | | CollinJarman0 -
Competitive Link Finder
Hi, just wondering if I am the only one who is not having much luck lately using the Competitive Link Finder . In the past it has worked pretty well. But as of the past week or so, it has only returned on link. I know there are many of them which should be found. Anyway, just curious if I am solo with this issue.
Moz Pro | | APICDA0 -
SEOMOZ can we trust you?
I was thinking today what are the chances that SEOMOZ can look into my campaigns and see what keywords I am targeting, strategies etc. and then sell that information to others? There has to be some type of clause when you sign up correct? But who knows because I'm not sure. Having Rand and Matt Curts talking via twitter to each other kind of concerns me. Not that I'm worried that Google will know my strategies because we don't do any black-hat linking and anything shady but how much power does SEOMOZ really have and can they leak any information to other companies or Google? Scary stuff that's why I don't put all my eggs into one basket, I spread them out. Thoughts? Thanks in advance - Brett Shaffer
Moz Pro | | EmpireSEO1 -
Gained Links but MozRank drops. Why?
I'm working with a client whose external followed links rose from 897 to 2792 in about a month. However the client's domain MozRank dropped from 4.52 to 3.82. What is a possible cause for this drop?
Moz Pro | | Fueled0 -
Need a Google Doc That Imports List of Links From SEOMoz API
Does anyone have one they'd like to share. I've seen the great ones by Tom Anthony but I am looking for the list of the first 1000 links that are available as part of the free API to be brought back into a Google Doc.
Moz Pro | | belasco0