作者 lyh

gx

@@ -47,7 +47,13 @@ class RapIdApIService @@ -47,7 +47,13 @@ class RapIdApIService
47 */ 47 */
48 public function requestKeywordUrl($keyword){ 48 public function requestKeywordUrl($keyword){
49 $this->url = 'https://google-keyword-insight1.p.rapidapi.com/topkeys'; 49 $this->url = 'https://google-keyword-insight1.p.rapidapi.com/topkeys';
50 - $url = $this->url.'/?keyword='.$keyword.'&location=US&&lang=en'; 50 + $param = [
  51 + 'keyword'=>$keyword,
  52 + 'location'=>'US',
  53 + 'lang'=>'en'
  54 + ];
  55 + $query_string = http_build_query($param);
  56 + $url = $this->url.'/?'.$query_string;
51 return $this->curlGoogleApi($url); 57 return $this->curlGoogleApi($url);
52 } 58 }
53 59