I've created a curl/php script to retreive you Adwords balance using 
php/curl. I hope this is usefull for you.


<?php
>
> // 
> --------------------------------------------------------------------------
> // FUNCTION TO RETREIVE ADWORDS PREPAID BALANCE USING CURL by Freddie 
> Leeman
> // 
> --------------------------------------------------------------------------
>
>         $USERNAME = "";
>         $PASSWORD = "";
>         $COOKIE = "/tmp/adwords.cookie";
>
> // 
> -------------------------------------------------------------------------
> // DO NOT CHANGE ANYTHING BELOW THIS LINE
> // 
> -------------------------------------------------------------------------
>
>         $cookiehandle = fopen($COOKIE, 'w');
>         fclose($cookiehandle);
>
>         $ch = curl_init();
>         curl_setopt($ch, CURLOPT_URL, 'https://adwords.google.com');
>         curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
>         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
>         curl_setopt($ch, CURLOPT_COOKIEFILE, $COOKIE);
>         $loginpage = curl_exec ($ch);
>
>         $startpos = strpos($loginpage,"name=\"GALX\"")+11;
>         $startpos = strpos($loginpage, "\"", $startpos)+1;
>         $stoppos = strpos($loginpage, "\"", $startpos);
>         $GALXvalue = substr($loginpage,$startpos,$stoppos-$startpos);
>
>         $postData = "continue=https://adwords.google.com/um/gaiaauth";;
>         $postData .= "&Email=" . $USERNAME;
>         $postData .= "&Passwd=" . $PASSWORD;
>         $postData .= "&GALX=" . $GALXvalue;
>
>         curl_setopt($ch, CURLOPT_URL, 
> 'https://accounts.google.com/ServiceLoginAuth');
>         curl_setopt ($ch, CURLOPT_POST, 1);
>         curl_setopt ($ch, CURLOPT_POSTFIELDS, $postData);
>         curl_exec ($ch);
>         curl_setopt($ch, CURLOPT_URL, 
> 'https://adwords.google.com/select/MakePayments?hl=en');
>         $content = curl_exec ($ch);
>         curl_close ($ch);
>         unlink($COOKIE);
>
>         $startpos = strpos($content,"&euro;&nbsp;")+12;
>         $stoppos = strpos($content, "</td>", $startpos);
>         $balance = substr($content,$startpos,$stoppos-$startpos);
>
>         $balance = 
> floatval(str_replace(",",".",str_replace(".","",$balance)));
>
>         echo $balance;
>
> ?>
>

Op vrijdag 14 januari 2011 06:26:34 UTC+1 schreef Joe Chan het volgende:
>
> I read the reference abt account service but it seems there is no way to 
> get the balance of the adword account
>
> Are there any way to get Account Balance via adword API?
>
> Regards,
>
> JOE
>
>

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to