how to get google custom search result in json array
10,228
If you want a custom search result.
Please read Custom Search Engine (free)
of Google at:
And go to link to create your custom search:
Or
You should go to:
Click to link: Try this API in APIs Explorer
Insert your parameter:
- "https://www.googleapis.com/customsearch/v1?"
- "q=" + keyword (example: "Paris+Hilton")
- "&cx=" + cx code of your CSE
- "&key=" + your authorised API key [In link API project, click:
A project is needed to enable APIs
+Create project
, then go to 'APIs & auth' and activate in 'Custom Search API'] - "num=" + Number of search results to return (integer)
Press Execute
to show a result with format JSON.
![Nisarg](https://i.stack.imgur.com/h2Q4v.jpg?s=256&g=1)
Author by
Nisarg
Updated on June 09, 2022Comments
-
Nisarg about 2 years
I want to get google search results as json arrays in google latest custom search.
How to implement the code.
For Example :
{ "responseData": {` ` "results": [ { ` ` "GsearchResultClass ": "GwebSearch", "unescapedUrl": "http:/ / en.wikipedia.org/wiki/Paris_Hilton", "url" : "http :// en.wikipedi a.org/wiki/Paris_Hilton", "visibleUrl " : "en.wikipedia .org", "cacheUrl " : "http://www.google.com/search?q=cache:TwrPfhd22hYJ:en.wikipedia.org", "title": "< b>Paris Hilton</b > - Wikipedia, the free encyclopedia", "titleNoFormatting": "Paris Hilton - Wikipedia, the free encyclopedia", "content": "[1] In 2006, she released her debut album..." }, { "GsearchResultClass": "GwebSearch", "unescapedUrl": "http://` `www.imdb.com/name/nm0385296/", "url": "http://` `www.imdb.com/name/nm0385296/", "visibleUrl": "www.imdb.com", "cacheUrl": "http://www.google.com/search?q=cache:1i34KkqnsooJ:www.imdb.com", "title": "<b> Paris Hilton</b>", "titleNoFormatting": "Paris Hilton", "content": " Self: Zoolander. Socialite <b>Paris Hilton</b>..." } ]
-
Admin almost 8 yearsI got the result. But there is only showing few results. How to increase the showing counts of search result.
-
Ave almost 8 yearsAt
num
fields in console.developers.google.com/apis/api/customsearch/overview will return the number of search results. Please increase this values to get number result from your want.