Category Lookup
Category Lookup
Documentation
API Overview
This API is used to retrieve a standardized list of recipe categories. By making a POST request, the system will return a string array containing various category names (e.g., “Pigeon”, “Sichuan Cuisine”), helping developers quickly establish a content indexing foundation.
Use Cases
- Content Management Systems: Provide an initial category tag library for food blogs or apps.
- Search Filter Optimization: Build category options for frontend filters to improve user search efficiency.
- Data Standardization: Unify classification criteria for recipe data from different sources, facilitating subsequent data analysis.
Request and Response Details
- Request Method: POST
- Request Path:
/v1/cookbook-type - Input Parameters: The current version does not require specific business parameters; simply initiate a request to get the full or default category set.
- Response Structure: A JSON array where elements are of string type. For example,
["Pigeon", "Home Cooking"], each element represents a specific category name.
Integration Recommendations
- Caching Strategy: Since category data is relatively stable, it is recommended for the frontend or backend to implement local caching (e.g., with a TTL of 24 hours) to reduce unnecessary API calls.
- Error Handling: Please properly handle network timeouts or cases where an empty array is returned, ensuring fallback logic for frontend display.
- Data Mapping: The returned category names may need to be mapped to internal database IDs. It is recommended to establish a lookup table during the initial integration phase.
Integration Examples
Includes ready-to-use Shell, Python, Go, Java, and PHP examples for direct integration.
Request Example
{}Response Example
[
"鸽子"
]Request Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | object |
| properties | object | {...} |
Response Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | array |
| items | object | {...} |
| items.type | string | string |
| items.example | string | 鸽子 |
| example | array | "鸽子" |
| example[] | string | 鸽子 |