mercredi 15 octobre 2014

Getting Started with the Moz API

Anyone who knows me is fully aware that deep down I’m a complete geek. Further to that, I’m also inherently lazy, so – as I talked about in my talk at BrightonSEO last year – APIs are something that I’m very passionate about making the most of. Now, having a ‘passion’ for something like that isn’t really a talking point at the pub, but it is something that can save each and every person who works in SEO a load of time.
So, let’s get started.

An Introduction

Unless you’ve been living under the proverbial rock since 2004 you’ll know that Moz provide a suite of SEO tools and have arguably become the defacto standard when it comes to metrics. ‘Page Authority’ and ‘Domain Authority’ are getting to the point where they’re as well known as PageRank and, although the likes of MajesticSEO and Ahrefs would argue that their indexes are of a higher quality and quantity, the ease of use that Moz provides keeps OpenSiteExplorer in my list of most used tools.
But what if you want to do things en-masse? Grabbing the DomainAuthority of 500 sites manually would take forever and, although there are a few different options that integrate with Excel and Google Docs there comes a time when being able to create your own custom-made tools is almost a must have. This is where an API comes in.
Moz API
Essentially – and this is way oversimplified – an API is a way of accessing a data point to get the information that you need. In this example I’m going to take you through getting set up with the Moz API, explain a few bits of code and give you a downloadable set of files that could be installed on any server that runs PHP. It probably won’t be life changing but will give you a great place to start.

Stage 1: Generate your API keys.

By accessing the Moz API you’re using resources on their server, which is limited by the number of calls you can make each second. Because of this the first thing you’ll need to do is generate your Access ID and Secret Key which is really just a username and password. Log in to your Moz account, go to https://moz.com/products/api/keys, generate your keys, and store them somewhere safe. Once you’re done you can come back to this page at any time to check or regenerate your keys.
Moz - API Key Generation

Stage 2: A Simple API call.

Stay on that Moz page and scroll down a little. You’ll see a box that looks something like this:
Moz API - Getting Started
Notice the ‘Sample’ URL? Copy and paste that into your browser. You should see something like this:
{"uid":82035}
Go you. You just made your first API call. Okay, so it might not mean anything but in the URL you’ll see ‘Cols=2048′. Change that to ‘Cols=103616137252′ and refresh the page so that you now see this:
{"fmrp":7.6202542681508305,"fmrr":2.9744205357664444e-06,"pda":92.30687761491824,"ueid":67236,"uid":82035,"umrp":6.882065684679716,"umrr":1.126529888185239e-07,"upa":90.23459668002063,"us":200,"uu":"moz.com/blog"}
Not the easiest of things to read, but let’s translate things using this reference:
  • Subdomain MozRank (normalised): 7.6202542681508305
  • Subdomain MozRank (raw): 2.9744205357664444e-06
  • Domain Authority: 92.30687761491824
  • Number of External Links to the URL: 67236
  • Total number of Links to the URL: 82035
  • MozRank (Normalised): 6.882065684679716
  • MozRank (Raw): 1.126529888185239e-07
  • PageAuthority: 90.23459668002063
  • HTTP Status: 200
  • Canonical URL: moz.com/blog
Now we’re getting somewhere. In an instant we access the Moz API, pull back a load of data, and show it on the screen. Now all we need to do is throw a bit of code together that does all of this for multiple URLs… simple!

Get Your Code On!

For this example we’re going to use PHP but Moz have some Ruby and Python examples here too. The aim of this simple script will be:
  1. Show a multi-line text box on the screen that lets us input a load of URLs.
  2. Batch those URLs (so that we’re limiting the amount of calls we’re making) and send them to Moz.
  3. Get a load of data back.
  4. Show it on screen.
I’ll miss out an explanation of the text box code as this is just HTML, but part 2 is quite important. Most people start off by just sending one URL at a time to Moz, processing that data, and then moving onto the next one. This takes far longer than it should because each time you make a call to Moz there’s a period of time where you’re waiting for them to find the data and send it back.
Think of it like going to the bar, ordering a pint, waiting for that to come, and then doing the same thing for all 80 of your mates instead of just asking for all those drinks in one go.
Instead, we batch up the URLs using a built in PHP function:
$chunked_verified_urls = array_chunk($urls,80);
This then allows us to send 80 URLs at a time over to Moz meaning that instead of asking them for information 80 times we’re just making one big request.
Moving on from there we send the batched list of URLs to Moz using the ‘getSeomozMetrics()’ function that’s included in the attached file. The data is returned, we switch it around to grab the bits that we want, and then output it to the screen. I’ve added plenty of comments to explain what’s going on so it should (hopefully) make sense. Here’s what we end up with…
Moz Bulk Checker 1

Get the code!

Finally, the most important bit – a free download. There’s a single PHP script in this ZIP file which you’ll just need to unzip, add your Moz credentials to the top, and upload to any web server that supports PHP. Alternatively I’ve included an example on my site that you can use to your heart’s delight (until someone decides to abuse it ;))

