Advertisement:

Author Topic: Google Custom Search - JSON API Integration****??  (Read 215 times)

flyers123

  • Newbie
  • *
  • Posts: 21
Google Custom Search - JSON API Integration****??
« on: April 25, 2019, 05:13:54 am »
Hi All,

Thank you for stopping by if you are reading this topic.

Re: Zara Theme - Osclass 3.8 - JSON API Integration (Customized Google Search Results) - 2 Images Attached

What I'm asking is very simple, let me break it down for you

User puts their search query on "https://google.com.au" search box - for example "corgi puppies nsw"

The user is then directed to my website "https://koaas.com/for-sale/animals" followed by search string "corgi puppies nsw" after the word animals

Then it should display the results related to "corgi puppies nsw" on my website.

The results should then appear as if someone searched for "corgi puppies nsw" in my website search box.

Can you please help me understand if this is possible?

Is it done through JSON API integration?

Is it possible to integrate on my website?


I have been searching online for the past few months with no answer to match my questions.

I have attached the images to illustrate what I'm asking with search results appearing on Gumtree website.

Thank you in advance for any help or suggestions?
« Last Edit: April 25, 2019, 05:19:18 am by flyers123 »

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Google Custom Search - JSON API Integration****??
« Reply #1 on: April 25, 2019, 10:27:15 am »
1. without api

Quote
User puts their search query on "https://google.com.au" search box - for example "corgi puppies nsw"

Your example with gum site is that they have provided search pages or search templates, which are later indexed by Google, so all that is already a pre-made search preset. There is no api involved here.

If we would like to implement this in generic cases (no presets), first problem is that Google very rarely provides search keywords, so you cannot achieve this effectively for all users, all search cases, etc. Anyone searching on Google as an ordinary user (e.g. in their browser), with or without specific site, is not going to work in most cases, because there is no data to work with in the first place! Also, google shows only indexed pages, not general search links (they are low quality), keep this in mind, but exceptions for established domains obviously differ from this example. It will either return item page, or category page containing something that matched what user wants, not what you think user would search on your site. Again, unless you make some presets and make them index-able, and Google indexes them in the end.

Quote
The user is then directed to my website ... (subcategory)

Another problem (still elaborating on generic non-preset cases): as explained in above paragraph, this will require that Google passes search keywords (which Google doesn't most of the time, for various reasons: user privacy, business factors) and you need logic at your end to figure out this subcategory correctly, too. So, we are back at simple search examples and indexing.

2. with api

It is possible to integrate custom google search ON your site with this method, but users are already there - on your website, not google.com/search.

You will need to code things and integrate them very tightly within your osclass (e.g. plugin) and theme (search results display and interaction), also, you will have to treat it separate from internal Osclass search, you can't* mix and match those easily, because results from Google may be completely different e.g. there is no way to later apply 'internal' custom fields, price filtering, location etc. on search results from google results unless structuring your data if you wish to utilize later google filtering etc. and work on returned json data. It is completely separate from internal search (unless you somehow construct your own search object from google results equivalent to Osclass internal one and later allow mix and match with internal filters, which is a lot of coding). Also, keep in mind G pricing, which is very limited in number of free daily searches (requires payment beyond that).

In summary, this can get very complicated beyond simple search, and this is not what you asked and it will not provide functionality you are seeking at all!
« Last Edit: April 25, 2019, 10:35:35 am by dev101 »

flyers123

  • Newbie
  • *
  • Posts: 21
Re: Google Custom Search - JSON API Integration****??
« Reply #2 on: April 25, 2019, 01:42:07 pm »
Thank you for your response

Do the categories in Osclass have the ability to be indexed in google search results? similar to individual ads. How can I add meta tag and description to categories?

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Google Custom Search - JSON API Integration****??
« Reply #3 on: April 25, 2019, 01:44:57 pm »
Yes, if not empty they are indexable by default.
Description is added in category settings.