Get Keyword Idea - return DeadlineExceededErrors

134 views
Skip to first unread message

Zied Chaari

unread,
Mar 28, 2019, 6:03:52 AM3/28/19
to AdWords API and Google Ads API Forum
Hi all,

Sometimes when i'm trying to get keywords Idea, using KeywordPlanIdeaServiceClient Service (Google Ads Api V1.0), I'm getting an error saying DeadlineExceededError.
What should I do?

You can find my code bellow.

public dynamic searchKeyword(GoogleAdsClient client, string customerId, string keywordTexts, string pageUrl)
        {
            List<dynamic> keyword_results = new List<dynamic>();
            KeywordPlanIdeaServiceClient keywordPlanIdeaService = client.GetService(Services.V1.KeywordPlanIdeaService);
            
            GenerateKeywordIdeasRequest request = new GenerateKeywordIdeasRequest()
            {
                CustomerId = customerId
            };
            if (keywordTexts.Length == 0)
            {
                request.UrlSeed = new UrlSeed()
                {
                    Url = pageUrl
                };
            }
            else if (string.IsNullOrEmpty(pageUrl))
            {
                request.KeywordSeed = new KeywordSeed();
                request.KeywordSeed.Keywords.Add(keywordTexts);
            }
            else
            {
                request.KeywordAndUrlSeed = new KeywordAndUrlSeed();
                request.KeywordAndUrlSeed.Url = pageUrl;
                request.KeywordAndUrlSeed.Keywords.Add(keywordTexts);
            }
            request.Language = ResourceNames.LanguageConstant(1000);
            try
            {
                GenerateKeywordIdeaResponse response = keywordPlanIdeaService.GenerateKeywordIdeas(request);
                foreach (GenerateKeywordIdeaResult result in response.Results)
                {
                    KeywordPlanHistoricalMetrics metrics = result.KeywordIdeaMetrics;
                    dynamic keyword_result = new ExpandoObject();
                    keyword_result.Text = result.Text;
                    keyword_result.AvgMonthlySearches = metrics.AvgMonthlySearches ?? 0;
                    keyword_result.Competition = metrics.Competition;
                    keyword_results.Add(keyword_result);
                }
            }
            catch (Exception e)
            {
                throw;
            }
            return keyword_results.OrderByDescending(K => K.AvgMonthlySearches);
        }

Thanks,
Zied 

googleadsapi...@google.com

unread,
Mar 28, 2019, 3:30:10 PM3/28/19
to acteol...@gmail.com, AdWords API and Google Ads API Forum
Hi Zied,

Can you please share your request and response through reply privately to author so I can take a closer look?

Thanks,
Anthony
Google Ads 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/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/01456b2d-a07d-40e2-9553-721fa54854dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zied Chaari

unread,
Mar 29, 2019, 4:26:56 AM3/29/19
to AdWords API and Google Ads API Forum
Hi Anthony,

How can I get my request and response?
I'm using Google Ads API (not Google AdWords API) and Fiddler can't catch the traffic coming from the API.
Fiddler can only catch request and response from AdWords API.

Thanks,
Zied

googleadsapi...@google.com

unread,
Mar 29, 2019, 3:31:15 PM3/29/19
to acteol...@gmail.com, AdWords API and Google Ads API Forum
Hi Zied,

You can find how Google Ads API calls are structured here and how the request and response look. You can find steps on how to enable logging from our client libraries. Here are steps on how to enable them through Java. Alternatively, if you can send me your requestId, that would help too.

Regards,
Anthony
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
Reply all
Reply to author
Forward
0 new messages