2

I'm using Google CSE on my website and I want to have the search results display differently than the standard method. I've found this:

http://code.google.com/apis/customsearch/docs/snippets.html

I'm a little confused on the steps on how to style the results to my liking. I know that I have to create the structured data in my pages first (ie Pagemaps).

What does the second step mean though

"Fetch that structured data in the search results for your Custom Search Engine. The Custom Search server can return the search results, along with the structured data, in XML or JSON format. "

And for the third step, do I just copy the code provided in the Custom Search Element?

Thanks in advance

golf_nut
  • 431
  • 1
  • 4
  • 16

1 Answers1

0

"Fetch that structured data in the search results for your Custom Search Engine. The Custom Search server can return the search results, along with the structured data, in XML or JSON format. "

You don't need to fetch them yourself, I guess Indexing is meant with that. You can force Google to re-index your sites or upload a Pagemap directly through their service: https://developers.google.com/custom-search/docs/structured_data#pagemaphttp

After that you just request data from the JSON url:

https://www.google.com/cse?cx=[CSEID]&q=animal&output=xml&sort=myprivate12345-document-rating&pgmpk=myprivate12345

And for the third step, do I just copy the code provided in the Custom Search Element?

If you plan to use Javascript you best request the results in JSON. After that it is an Object in your code and you can style the hell out of it or do other things with it.

Thomas Theunen
  • 1,244
  • 9
  • 13