An excellent starting point for many applications, questionSearch finds open, resolved, or up-for-vote questions that include your search terms. Returned results include question, category, and user IDs, which are required by the getQuestion, getByUser, and getByCategory services.
http://answers.yahooapis.com/AnswersService/V1/questionSearch
See information on constructing REST queries
| Parameter | Value | Description |
|---|---|---|
| query | string (required) | Search terms. |
| search_in | string: omit for default "all". | Search for keywords in: "all", "question", "best_answer". |
| category_id | integer: omit for default to all categories | Search only in the specified category ID or IDs. (IDs may be seen in the request URLs when browsing Yahoo! Answers categories.) |
| category_name | string: omit for default to all categories (either this or category_id is required) | Search only in the specified category name or names. Will match against the full path to the English category name as found on the Yahoo! Answers site. Category names are case-sensitive and should be URL-encoded. Computers & Internet>Software, for example, looks like this: Computers+%26+Internet%3ESoftware. |
| region | string: omit for default "us". |
Filter based on country:
|
| date_range | string:omit for default "all". |
Filter based on date submitted:
|
| sort | string: omit for default "relevance". |
Sorting order of result set:
|
| appid | string (required) | The application ID. See Application IDs for more information. |
| type | string: omit for default "all" | Question status. Set to "all", "resolved", "open", or "undecided". |
| start | integer: default 0, max 1000 | Starting question to list, used to display further results. |
| results | integer : default 10, max 50 | Number of questions to be returned. |
| output | string: omit for default "xml" | Defines the output for the call. Accepted values are "xml", "json", "php", and "rss". |
| callback | string: default "" | If set, wraps the JSON object in call to the selected function. Only makes sense if output selected is JSON. |
Sample Request Url: http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=YahooDemo&query=cars
The schema document for this service response is located at http://answers.yahooapis.com/AnswersService/V1/QuestionResponse.xsd
| Field | Description |
|---|---|
| ResultSet | Contains all of the questions listed. |
| Question | Contain an individual question's data. Has attributes:
|
| Subject | The subject of the question |
| Content | The full question |
| Date | Pre-formatted date when the question was submitted |
| Timestamp | Unix timestamp for when the question was submitted |
| Link | Link to the question |
| Category | The Category that the question is listed under. Has attribute:
|
| UserId | The unique User id |
| UserNick | The nickname of the user |
| UserPhotoURL | User photo URL. |
| NumAnswers | The number of answers to the question |
| NumComments | The number of comments on the question |
| ChosenAnswer | The answer chosen by the user as the best |
| ChosenAnswererId | The user id of the chosen answerer |
| ChosenAnswererNick | The nickname of the chosen answerer |
| ChosenAnswererTimestamp | The time the answer was submitted |
| ChosenAnswererAwardTimestamp | The time the answer was given an award |
The following is a sample response for the query cars:
Yahoo! Web Search web services are limited to 5,000 queries per IP per day per API. See information on rate limiting and our Usage Policy to learn about acceptable uses and how to request additional queries.
The Yahoo! Answers Web Search services return the standard errors. There are no service-specific errors.
By applying for an Application ID for this service, you hereby agree to the Terms of Use