0

Getting a search.web quesry to work

I have just joined up to Yahoo to be able to use YQL to make web search requests.I have an appid as well.

But if I go to the console do do some test
http://developer.yahoo.com/yql/console/

This query doesnt work
select * from search.web where query="hello"
It gives the error
Cannot find required keys in where clause; got 'query', expecting required keys: (query, appid)


If I try to pass in my appid like this

select * from search.web where query="hello" and appid="MYAPPID"

It doesnt work either. I get this as the response
<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
yahoo:count="0" yahoo:created="2011-05-02T16:49:25Z" yahoo:lang="en-US">
<results/>
</query>





So my questions are:
What is the propblem?
How do I pass in my appid properly?
Can anyone show be an example of what the query should look like?

by
3 Replies
  • You are passing the appid in correctly in your query (just added appid='....' in the where clause). Perhaps there potentially might be an issue with the appid.

    A couple questions, how did you create your appid? How many characters long is your appid? To be clear a standard appid usable in BOSS (and thus the search.web table) should be 64 characters long and alphanumeric.

    You can generate one from this site:

    https://developer.apps.yahoo.com/wsregapp/

    and you can view your current appids here:

    https://developer.apps.yahoo.com/wsregapp/?view

    If you appid, shows up on those pages and is 64 characters long you should be able to use it in your search.web query.

    --Josh



    QUOTE (johnzakos77 @ May 2 2011, 08:51 AM) <{POST_SNAPBACK}>
    I have just joined up to Yahoo to be able to use YQL to make web search requests.I have an appid as well.

    But if I go to the console do do some test
    http://developer.yahoo.com/yql/console/

    This query doesnt work
    select * from search.web where query="hello"
    It gives the error
    Cannot find required keys in where clause; got 'query', expecting required keys: (query, appid)


    If I try to pass in my appid like this

    select * from search.web where query="hello" and appid="MYAPPID"

    It doesnt work either. I get this as the response
    <?xml version="1.0" encoding="UTF-8"?>
    <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
    yahoo:count="0" yahoo:created="2011-05-02T16:49:25Z" yahoo:lang="en-US">
    <results/>
    </query>





    So my questions are:
    What is the propblem?
    How do I pass in my appid properly?
    Can anyone show be an example of what the query should look like?
    0
  • Thanks Josh!
    I was using a short app id for some reason.
    With your link, I could generate a proper long key and it works like a charm.
    Thanks again for your response.

    QUOTE (The Josh @ May 3 2011, 03:53 PM) <{POST_SNAPBACK}>
    You are passing the appid in correctly in your query (just added appid='....' in the where clause). Perhaps there potentially might be an issue with the appid.

    A couple questions, how did you create your appid? How many characters long is your appid? To be clear a standard appid usable in BOSS (and thus the search.web table) should be 64 characters long and alphanumeric.

    You can generate one from this site:

    https://developer.apps.yahoo.com/wsregapp/

    and you can view your current appids here:

    https://developer.apps.yahoo.com/wsregapp/?view

    If you appid, shows up on those pages and is 64 characters long you should be able to use it in your search.web query.

    --Josh
    0
  • Hi Josh

    Have another question.

    Now that I have this working, I have been testing and have found that sometimes the results I get back from the API call are different from the results I get when I go and manually search via yahoo.com. For example, if you look at the top results from this API call

    http://query.yahooapis.com/v1/public/yql?q...CAaNuIsaMEU-%22


    They are different from this

    http://search.yahoo.com/search;_ylt=A0oG7l...-top&norw=1

    Yes, they have exactly the same query.

    Why is this happening? How can I ensure I get the same results?
    0

Recent Posts

in YQL