Google Talk Status API in PHP

5 02 2009

I just put together this API in PHP for retrieving the online status of a Google Talk user. It’s based on the Google Talk badge but allows for server-side access to a user’s status.

Why would someone need such a thing? Well, let’s say they wanted to create a badge controller which checks a number of users to see if they’re online, and when it finds one, it displays the badge for that user. This controller can then serve as a live help module to place on a web site to allow site visitors to talk with any available representative. If no rep is available, the controller can disappear seamlessly, or display a link to a contact form or help/faqs pages.

Download gtalkStatus.class.php
Download checkSkype.class.php, a modified phpclasses file for checking a Skype user’s status. Skype is, to date, much more friendly for allowing APIs to access a user’s status.



13 responses

11 03 2009


In google talk status class(gtalkStatus.class.php, what is the account hash of

Please let me know. Thanks in advanced.


Almas Hossain

11 03 2009

* 2- To create your chatback badge, visit If you’re using a Google Apps account, you can create a chatback badge by visiting where DOMAIN is the name of your domain.
* 3- Use the alphanumeric account hash to seed the constructor

5 04 2009
Adam Harvey

Thanks for posting this. It was easy to use and worked great. I used it for a Flash piece here . Do you know if there is any way to set your Google Talk status remotely? I’m looking for a way to update my status “busy” or “available” without using GMail or GTalk. Any ideas?
Keep up the good work,

5 04 2009

You can check out
You should be able to connect to the Google server and set your “presence”. Not sure if this will cause a collision if you have a session open on another client, but try it out.

16 04 2009

My website wants to generate google chatback badge code for the user instead of user going to the google chatback website and copying paste to my site.
I would like to acheive this programmically login to google with google id and generating the chatback bacdge code.
Can you please let me know how it can be acheived?

16 04 2009

I don’t know about any API to do this. Sorry

3 05 2009

Is there a way to get Gtalk Friend’s Status as Feed

3 05 2009

Again, I don’t have much experience, but check out the XMPPHP project. Should be able to do it.

26 05 2009

I want to show gmail user status in my web page only i have gmail user ID nothing else how can do that

26 05 2009

If you’re looking to simply show your status in your web page, you can use the Badge generated by Google by visiting the Google Talk badge page, and following the instructions there.

26 03 2011


Is it okey if I use your script in a WordPress plugin? And can I credit you if I upload it to plugin repository?

Best regards
Victor, Intervaro Web Agency

27 03 2011

Sure Victor. I expect the settings page will include a link to the badge-generation page, and make the config easy. (Read the class comments for more info)

What’s the complete functionality of the plugin? Something like the scenario I described in this article?

27 03 2011

Hi Israelwebdev,

The plugin should have similar functionality as another WordPress plugin using your script – Google Talk Chatback Widget (
The goal is to make it more customizable and easier to use. Besides support for WordPress widgets you will also be able to use shortcodes or template tags.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: