How to get keyword serach volume using Adwords API?

6,397 views
Skip to first unread message

suga priya

unread,
Apr 29, 2014, 9:43:25 AM4/29/14
to adwor...@googlegroups.com
Can anyone please let me know the steps to get search volume of keywords in php?


Thanks,
Sugappriya

Josh Radcliff (AdWords API Team)

unread,
Apr 29, 2014, 1:24:08 PM4/29/14
to adwor...@googlegroups.com
Hi Sugappriya,

There are several code examples in the PHP client library that demonstrate how to do this for various use cases.
If instead you are interested in viewing the performance of keywords that are already in your account, you could use the Keywords Performance Report.  See the DownloadCriteriaReport.php code sample for how to run reports.  You will have to modify that sample slightly so that it runs the Keywords Performance Report, but the changes should be fairly self-explanatory.

Cheers,
Josh, AdWords API Team

suga priya

unread,
Apr 30, 2014, 2:35:27 AM4/30/14
to adwor...@googlegroups.com
Hi Josh,

Thanks for the information.I am gonna start using Adwords API in couple of days. Before that i would like confirm with you we can able to get search volume through API instead of getting through keyword planner manually.

Thanks,
Sugappriya

Josh Radcliff (AdWords API Team)

unread,
Apr 30, 2014, 9:55:29 AM4/30/14
to adwor...@googlegroups.com
Hi Sugappriya,

Yes - the TargetingIdeaService mirrors the functionality of the Keyword Planner tool.  The GetKeywordIdeas.php example I mentioned in my previous post shows how to use this service.

Cheers,
Josh, AdWords API Team

suga priya

unread,
May 2, 2014, 5:37:09 AM5/2/14
to adwor...@googlegroups.com
Thank you.Can we try with test account i having pending approval developer token

sugar...@gmail.com

unread,
May 2, 2014, 5:57:29 AM5/2/14
to adwor...@googlegroups.com
I cant setup billing preferences if i select India region.Can you help me?

Josh Radcliff (AdWords API Team)

unread,
May 2, 2014, 11:31:40 AM5/2/14
to adwor...@googlegroups.com
Hi,

As mentioned in this section of the Test Accounts Guide, TargetingIdeaService returns dummy data for test accounts, so you can use your test account to verify your code works, but the actual data returned won't be very meaningful.

If you have an issue with your MCC billing and terms & conditions setup please use this form to get in touch with the appropriate team.

Thanks,
Josh, AdWords API Team

sugar...@gmail.com

unread,
May 6, 2014, 8:23:55 AM5/6/14
to adwor...@googlegroups.com



Hi Josh,

I am able to access the api with my test account.

I am trying to get avg monthly search value for the given keyword.But its not giving same result as keyword planner tool.


this is my code



require_once dirname(dirname(__FILE__)) . '/init.php';
$user = new AdWordsUser();
// Log every SOAP XML request and response.
$user->LogAll();
$adwords_version = ADWORDS_VERSION;
$keyword = "lease-accounting";
$values = GetTargetingIdea($user, $adwords_version, $keyword);
print_r($values);
function GetTargetingIdea(AdwordsUser $user, $adwords_version, $keyword)
{
    // Load the service, so that the required classes are available.
    $targetingIdeaService = $user->GetTargetingIdeaService($adwords_version);
   
    $languageParameter = new LanguageSearchParameter();
    $english = new Language();
    $english->id = 1000;
    $languageParameter->languages = array($english);
   
    // Create selector.
    $selector = new TargetingIdeaSelector();
    $selector->requestType = "STATS";
    $selector->ideaType = 'KEYWORD';
    $selector->requestedAttributeTypes = array('KEYWORD_TEXT','SEARCH_VOLUME');
     
    $locationTargetParameter = new LocationSearchParameter();
    $location = new location();
    $location->id = 2840;
    $locationTargetParameter->locations = $location;
     
    $relatedToQuerySearchParameter = new RelatedToQuerySearchParameter();
    $relatedToQuerySearchParameter->queries = array($keyword);
    $selector->searchParameters[] = $relatedToQuerySearchParameter;
    //$selector->searchParameters[] = $languageParameter;
    //$selector->searchParameters[] = $locationTargetParameter;
   
    // Create paging controls.
    $selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);
    $ret = array();
    do {
        // Make the get request.
        $page = $targetingIdeaService->get($selector);
 
        // Display results.
        if (isset($page->entries))
        {
            foreach ($page->entries as $adGroupAd)
            {
                $ret[] = array(
                    'keyword text' => $adGroupAd->data[0]->value->value,
                    'searchvolume' => $adGroupAd->data[1]->value->value,
                   
                   
                );
            }
        }
        // Advance the paging index.
        $selector->paging->startIndex += AdWordsConstants::RECOMMENDED_PAGE_SIZE;
    } while ($page->totalNumEntries > $selector->paging->startIndex);
    return $ret;
}


and i am getting result as

 Array ( [0] => Array ( [keyword text] => lease-accounting [searchvolume] => -619437956526634531 ) )

i got this from keyword planner tool







Please help me out of this.


Thanks,
Sugappriya
 

Josh Radcliff (AdWords API Team)

unread,
May 6, 2014, 9:25:08 AM5/6/14
to adwor...@googlegroups.com
Hi Sugappriya,

Are you using your test account in the TargetingIdeaService request?  If so, the data returned will be dummy data.  You won't be able to use the TargetingIdeaService to get meaningful data until you have an approved developer token and issue the requests against a non-test account.

Thanks,
Josh, AdWords API Team

suga priya

unread,
May 6, 2014, 9:51:44 AM5/6/14
to adwordsapia...@google.com, adwor...@googlegroups.com
Hi Josh,

I created Refresh token and client customer id from test acount only. My developer token is still pending for review.

I used like this $selector->requestType = "STATS"

and i was trying to fetch avg monthly searches but its giving the below result.But in keyword planner tool its showing 1900.You can refer my previous post image.

Array ( [0] => Array ( [keyword text] => lease-accounting [searchvolume] => Array ( [0] => MonthlySearchVolume Object ( [year] => 2014 [month] => 4 [count] => 5470032339580407767 ) [1] => MonthlySearchVolume Object ( [year] => 2014 [month] => 3 [count] => -564243844579747617 ) [2] => MonthlySearchVolume Object ( [year] => 2014 [month] => 2 [count] => -6370275530849895689 ) [3] => MonthlySearchVolume Object ( [year] => 2014 [month] => 1 [count] => 1974808081556354969 ) [4] => MonthlySearchVolume Object ( [year] => 2013 [month] => 12 [count] => 958637242624284451 ) [5] => MonthlySearchVolume Object ( [year] => 2013 [month] => 11 [count] => 849376547664379796 ) [6] => MonthlySearchVolume Object ( [year] => 2013 [month] => 10 [count] => 1556130635073640503 ) [7] => MonthlySearchVolume Object ( [year] => 2013 [month] => 9 [count] => -3664306422764977970 ) [8] => MonthlySearchVolume Object ( [year] => 2013 [month] => 8 [count] => -8272530439122489372 ) [9] => MonthlySearchVolume Object ( [year] => 2013 [month] => 7 [count] => 2603995224135419719 ) [10] => MonthlySearchVolume Object ( [year] => 2013 [month] => 6 [count] => 5361983111252305629 ) [11] => MonthlySearchVolume Object ( [year] => 2013 [month] => 5 [count] => -7336862422889296561 ) ) ) )


Is that because of am using test account.Can you please help me to understand?

Thanks,
Sugappriya


--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/lGcVpL0pEu0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

suga priya

unread,
May 7, 2014, 2:01:58 AM5/7/14
to adwor...@googlegroups.com
Thank you


On Tue, May 6, 2014 at 7:35 PM, <adwor...@googlegroups.com> wrote:
Hi,

Yes, it's due to the fact that you are using a test account.  As mentioned in the test accounts guide:

Cheers,
Josh, AdWords API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 05/06/14 09:52:43 sugar...@gmail.com wrote:

Hi Josh,

I created Refresh token and client customer id from test acount only. My developer token is still pending for review.

I used like this $selector->requestType = "STATS"

and i was trying to fetch avg monthly searches but its giving the below result.But in keyword planner tool its showing 1900.You can refer my previous post image.