Next Steps…

I hope this served as a decent introduction but there’s far more that can be done. I’ve already shared some other bits and pieces in my APISet Download, which includes a number of APIs and also some automated link profiling.
Questions? Comments about my horrendous code? Would love to hear your thoughts…

how to get bing backlinks using php

  1. function bing_backs($url){ // to get backilinks
  2. $url = "http://www.bing.com/search?q=link%3A%20$url";
  3. $total = file_get_contents($url);
  4. $match_expression = '/<span class="sb_count" id="count">(.*?)<\\/span><\/div>/im';
  5. // preg_match($match_expression,$total,$matches);
  6. preg_match_all($match_expression, $total, $matches);
  7. echo $n_clean=$matches[1];
  8. return $n_clean=clean_me($n_clean);
  9. }
  10. function clean_me($numb){ // to clean the reutrn numbers remove coma (,) etc
  11. return $clean_num=str_replace(",", "", $numb);
  12. }
  13. $url="www.youtube.com";
  14. echo bing_backs($url); // not working regex seems to be ok to me
  1. function bing_backs($url){ // to get backilinks
  2. $url = "http://www.bing.com/search?q=link%3A%20$url";
  3. $total = file_get_contents($url);
  4. $match_expression = '/<span class="sb_count" id="count">(.*?)<\\/span><\/div>/im';
  5. // preg_match($match_expression,$total,$matches);
  6. preg_match_all($match_expression, $total, $matches);
  7. echo $n_clean=$matches[1];
  8. return $n_clean=clean_me($n_clean);
  9. }
  10. function clean_me($numb){ // to clean the reutrn numbers remove coma (,) etc
  11. return $clean_num=str_replace(",", "", $numb);
  12. }
  13. $url="www.youtube.com";
  14. echo bing_backs($url); // not working regex seems to be ok to me

the best seo report

WESIPA.com provides the digital intelligence that helps leading global brands improve their marketing based on the online statistics for millions of websites.
Products and services competition are powered by the largest consumer behavior and integrated online panel survey in the industry websites.
logo wesipa.comWESIPA.COM is one of the largest databases on websites information around the world, with millions websites indexed and several tens of thousands added every day. For each website you have access to its registration details (WhoIs), the DNS settings updated in real time, location based on IP address and direct access to many other online tools (search engine optimization / SEO, reverse websites hosted on the same IP address, list of domain names registered and abandoned every day .. ;).

This is an API you can use to resolve a category of a web page. It uses the Dmoz data to provide this information.

What's this?

This is an API you can use to resolve a category of a web page. It uses the Dmoz data to provide this information.
  • Number of categorized web pages: 4439365
  • Number of categories: 24566
  • Dmoz data from: 19.11.2009

How can I use it?

Send a request to url
http://dmoz-api.appspot.com/category?url=
You will get the category back as a text. No, no JSON or XML. Plain text. Although you might also get nothing in response — if the web page was not categorized yet. It doesn't matter if you use http prefix or not, sme.sk will give you the same result as http://sme.sk

Example — page with a cagetory

http://dmoz-api.appspot.com/category?url=www.sme.sk

Example — page without a cagetory

http://dmoz-api.appspot.com/category?url=www.nocategory.bbq

What is Dmoz?

Dmoz is an open directory project which list various web pages and groups them into categories. Its primary purpose is to allow you to find web pages based on your interests or needs — you just browse the category that you are interested in. It might also occur to you, that it would be useful if you could take a web page, query some Dmoz API and get the page category. Unfortunately, this is not possible. Oh wait, it is!

Why?

The Dmoz data is publicly available as an RDF file — a long, funny, obscure and full-of-duplicates 2 gigabytes large XML file. Even after parsing and cherry-picking the actual interesting content it is several hundreds megabytes (around 500 actually) long, so it's really impractical to bundle it in your application

12 ways to Improve Alexa Ranking of Your Website

12 ways to Improve Alexa Ranking of Your Website


Who don’t want their site to be among the top list of popular sites? I think everybody wants.
But what is the main metrics which decides the popularity of the site?
I must say Alexa ranking of your site is an important factor. In another way, the most popular site will get a good Alexa ranking.


There are more than 633 million websites in the world. It is said that websites are getting double every year. So, it’s a cut through neck competition to enhance your website Alexa ranking.
But it is also true that, it is very necessary to improve website ranking to gain high traffic to uplift business growth. Major challenge is for the startups.
So, I did a bit online research and find out some ways to improve your Alexa ranking. Let me share those tips with you.
But before that let’s discuss about what is Alexa and how ranking of a website is measured?

What is Alexa?

It is a web information company by Amazon that maintains the ranking data of a site according to site’s performance. It gives a metrics that determine the quality of your website.
Like a grading system in a school decides the rank of children, the highest grade-maker-child gets first rank. Second highest grade maker gets the second rank and so on it goes.
  • In case of websites, the daily number of traffic visitors and page views decides the Alexa rankingof the site. More the traffic on your site, more is the probability of increasing Alexa ranking.
