Earn Big with the New dotDB Affiliate Program!
×

How to use dotDB to rank domains

How to use dotDB to rank domains (guest posting by Kassey Lee)
13 Oct 2020

Notice: this is a guest posting by Kassey Lee

I look at a lot of domains every day in order to hunt for a few good ones. dotDB helps me rank them so that I can focus on the most important domains first. Since I manage domains with Microsoft Access, it is natural for me to use its VBA programming language to access dotDB via its API. I first talked about it last year at https://dotdb.com/news/2019-09-08/vba-api-access-example .

In this article, I'll explain the two keys provided by dotDB that I use to rank domains. For details on the API, please refer to https://dotdb.com/api-document. When you call dotDB, it returns a response in the Json data format. The data contains the following two keys.

  • total_suffix: total number of extensions for the keyword
  • exact_match_total_suffix: number of extensions for the exact match keyword

I use exact_match_total_suffix and then total_suffix to rank the domains. The higher the numbers are, the higher the priority of the domain becomes.

Once you receive the response, you can parse it to extract the two keys and their values. There are quite a few programs available on the internet to do that (for example, https://stackoverflow.com/questions/19360440/how-to-parse-json-with-vba-without-external-libraries ). However, for simplicity, I just use VBA to search for the two keys and their values. Here is the basic program.


Function dotDB(strKeyword As String)
    Dim hRequest As Object
    Dim strAPIkey As String
    Dim strURL As String
    Dim strResponse As String
    Dim intPos As Integer
    Dim strTotalMatch As String
    Dim strExactMatch As String

    strAPIkey = "(your API key)"

    strURL = "https://api.dotdb.com/v1/search?keyword=" & strKeyword

    Set hRequest = CreateObject("MSXML2.XMLHTTP")
        With hRequest
            .Open "GET", strURL, False
            .SetRequestHeader "Authorization", "Token " & strAPIkey
            .Send
    End With
    strResponse = hRequest.ResponseText

    '--- Exact match
    intPos = InStr(strResponse, "exact_match_total_suffix")
    strResponse = Mid(strResponse, intPos + 27)
    intPos = InStr(strResponse, ",")
    strExactMatch = Left(strResponse, intPos - 1)

    '--- Total matches
    intPos = InStr(strResponse, "total_suffix")
    strResponse = Mid(strResponse, intPos + 15)
    intPos = InStr(strResponse, ",")
    strTotalMatch = Left(strResponse, intPos - 1)

    dotDB = strTotalMatch & ";" & strExactMatch

End Function

The function returns a string which contains total match and exact match, delimited by semicolon (";"), so they can easily be separated for further use. Note that you can also use this function in Excel if the version supports VBA. Happy domain hunting!

Do you enjoy discovering how programming can be used to streamline your everyday tasks? If so, our team would love to hear from you! Get in touch at support@dotdb.com and let us know.