Yahoo! Answers: Get Questions By Category
getByCategory lists open, resolved, or up-for-vote questions in the category of your choice, and is a good data source for getQuestion and getByUser. Requires a category name or ID, which are returned by the questionSearch service, or may be found on the Answers site.
Request URL: GET
http://answers.yahooapis.com/AnswersService/V1/getByCategory
GET Request parameters
See information on constructing REST queries
| Parameter | Value | Description |
|---|---|---|
| appid | string (required) | The application ID. See Application IDs for more information. |
| category_id | integer (either this or category_name is required) | Category ID: matches the category ID seen in the request urls when browsing Yahoo! Answers categories. |
| category_name | string (either this or category_id is required) | Category Name: 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 |
| type | string: omit for default "all" | Question status. Set to "all", "resolved", "open", or "undecided". |
| region | string: omit for default "us". |
Filter based on country:
|
| sort | string: omit for default "date_desc" |
Result set sort field and order
|
| start | integer: default 0 | 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 using Category ID: http://answers.yahooapis.com/AnswersService/V1/getByCategory?appid=YahooDemo&category_id=396545664
Sample Request using Category Name: http://answers.yahooapis.com/AnswersService/V1/getByCategory?appid=YahooDemo&category_name=Computers+%26+Internet%3ESoftware
Both of these should show the last few questions from Computers & Internet > Software.
Response fields
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 |
Sample response
The following is a sample response for category Computers & Internet > Software:
Rate Limits
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.
Errors
The Yahoo! Answers Web Search services return the standard errors. There are no service-specific errors.
Ready to get started?
By applying for an Application ID for this service, you hereby agree to the Terms of Use

