Is there a way to find google search results for a

2019-07-17 05:58发布

I am looking for a way to find search results from google with javascript.

1条回答
Deceive 欺骗
2楼-- · 2019-07-17 07:01

Yes, you can use Google's api to fetch search result from Google.

But for that you have to get a API key from Google and then you can use google's api to fetch result.

Please check this official link to know example and more.

Here is an example http get request

https://www.googleapis.com/customsearch/v1?key=INSERT_YOUR_API_KEY&cx=017576662512468239146:omuauf_lfve&q=lectures

you can simply request these http get request from your javascript using ajax. In the above example you can replace the word lectures with the key word that you want to search.

You can find complete reference of using Javascript to request google's api here.

查看更多
登录 后发表回答