Array ( [0] => Array ( [keyword text] => lease-accounting [searchvolume] => Array ( [0] => MonthlySearchVolume Object ( [year] => 2014 [month] => 4 [count] => 5470032339580407767 ) [1] => MonthlySearchVolume Object ( [year] => 2014 [month] => 3 [count] => -564243844579747617 ) [2] => MonthlySearchVolume Object ( [year] => 2014 [month] => 2 [count] => -6370275530849895689 ) [3] => MonthlySearchVolume Object ( [year] => 2014 [month] => 1 [count] => 1974808081556354969 ) [4] => MonthlySearchVolume Object ( [year] => 2013 [month] => 12 [count] => 958637242624284451 ) [5] => MonthlySearchVolume Object ( [year] => 2013 [month] => 11 [count] => 849376547664379796 ) [6] => MonthlySearchVolume Object ( [year] => 2013 [month] => 10 [count] => 1556130635073640503 ) [7] => MonthlySearchVolume Object ( [year] => 2013 [month] => 9 [count] => -3664306422764977970 ) [8] => MonthlySearchVolume Object ( [year] => 2013 [month] => 8 [count] => -8272530439122489372 ) [9] => MonthlySearchVolume Object ( [year] => 2013 [month] => 7 [count] => 2603995224135419719 ) [10] => MonthlySearchVolume Object ( [year] => 2013 [month] => 6 [count] => 5361983111252305629 ) [11] => MonthlySearchVolume Object ( [year] => 2013 [month] => 5 [count] => -7336862422889296561 ) ) ) )


Is that because of am using test account.Can you please help me to understand?

Thanks,
Sugappriya

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

suga priya

unread,
May 8, 2014, 1:25:07 AM5/8/14
to adwor...@googlegroups.com
Hi Josh,

TARGETED_MONTHLY_SEARCHES returns past twelve month searches with three parameters.But how do i find avg monthly searches as same as keyword planner tool.?

Do i need to calculate from count value? or any other way to find it.

Can you please help me on the same.

Thanks,
Sugappriya

Josh Radcliff (AdWords API Team)

unread,
May 8, 2014, 4:34:25 PM5/8/14
to adwor...@googlegroups.com
Hi Sugappriya,

The SEARCH_VOLUME AttributeType will return average monthly searches.

sugar...@gmail.com

unread,
May 9, 2014, 12:34:17 AM5/9/14
to adwor...@googlegroups.com
Thank you so much Josh

sugar...@gmail.com

unread,
May 9, 2014, 12:41:55 AM5/9/14
to adwor...@googlegroups.com
Hi Josh,

COMPETITION Attribute returns the value  between 0 to 1. If i would like to get low ,medium or high format.What should i do.


Thanks,
Sugappriya

Josh Radcliff (AdWords API Team)

unread,
May 9, 2014, 9:12:13 AM5/9/14
to adwor...@googlegroups.com
Hi Sugappriya,

The API doesn't have a field for low/medium/high specifically, so you would have to calculate it yourself based on the COMPETITION attribute.

Cheers,
Josh, AdWords API Team

suga priya

unread,
May 12, 2014, 12:11:11 AM5/12/14
to Josh Radcliff, adwor...@googlegroups.com
Thank you.


--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/lGcVpL0pEu0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.

suga priya

unread,
May 12, 2014, 4:46:19 AM5/12/14
to Josh Radcliff, adwor...@googlegroups.com
Hi Josh,

Is there any way to find Google total search results value using  API or any other method?


Thanks,
Sugappriya

Josh Radcliff (AdWords API Team)

unread,
May 12, 2014, 1:40:43 PM5/12/14
to adwor...@googlegroups.com, Josh Radcliff
Hi,

The closest you could get is using SEARCH_VOLUME and then multiplying that by the number of months.

Best regards,
Josh, AdWords API Team

suga priya

unread,
May 13, 2014, 1:11:04 AM5/13/14
to Josh Radcliff, adwor...@googlegroups.com
Thank you


Arul Kumar

unread,
Dec 30, 2014, 4:18:26 AM12/30/14
to adwor...@googlegroups.com

Hi,

Can anyone please tell how can i apply filter "Only show ideas closely related to my search terms" in TargetingIdeaService PHP api?

Josh Radcliff (AdWords API Team)

unread,
Dec 30, 2014, 10:14:25 AM12/30/14
to adwor...@googlegroups.com
Hi,

I see you posted this same question on another thread. When posting to the forum, please only post each question once, and please start a new post unless you are adding to a post that asks the same question you are asking. This will make it easier for everyone to find the most relevant posts for their questions.

I'll reply to your post on the other thread today.

Thanks,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages