Finding inlink information from Yahoo! in Python
Inlinks (aka backlinks) are an important aspect of your SEO strategy. They are the ways that people will find your website and they are an indicator to search engines that your website is important and should rank well. So it is important to keep an eye on this statistic for your website. There is a saying: “you can’t manage what you can’t measure” which applies. If you want your website to rank well you need to manage your inlinks and so you need to measure them.
This script requires a Yahoo! AppID because it uses the REST API for Yahoo! Site Explorer rather than any scraping of pages which you can get by going to the Yahoo! Developer Network.
The script simply returns the total number of results but you could easily extend this to print out all your inlinks. I will be using this to track my inlink count over time by running it every day and storing the result in a database.
Example Usage:
$ python yahooInlinks.py http://www.halotis.com checking http://www.halotis.com 937
Here’s the Python Code:
#!/usr/bin/env python # -*- coding: utf-8 -*- # (C) 2009 HalOtis Marketing # written by Matt Warren # http://halotis.com/ import urllib2, sys, urllib try: import json except: import simplejson as json # http://undefined.org/python/#simplejson YAHOO_APP_ID='YOUR API KEY' def yahoo_inlinks_count(query): if not query.startswith('http://') raise Exception('site must start with "http://"') request = 'http://search.yahooapis.com/SiteExplorerService/V1/inlinkData?appid=' + YAHOO_APP_ID + '&query=' + urllib.quote_plus(query) + '&output=json&results=0' try: results = json.load(urllib2.urlopen(request)) except: raise Exception("Web services request failed") sys.exit() return results['ResultSet']['totalResultsAvailable'] if __name__=='__main__': print 'checking', sys.argv[1] print yahoo_inlinks_count(sys.argv[1])
More from halotis.com
Related posts:
- Scrape Yahoo Search Results Page
- Scrape Google Search Results Page
- Google Translate API Python Script
- Getting CPA statistics from Neverblue
- RSS Twitter Bot in Python



[...] View original here:Â Finding inlink information from Yahoo! in Python [...]
[...] Finding inlink report from Yahoo! in Python | HalOtis Marketing [...]
#share Finding inlink information from Yahoo! in Python http://ow.ly/15LgOP
This comment was originally posted on Twitter
Finding inlink information from Yahoo! in Python | HalOtis Marketing: Entrepreneurship on the web. starting a ne.. http://tinyurl.com/nf3avh
This comment was originally posted on Twitter
Finding inlink information from Yahoo! in Python – Inlinks (aka backlinks) are an important aspect of your SEO stra.. http://bit.ly/16yuJF
This comment was originally posted on Twitter
Finding inlink information from Yahoo! in Python – Inlinks (aka backlinks) are an important aspect of your SEO stra.. http://bit.ly/4RIpT
This comment was originally posted on Twitter
Finding inlink information from Yahoo! in Python – Inlinks (aka backlinks) are an important aspect of your SEO stra.. http://bit.ly/3t73dK
This comment was originally posted on Twitter
How mutch request make do? Before ban.
thanks for these freat tips.
an easier method to gather yahoo data (and other) is by using http://ministatus.com. one could also download the gathered results in pdf form for later usage.