Fancy embedded web search for your web site? It’s easy as pie with JSON!

It is great if a company offers their data to developers to use on their own sites. It is even better when it is pretty painless to embed this data into your own products. Nearly all of the Yahoo! services also offer a REST API to use results of searches in your own web sites - the difference to a lot of other services is that you could also have the data in JSON format rather than XML.

What this means? You don’t really need any Ajax trickery to use the data, a simple SCRIPT tag is enough.

Find out more about Embedded Dynamic Web Search Forms with JSON

This will probably be a first in a series of tips and tricks with the Y! APIs.

10 Responses to “Fancy embedded web search for your web site? It’s easy as pie with JSON!”

  1. Nick Says:

    cool way to build up a search engine form. BUt how it is possible to insert the other results pages list (1 2 3 4 etc.) ? i mean, in your code you can display just 10, 20, or whatever you want number of results, but you can’t go to page 2 or pages 3 etc…

  2. Chris Heilmann Says:

    I’ll work on a version…

  3. micr Says:

    Have A Nice Day!

  4. Portrait Photography Says:

    I’m building online photo albums and in building those sites, I’m including some gallery profile of other art galleries – of course with their permission. Which of your scripts would work well for this purpose?

    Are your scripts legal? Don’t they possess any hacking property?

    John

  5. Chris Heilmann Says:

    What is a hacking property? And what data do you try to include (which format does it come in)? My guess would be DOMinclude could help you…

  6. Paul Smith Says:

    Nice tutorial; thanks - I was underwhelmed with Yahoo Search’s own (public) documentation.
    I’ll probably figure this out but, if you get this soon could you tell me: how do you handle the Rating output? It’s not well explained on Yahoo Developer site.

  7. Paul Smith Says:

    Re: “how do you handle the Rating output?” never mind; I needed to look at the json output more closely - Rating.AverageRating was what I needed.

  8. MadWizards inc. Says:

    Good stuff, but I cant use it after it was brought to my attention that yahoo censor Ron Paul, its the same with google video. Too bad, good tutorial, will look for something else.. I hope Yahoo turns around and allow free speech…

  9. denis Says:

    Hi there,
    thanks for the samples.

    I want ask … some times, when is too much trafic, i receive like time out, no results arrive.
    Do you know why please ? can i have some parm to whait more ?
    I used this sample:
    http://icant.co.uk/sandbox/jsonsearch/searchFormJSON.html

    Thanks in advance

  10. Frugi Says:

    Your tutorial was a really useful find. I’ve adapted some of your ideas in order to incorporate Wikipedia links in one of my sites. Especially handy was how to append the new script url into the head, as I just couldn’t work that one out. Many thanks.

Leave a Reply

Wait till I come! is the blog of , a developer evangelist living and working in London, England. Download vcard.

Feed me, Seymour: Entries (RSS) and Comments (RSS).