How to tell if code is using V1 versus V2 of API?

20 views
Skip to first unread message

walkerj

unread,
Jan 6, 2011, 6:46:10 AM1/6/11
to google-safe-...@googlegroups.com
Hi Everyone,

I've inherited some legacy code as the result of someone leaving our organization and now I need to find out if he did everything against V1 of the API or if he changed it to use V2. I believe he did the development at the beginning of 2010 or even the end of 2009 so I am suspecting it is V1 of the API. However, it is not easy to tell simply by looking at the code. The solution has been done using Java and xLightWeb. It's asynchronous code that isn't the easiest to follow but that probably is irrelevant. What I think is relevant is that it is using the following URL to make the request for the blacklist:

http://sb.google.com/safebrowsing/update?client=api&apikey=ABCDEFGugetheidathatTHISisan_ApiKey&version=goog-black-hash:1:-1,goog-malware-hash:1:-1

Does looking at this URL alone tell you that it is V1 since it does not have the appver or pver parameters in the URL? or can V2 still support a URL that is formed this way?

Sorry, I'm a newbie. We have an application that is going to go out into the real world and we are just realizing that the Safe Browsing feature might be obsolete in a few months when V1 is no longer supported.

Does anyone know when exactly V1 will be turned off?

Thanks very much for any help on the questions in this post!

Sam C

unread,
Jan 6, 2011, 1:23:44 PM1/6/11
to Google Safe Browsing API
Hi,

Not sure when V1 will be turned off but that URL looks like its come
from V1.
V2 uses the initial URL looking something like:
http://safebrowsing.clients.google.com/safebrowsing/downloads?client=api&apikey=".$this->apikey."&appver=".$this->version."&pver=".$this->apiversion
and then uses POST to request certain lists etc.
Whilst V1 (from what I know) gave entire massive lists; V2 serves the
database up in chunks which is quite a bit different and I recommend
if you're switching to V2 to read the docs thoroughly!

If you get stuck then this is the place to post :)

--Sam

On Jan 6, 11:46 am, walkerj <walk1...@gmail.com> wrote:
> Hi Everyone,
>
> I've inherited some legacy code as the result of someone leaving our
> organization and now I need to find out if he did everything against V1 of
> the API or if he changed it to use V2. I believe he did the development at
> the beginning of 2010 or even the end of 2009 so I am suspecting it is V1 of
> the API. However, it is not easy to tell simply by looking at the code. The
> solution has been done using Java and xLightWeb. It's asynchronous code that
> isn't the easiest to follow but that probably is irrelevant. What I think is
> relevant is that it is using the following URL to make the request for the
> blacklist:
>
> http://sb.google.com/safebrowsing/update?client=api&apikey=ABCDEFGuge...

walkerj

unread,
Jan 6, 2011, 4:59:04 PM1/6/11
to google-safe-...@googlegroups.com
Thanks. I had a feeling that would be the answer but I was hoping I might be wrong.

I found a great Java API for GSB called jgooglesafebrowsing that is hosted under the Google Code site. It's also just for V1 but I contacted the author and I am VERY happy to report that he is working on making it work for V2.

If you are developing a Java solution then I highly recommend checking out http://code.google.com/p/jgooglesafebrowsing/. I think he is working on it as we speak. Once he's done it would good to spread the word on his work because it's excellent.

In any case, thanks again for your response. It's appreciated.

Reply all
Reply to author
Forward
0 new messages