Google Keyword Competition Info Script

6 replies
When I do my keyword research on Google, I do:

Broad competition
Exact competition
AllInURL
AllInTitle
AllInAnchor
AllInText

It's a pain typing that for each word, so I wrote a script that pulls the info all at once.

Written in ASP and needs the Microsoft.XMLHTTP object, so this will only work on Windows Servers.

Feel free to use, distribute, modify or whatever. Works for me but I make no guarantees.

Ask questions here if you have any. If I can help, I will.

Results Screen Shot
Attachment 4127

Script
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Google Keyword Competition Stats </TITLE>
<style type="text/css">
body {font: normal 12pt arial}
</style>
<!--
If would be nice if you left in the below, but if you get some sort of savage glee by deleting it, then have at it. 
Script by Dave, AKA Wedango on the WarriorForum
ASP blog: http://retrowebdev.blogspot.com/
He also does web sites and stuff: Webdango.com
-->
</HEAD>

<BODY>
Enter Your Keyword
<br><br>
<FORM METHOD=POST ACTION="goog-stats.asp">
    <INPUT TYPE="text" NAME="keyword">
    <INPUT TYPE="submit">
</FORM>
<%
Dim strKeyword

strKeyword = ""
strKeyword = Trim(Request.form("keyword"))

If strKeyword <> "" Then
    Dim objXMLHTTP, strURL, iBroadComp, iExactComp, iAllInURL, iAllInTitle, iAllInAnchor

    Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")

    Response.write("Results for <b>"&strKeyword&"</b><br><br>")
    'broad competition
    Response.write("Broad Competition: "& fKeywordStats("broad",strKeyword) &"<br>")

    'exact competition
    Response.write("Exact Competition: "& fKeywordStats("exact",strKeyword) &"<br>")

    'allintitle
    Response.write("All In Title: "& fKeywordStats("allintitle",strKeyword) &"<br>")

    'allinurl
    Response.write("All In URL: "& fKeywordStats("allinurl",strKeyword) &"<br>")

    'allinanchor
    Response.write("All In Anchor: "& fKeywordStats("allinanchor",strKeyword) &"<br>")

    'allincontent
    Response.write("All In Text: "& fKeywordStats("allintext",strKeyword) &"<br><br>")

    Set objXMLHTTP = nothing
End If
%>

<%
Function fKeywordStats(TheType, TheKeyword)
    Dim strURL, strHTML, vStart, vEnd, vLength

    vStart = 0
    vEnd = 0
    vLength = 0

    Select Case TheType
        Case "broad"
            strURL = "http://www.google.com/search?hl=en&q="&strKeyword&""
        Case "exact"
            strURL = "http://www.google.com/search?hl=en&q="""&strKeyword&""""
        Case "allinurl"
            strURL = "http://www.google.com/search?hl=en&q=allinurl%3A"&strKeyword&""
        Case "allintitle"
            strURL = "http://www.google.com/search?hl=en&q=allintitle%3A"&strKeyword&""
        Case "allinanchor"
            strURL = "http://www.google.com/search?hl=en&q=allinanchor%3A"&strKeyword&""
        Case "allintext"
            strURL = "http://www.google.com/search?hl=en&q=allintext%3A"&strKeyword&""
    End Select

    objXMLHTTP.Open "GET", strURL, false   
    objXMLHTTP.Send
    strHTML = objXMLHTTP.responseText

    vStart  = Instr(strHTML,"</b> of about <b>") + 17
    vEnd    = Instr(strHTML,"</b> for <b>")
    vLength = vEnd - vStart

    If vStart > 17  then
        strHTML = Mid(strHTML,vStart,vLength)
    Else
        strHTML = "no results"
    End If

    fKeywordStats = strHTML
End Function
%>
</BODY>
</HTML>
#competition #google #info #keyword #script
  • Profile picture of the author webdango
    OK , the first update

    Replace <BODY>
    With <BODY OnLoad="document.form.keyword.focus();">

    Replace <FORM METHOD=POST ACTION="goog-stats.asp">
    With <FORM NAME="form" METHOD=POST ACTION="goog-stats.asp">

    This will put the cursor in the form after the page loads so you don't have to click there to start typing.

    Also, you have to name the file goog-stats.asp. If you name it something different you have to change the ACTION destination in the FORM tag.
    Signature
    I make $2,000 - $3,000 a month and YOU CAN TOO
    Get the exact methods I use in my No Joke Guides:
    How to Build Income Earning Websites
    Search Psychology and Keyword Brainstorming
    How to Find a Profitable Niche
    Read more tips at my NoJokeGuide blog
    {{ DiscussionBoard.errors[1813884].message }}
    • Profile picture of the author Bruce Hearder
      Any change of getting the script in PHP so that it can run on 90% of the servers that WF members use.

      I know its a big ask, but had to ask..

      Take care

      Bruce
      {{ DiscussionBoard.errors[1813904].message }}
  • Profile picture of the author webdango
    <hangs head in shame>

    Alas, I don't know PHP. But maybe someone will come along who will.

    I know compared to the tools like Micro Niche Finder, Market Samauri, Keyword Elite, etc... it's really doesn't do much. But I've found I like doing my own research using only the Google Adwords Keyword Tool and Google search, so this helps me a lot.
    Signature
    I make $2,000 - $3,000 a month and YOU CAN TOO
    Get the exact methods I use in my No Joke Guides:
    How to Build Income Earning Websites
    Search Psychology and Keyword Brainstorming
    How to Find a Profitable Niche
    Read more tips at my NoJokeGuide blog
    {{ DiscussionBoard.errors[1813931].message }}
    • Profile picture of the author Bruce Hearder
      No shame in not knowing PHP, and good on you for at least writing your own scripts and not relying on program that everyone else uses.

      In my opnion, the most successful IM marketers all have their own custom scripts that :

      1. Find keywords
      2. Do competiion analysis
      3. Create content
      plus much more..

      The more custom scripts you have working for you, the better off you are.

      For example, I harvest my own keywords (don't use Google KW tools, or Market Samurai etc), and my Adsense earning are going through the roof.

      I have one website that routinely pulls in over $XX a day in adsense, and its been up since 2006! and it doesn't have a single keyword on it from GKW tool.

      So keep up the good work and keep on writing them scripts..

      Take care

      Bruce
      {{ DiscussionBoard.errors[1813981].message }}
  • Profile picture of the author powercazh
    Hello webdango,
    Glad to have found this script. thanks for sharing. What do I need to change in the script if I want to combine the intitle and inurl results as additional item in the query results?
    {{ DiscussionBoard.errors[2774478].message }}
  • Profile picture of the author jminkler
    Doesn't really make a difference after about 10 or less runs of the script google will shut down your IP from making searches.

    So, you have to use a proxy. Really this is against TOS anyways.

    5.3 You agree not to access (or attempt to access) any of the Services by any means other than through the interface that is provided by Google, unless you have been specifically allowed to do so in a separate agreement with Google. You specifically agree not to access (or attempt to access) any of the Services through any automated means (including use of scripts or web crawlers) and shall ensure that you comply with the instructions set out in any robots.txt file present on the Services.


    {{ DiscussionBoard.errors[2774935].message }}

Trending Topics