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
-
Competitors links increasing rapidly
Hi there, I have 3 main competitors who I keep my eye on within Moz and I am always comparing pages as they are all sell similar products in the same way but we're increasingly getting more things put in place to make ourselves different, which is why we rank number 1 in the UK for their competitive keywords (without blowing my own trumpet!). One thing I have noticed, a competitor seems to be doing things the old school way. He has around 15 competitive keywords in his pages meta tag (irrelevant) and then has a huge 400 - 500 word description on each page describing whats on the page, what products are in that category (if it's a category page) or localised information if it's a company page. What seems to be odd, is that before penguin/panda their website had around 1,200,000 total links. Then after panda, he went down to around 300,000 total links. In the past few weeks I've noticed that he has gradually increased in total links from 300,000(estimate) to now 961,811 total links in a matter of weeks. Is this an error/glitch within Moz or is he doing something that may be classed as "blackhat" or is it something I shouldn't really be worrying about? Any feedback appreciated 🙂 Tom
Moz Pro | | tomhall900 -
SEOmoz campaign - keyword rankings...
Hi there, I have a quick question: Does it make a difference if I add keywords to a campaign with the '[' and ']' brackets included? I just realized that I had copy/pasted many of my keywords from the exported CSV from the Google AdWords Keyword Tool and I fear that the keyword rankings on SEOmoz might factor the brackets as part of the keywords themselves. Thanks in advance! Ben
Moz Pro | | BenHammer0 -
Competitive Link Analysis Tool?
Hi, I ran a competitive link analysis report today and back came quite a few domains that 2 or more of my 5 main competitors link from. Is it worth me submitting links to these sites? And would i be best served submitting my homepage URL or submitting a brand page such as Creative Recreation Trainers? I want to target that brand but don't want to do it if my main URL is better? Any ideas? See below my report. | Subdomain | Subdomain mR | Subdomain mT | # Competitors | # Linking Pages | Link Acquired |
Moz Pro | | YNWA
| t.co/ | 8.05 | 8.04 | 2 | <a>2</a> | |
| ww2.cox.com/ | 5.99 | 6.50 | 2 | <a>3</a> | |
| www.littlewebdirectory.com/ | 5.90 | 5.59 | 2 | <a>2</a> | |
| www.amazines.com/ | 5.69 | 5.66 | 2 | <a>3</a> | |
| svpply.com/ | 5.66 | 5.53 | 3 | <a>20</a> | |
| www.jayde.com/ | 5.64 | 5.68 | 3 | <a>4</a> | |
| www.pearltrees.com/ | 5.58 | 5.81 | 2 | <a>2</a> | |
| www.businessseek.biz/ | 5.52 | 5.51 | 2 | <a>3</a> | |
| www.a1articles.com/ | 5.50 | 5.22 | 3 | <a>9</a> | |
| www.linksilo.de/ | 5.48 | 5.23 | 2 | <a>15</a> | |
| www.alistsites.com/ | 5.46 | 5.24 | 2 | <a>38</a> | |
| www.the-free-directory.co.uk/ | 5.37 | 5.07 | 2 | <a>20</a> | |
| www.walhello.com/ | 5.30 | 4.97 | 2 | <a>2</a> | |
| www.quarkbase.com/ | 5.14 | 5.12 | 2 | <a>2</a> | |
| snipsly.com/ | 5.13 | 5.20 | 2 | <a>21</a> | |
| www.counterdeal.com/ | 5.12 | 5.07 | 2 | <a>2</a> | |
| www.01webdirectory.com/ | 5.03 | 5.03 | 2 | <a>2</a> | |
| www.2addlink.info/ | 4.92 | 4.58 | 3 | <a>4</a> | |
| www.fuk.co.uk/ | 4.64 | 5.00 | 3 | <a>20</a> | |
| www.final-fantasy.us/ | 4.63 | 4.77 | 2 | <a>2</a> | |
| oyax.com/ | 4.42 | 4.61 | 2 | <a>4</a> | |
| www.touchretail.co.uk/ | 4.33 | 4.21 | 2 | <a>4</a> | |
| tptbtv.cold10.com/ | 4.27 | 4.86 | 3 | <a>1</a> | |
| www.mastbusiness.com/ | 4.23 | 4.34 | 2 | <a>2</a> | |
| www.competitionhunter.com/ | 4.16 | 4.21 | 2 | <a>6</a> | |0 -
SEOmoz bot and "noindex"
As a recent newbie to SEOmoz, I've been implementing some suggestions and doing a general tidy up. I removed URL's from our robots txt, and rolled out instead the noindex meta tag to pages we don't want indexed. But surprised to see issues that are now flagged from the last crawl by the moz bot from pages that have this meta tag? Does the SEOmoz bot not ignore this tag? Just want to make sure I've implemented it correctly, so the google bot does ignore it. Meta tag syntax is and is placed below the title tag. cheers Steve
Moz Pro | | sjr4x40 -
Why doesn't the BBB / Trustlink.org links show up in the Link Analysis?
I am curious why one of my client's main competitors (www.allbayhardwood.com) shows links from the Better Business Bureau and Trustlink.org (associated with BBB) but links from those sources do not show up for his domain (www.sanjosehardwoodfloors.com). He has been a BBB Acredited Business since 12/2010 and on file with them for probably as long as they have had the online version, which seems like plenty of time for the link to have been picked up. BBB has a very nice domain authority and it would be great to see these links show up. (they don't show up in webmaster tools either) Is there something I am missing? Thanks in advance guys and gals! (I know the site has other SEO issues - just getting started on pounding everything out.)
Moz Pro | | SnoBaer0 -
How often does SEOmoz reports get refreshed?
Is there a way I can refresh the reports manually instead of waiting for it to pull the updated data?
Moz Pro | | RBA0 -
What's Your SEOmoz Favorite?
Obviously, SEOmoz is full of awesomeness. But I'm curious as to what sections, tools, etc. of SEOmoz are the users' favorites? For me, it's a close race between the blog, Linkscape/Open Site Explorer, and the search overlay tool on the Mozbar. What are your favorites?
Moz Pro | | Gyi0 -
Internal Links
Hi Just wondering if anyone can shed some light on the internal links metric in the Linkscape report. I have run the report for a number of sites that I know have internal links in them but often get the result of just 1 internal link when I run the Linkscape report and I am not sure why Thanks
Moz Pro | | UE-Web0