'Getting Google Ads API keyword_plan_idea_error: The input has an invalid value

$requestOptionalArgs = [];
$requestOptionalArgs['keywordSeed'] = new KeywordSeed(['keywords' => $keywords]);
$keywordPlanIdeaServiceClient->generateKeywordIdeas([
                                'language' => ResourceNames::forLanguageConstant(1000), // English
                                'customerId' => $customerId,
                                'geoTargetConstants' => $geoTargetConstants,
                                'keywordPlanNetwork' => KeywordPlanNetwork::GOOGLE_SEARCH
                            ] + $requestOptionalArgs);

The above code is working fine if the $keywords array size is not more than 20. If I add the 21st keyword to the $keywords array then it's throwing the below error. keyword_plan_idea_error: The input has an invalid value.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source