increase Alexa ranking
  • The most important part of Alexa algorithm is, they give more weightage to that traffic that pass to their system. It means that, when visitors having Alexa toolbar installed on their browser, come on your site, your website ranking will be boost up.
Most important thing is, Alexa collected website traffic on your site by tracking the visits from the visitors who have installed Alexa toolbar.
Now look into the tips below:-

Tip# 1:Increase the Traffic on your site:

Website traffic will improve when more visitors will be able to come on your site. Which is only possible when your website will index on first few pages in search engine result page ranking.
So it is a long process though, I will give you some tips in general and related to search engine optimization, in brief to increase website traffic.
Non-SEO tips
  • Consistent Blogging
  • Encourage visitors to share your site
  • Guest blogging
  • Directory listing of your website
SEO tips
  • Use proper keywords. Use keywords in each of your web page title, description, domain name (on page SEO)
  • Use ALT tags in images and links
  • Use proper Anchor tags
  • Use strategic keywords in meta title
  • Do a proper on-site and off-site optimization
  • Good backlinks that can shoot your site at high rank in search engines. Use Do follow links mostly.
  • Get paid traffic with the help of Google Adwords or Microsoft Ad Centre.

Tip# 2:Install Alexa toolbar

Install Alexa toolbar into your every browser. You can install the toolbar from here. It plays a very important role to track your website

Tip# 3:Put up an Alexa Rank Widget

You can create the Alexa widget and paste the java script codes for it on your html page. Make theAlexa widget for your site from here. It displays the Alexa ranking stats of your website on each of your pages and blogs.

Tip# 4:Encourage your visitors to use Alexa toolbar

It is a very important task to do as it counts on traffic to your website. You can do this by creating your custom toolbar.

Tip# 5:Create Custom toolbar using Alexa Toolbar Creator

It will help you to connect to customers and drive more traffic. You can create your custom Alexa tool bar and promote your site with it. Let your customers installed the toolbar. This will increase visibility of your site.
create Alexa toolbar

Tip# 6:Claim/verify your Website on Alexa.com

Claim your website at the following link. Here is an video by Mike Barnes that teaches you how to claim your site on Alexa.
There are plugin as Claim AlexaAlexa Claim and Certify that enables you to claim your WordPress site on Alexa easily.
You can easily claim your website on Alexa.com. Sign up with a new account of your website and then insert meta tag in the head Section of your site.

Tip# 7:Generate Quality Backlinks on your Websites and Blogs.

Backlinks are being primary keys that create a link between the webpages. Other terrific thing is that Search engine gives more weightage to the good quality of backlinks available on your webpage. It helps search engines to boost traffic on your website.
Don’t create no-follow tag backlinks as it is avoided by search engines while crawling and indexing your website.
You might be confused how Backlink can increase the Alexa ranking. Well, here is the relationship.
Good backlinks will increase page rank of your website. Good page rank websites are very search engine friendly. As a result, it will increase the chance of indexing your site among first few pages of search result.  There are more possibilities of more users on your website.
quality backlink improves Alexa ranking
Promote your articles on the internet marketing forums, webmasters forum and get massive traffic on your site/blogs. Here is a list of top forums given by prelovac.com.

Tip# 9:Write Useful and Qualitative Content 

The blogs/articles which you publish on your website should have interesting content, which the visitors likes to read. Contents related to SEO, webmaster tools are very beneficial. In fact, webmasters always visits to such sites to get knowledge, they have a Alexa toolbar installed in their browser. There is a big opportunity in increasing Alexa ranking.

Tip# 10:Connect To Social Networking sites

When you get your site stumbled or dig and your blogs get shared in social networking sites by visitors, you get a maximum visitors to your website which have a positive impact on your Alexa ranking.
increase traffic through social media

Tip# 11: Submit your Sites in Directories

Directories contains website in category wise. It helps you to make popular inbound links. Good quality backlinks play a major role in increasing the PR of a site and thus increase the Alexa ranking. Some important directories are DmozYahoo.
website submission in directories

Tip# 12: Submit Blogs in Blog Directories

Blog directories stores blogs and blog sites according to different categories. Once your blog is approved by the directory, you will be on a track to become an owner of a branded blog site. It will bring traffic on your blog and helps to bring inbound links. Some best blog directories are Technorati,Best of the web blogsboing boing.

Conclusion

Boost in Alexa ranking of your site is an outcome of traffic volume on your site. Traffic that uses Alexatoolbar matters a lot in this track.
There is not direct relation between the SERP ranking and Alex ranking of your website. The relation goes via traffic.
When your site is properly visible on SERP results, there will be more increase in traffic and it results in better Alexa ranking. Better the Alexa ranking, more the site is popular. More the site is popular, high the visitor traffic, which results in more boost in Alexa ranking .
One more thing to notify, its mostly seen that higher the Alexa ranking, greater is the strength of Google Page Rank. It’s seen in most of the cases but not always.