This endpoint allows you to search for communities using keywords and various filters.
Search Communities
GEThttps://api.whisk.com/community/v2/search
You can append the following query parameters to the base URL to search communities:
Query Parameters
Name
Type
Description
query
string
Keywords to match communities.
filter_diets
array
A list of available diet labels to choose from for filtering search results.
You can choose one or more of these diet labels:
- DIET_VEGETARIAN
- DIET_VEGAN
- DIET_OVO_VEGETARIAN
- DIET_LACTO_VEGETARIAN
- DIET_OVO_LACTO_VEGETARIAN
- DIET_PESCATARIAN
- DIET_KETOGENIC
- DIET_DETOX
- DIET_PALEO
- DIET_DAIRY_FREE
- DIET_GLUTEN_FREE
filters.cuisines
array
A list of available cuisine labels to choose from for filtering search results.
You can choose one or more of these cuisine labels:
- CUISINE_AFRICAN
- CUISINE_AMERICAN
- CUISINE_ASIAN
- CUISINE_AUSTRALIAN
- CUISINE_BRITISH
- CUISINE_CAJUN_AND_CREOLE
- CUISINE_CANADIAN
- CUISINE_CARIBBEAN
- CUISINE_CHINESE
- CUISINE_CUBAN
- CUISINE_EASTERN_EUROPEAN
- CUISINE_EUROPEAN
- CUISINE_FRENCH
- CUISINE_GERMAN
- CUISINE_GREEK
- CUISINE_INDIAN
- CUISINE_ISRAELI
- CUISINE_ITALIAN
- CUISINE_JAPANESE
- CUISINE_KOREAN
- CUISINE_LATIN_AMERICAN
- CUISINE_MEDITERRANEAN
- CUISINE_MEXICAN
- CUISINE_MIDDLE_EASTERN
- CUISINE_MOROCCAN
- CUISINE_PORTUGUESE
- CUISINE_SOUTHERN
- CUISINE_SPANISH
- CUISINE_TEX_MEX
- CUISINE_THAI
- CUISINE_VIETNAMESE
- CUISINE_WORLD_CUISINE
filters.meal_types
array
A list of available meal type labels to choose from for filtering search results.
You can choose one or more of these meal type labels:
- MEAL_TYPE_APERITIF
- MEAL_TYPE_APPETIZERS
- MEAL_TYPE_BEVERAGES
- MEAL_TYPE_BREADS
- MEAL_TYPE_BREAKFAST
- MEAL_TYPE_BRUNCH
- MEAL_TYPE_COCKTAILS
- MEAL_TYPE_CONDIMENTS_AND_SAUCES
- MEAL_TYPE_DESSERTS
- MEAL_TYPE_DINNER
- MEAL_TYPE_JUICES
- MEAL_TYPE_LUNCH
- MEAL_TYPE_MAIN_COURSE
- MEAL_TYPE_SALADS
- MEAL_TYPE_SIDE_DISHES
- MEAL_TYPE_SMOOTHIES
- MEAL_TYPE_SNACKS
- MEAL_TYPE_SOUPS_AND_STEWS
filters.ingredients
array
One or more ingredients to filter search results. This parameter takes each ingredient as a separate value. For example, to add butter and milk to the ingredients filter, your URL should look something like this: "https://api.whisk.com/community/v2/search?filters.ingredients=butter&filters.ingredients=milk"
filters.apply_user_preferences
boolean
Determines if the search should consider the user preferences for finding communities.
When set to True, it takes user preferences like - diets, disliked ingredients, etc.,
into account while searching for communities and ordering the search results based on relevance.
sorting.by
string
Determines if the search results should be sorted by a particular attribute. You can use one of these available values:
- SEARCH_SORT_INVALID
- SEARCH_SORT_BY_NAME
- SEARCH_SORT_BY_CREATED_AT
sorting.direction
string
Determines the sorting order of the search results when the sorting.by parameter is being used. You can use one of these available values:
- SORTING_DIRECTION_INVALID
- SORTING_DIRECTION_ASC
- SORTING_DIRECTION_DESCNote: The sorting parameters can be left to their default value SEARCH_SORT_INVALID and SORTING_DIRECTION_INVALID to sort the search results based on relevance.
paging.limit
string
The maximum number of communities to retrieve.
paging.cursors.after
string
This parameter is used for cursor-based pagination. It takes a community ID as its value and performs a search on only those communities that appear after it in the database.
paging.cursors.before
string
This parameter is used for cursor-based pagination. It takes a community ID as its value and performs a search on only those communities that appear before it in the database.
fields
array
Any additional community details to retrieve. You can choose one or more of these supported values:
- COMMUNITY_FIELD_DESCRIPTION
- COMMUNITY_FIELD_TOPICS
- COMMUNITY_FIELD_SOCIAL_SETTINGS
- COMMUNITY_FIELD_PERMISSIONS
- COMMUNITY_FIELD_MEMBERS_COUNT
- COMMUNITY_FIELD_RECIPES_COUNT
- COMMUNITY_FIELD_SPONSOREDNote: For performance reasons, we recommend using this parameter only when required.
Headers
Name
Type
Description
Authentication
string
User token to authorize the API usage. For more information, see Authentication.
{"error_code":"REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION","message":"Additional details about error are not static and can be changed"}
{"code":"auth.tokenNotFound"}
This is unexpected response, something is wrong on our side, please contact:[email protected]
Here are a few examples of communities search:
Example 1 - Top 3 Oldest Vegan Communities on Whisk
Let's assume that you need to find the top 3 oldest vegan communities on Whisk. You can find it easily using a combination of filter.diets, sorting.by, sorting.direction and paging.limit parameters.
Here is how a curl request would look and the sample response you may get:
With time, the response results may differ due to the activity that may have happened on the Whisk platform.
curl -X GET "https://api.whisk.com/community/v2/search?filters.diets=DIET_VEGAN&sorting.by=SEARCH_SORT_BY_CREATED_AT&sorting.direction=SORT_DIRECTION_ASC&paging.limit=3"
-H"Accept: application/json"-H"Authorization: Bearer <YOUR-API-ACCESS-KEY>"
Whisk allows you to discover and understand its API capabilities on the Swagger interface with the ability to try out the API calls directly in your browser. You can call this endpoint here.
Note: To understand the data structure of a community definition, see Community Object.
Example 2 - Communities for Asian Cuisine containing Seafood recipes
Let's assume that you want to find communities created specifically for Asian cuisine and has Seafood recipes. Additionally, for each community found, you would like to retrieve its Description and Recipe Count. You can perform this search using the query, filters.cuisines and fields parameters.
Here is how a curl request would look and the sample response you may get:
Note: With time, the response results may differ due to the activity that may have happened on the Whisk platform.
curl -X GET "https://api.whisk.com/community/v2/search?query=seafood&filters.cuisines=CUISINE_ASIAN&sorting.by=SEARCH_SORT_BY_INVALID&sorting.direction=SORT_DIRECTION_INVALID&fields=COMMUNITY_FIELD_DESCRIPTION&fields=COMMUNITY_FIELD_RECIPES_COUNT"
-H"Accept: application/json"-H"Authorization: Bearer <YOUR-API-ACCESS-KEY>"
Whisk allows you to discover and understand its API capabilities on the Swagger interface with the ability to try out the API calls directly in your browser. You can call this endpoint here.
{"communities": [ {"community": {"id": "375bc4135e784d6d80b5cd8b6db65ffe","name": "Barramundi recipes","description": "Mild tasting Asian sea bass is the perfect versatile fish to try out with these recipes","recipes": {"count": 18 } } }, {"community": {"id": "c62d83682c644144989cffc8813692c4","name": "Contemporary Asian","description": "Vietnamese, Japanese, Malaysian and many other asian cuisine staples with a modern twist","recipes": {"count": 20 } } }, {"community": {"id": "96e140fec4da4a1485e5aadcccad6808","name": "The Taste Of Asia","description": "Popular Asian cuisine recipes ","recipes": {"count": 20 } } }, {"community": {"id": "b37ecdecb5d34990ad24a27ef6cdbeb0","name": "Asian cravings","image": { "url": "https://whisk-res.cloudinary.com/image/upload/v1611022873/community/cde7d6a5a56b843a45ac81fb28b4e299.jpg",
"width": 1000,"height": 686 },"recipes": {"count": 9 } } }, {"community": {"id": "013acb8e9fc84c64afedc6c770de9908","name": "Xanthe’s Food Book","image": { "url": "https://whisk-res.cloudinary.com/image/upload/v1601322812/community/1ea6efb30c8c53cd003c0c042cfff416.jpg",
"width": 1280,"height": 1707 },"description": "Asian, Fusion, Mediterrean and Mexican food","recipes": {"count": 26 } } } ],"paging": {"cursors": {} }}
Note: To understand the data structure of a community definition, see Community Object.
Example 3 - Communities for Salad Recipes filtered by User Preferences
Let's assume that you want to find communities created for Salad recipes containing one or more recipes that include Chicken Breast as an ingredient. Additionally, you would also like the search to consider your User Preferences while filtering communities. You can perform this search using the filters.meal_types, filters.ingredients and filters.apply_user_preferences parameters.
Here is how a curl request would look and the sample response you may get:
Depending on your user preferences and time, the results in the response may differ.
curl -X GET "https://api.whisk.com/community/v2/search?filters.meal_types=MEAL_TYPE_SALADS&filters.ingredients=chicken%20breast&filters.apply_user_preferences=true&sorting.by=SEARCH_SORT_BY_INVALID&sorting.direction=SORT_DIRECTION_INVALID"
-H"Accept: application/json"-H"Authorization: Bearer <YOUR-API-ACCESS-KEY>"
Whisk allows you to discover and understand its API capabilities on the Swagger interface with the ability to try out the API calls directly in your browser. You can call this endpoint here.