Rapid Protoyping with the SEOmoz API

I am out in Seattle for the SEOmoz PRO seminar (don’t forget to come to the London seminar!) where the second day has kicked off with two of the best presentations I’ve seen in a long time from Seth Besmertnik from Conductor and Wil Reynolds from Seer Interactive. Feeling the pressure a little bit for my session on Sexy Reporting this afternoon, I thought I’d share one extra tip.

I often need to build a quick n’ dirty bit of analysis of link data. Since the exports from Open Site Explorer only pull 10,000 links at a time, I look to pull data out of the SEOmoz API and dump it into Excel.

This little bash script (which needs the domain and credentials inputting) lets you quickly pull backlink data:

( for i in {1..250}; do curl “http://lsapi1.seomoz.com/linkscape/links/XXXXXXXXXXX?Filter=external&SourceCols=133982846973&TargetCols=133982846973&Sort=page_authority&AccessID=XXXXXXXXXXX&Expires=XXXXXXXXXXX&Signature=XXXXXXXXXXX&Scope=page_to_domain&Limit=5&Offset=$((i100))&”; done ) | tr “}” “n” | perl -pe “s/[][]//g” | perl -pe “s/,{//g” | perl -pe “s/”[^“]”://g“ | perl -pe ”s/^{//g“ >> output.csv

I’ll be talking a little bit about doing stuff with this in my presentation later today, including decoding bitflags in Excel.

If you like the presentations from the Distilled crew, you might like to sign up to our free conference calls.

About the author
Will Critchlow

Will Critchlow

Will founded Distilled with Duncan in 2005. Since then, he has consulted with some of the world’s largest organisations and most famous websites, spoken at most major industry events and regularly appeared in local and national press. For the...   read more