SEOstats is a powerful open source PHP library to request a bunch of SEO relevant metrics.