Whisk Docs
Whisk HomeHelp CenterDeveloper Tools
v1.0.0
v1.0.0
  • Overview
  • Guides
    • Creating An Account
    • Getting Started
    • Whisk Sandbox
  • API
    • Authentication
      • Server Token
      • Client Token
      • User Access Token
      • Anonymous Access
    • Recipes
      • Get Recipe
      • Get Recipe Categories
      • Recipe Objects
    • Recipe Discovery
      • Recipe Feed
      • Recipe Search
      • Get Similar Recipes
    • Shopping Lists
      • Get Shopping Lists
      • Create A Shopping List
      • Add Items To A Shopping List
      • List Analysis
    • Meal Plans
      • Meal Plan Management
      • Delete Meals
      • Auto-Generator
      • Error Handling
    • Retailers
      • Get Available Stores
      • Retailers Checkout Flow
      • Retailer Aliases
      • OAuth Retailer Flow
      • Retailer User Info
      • Search Store Items
    • Carts
      • Create a Cart
      • Update Cart Item
      • Splitting Combined Items
      • Add Items To Cart
      • Add Recipes To Cart
      • Get Cart Item Options
      • Swap Cart Item Product
      • Delete A Cart Or A Cart Item
      • Checkout
    • Users
      • Get A User
      • Update A User
    • User Recipes & Collections
      • Add User Recipe
      • Create A Recipe
      • Update External Recipe
      • Get All User Recipes
      • Update User Recipe
      • Remove Recipe from Favorites
      • Create Collection
      • Get All User Collections
      • Get Collection
      • Get Recipes from a Collection
      • Remove Collection
    • Tools
      • Autocomplete
  • Shopping List SDK
    • Overview
    • Examples
      • Shoppable Recipes
      • Shoppable Products
      • Shoppable Media
    • Basic Setup
      • Basic Setup
      • Methods
      • Event Listeners
      • Widget
      • Subscriptions
      • Global Configuration
      • UTM Parameters
      • Using With SPA
  • Shopping List Mobile API
    • Overview
    • Examples
    • Reference
  • Tips and Tricks
    • Object IDs
    • URL Lookup
    • Searching
    • Multiple IDs request
  • Resources
    • Nutrients
    • Recipe Labels
    • Health Score, Glycemic Index, Glycemic Load
    • Whisk User Data
    • Supported Retailers
    • Optimizing Image Load
Powered by GitBook
On this page
  • The Basics
  • The Graph API
  • Object IDs
  • URL Lookup
  • Searching
  • Multiple IDs request
  • Cursor Pagination
  • Limits

Was this helpful?

Overview

NextCreating An Account

Last updated 4 months ago

Was this helpful?

The v1 docs are here for reference to the older API. We are currently in the process of making changes to the for new features.

Graph API is the recommended way of interacting with the Whisk Platform. It is made as HTTP-based API, heavily inspired by Facebook Graph.

The Basics

Whisk Graph is composed of:

  • nodes - "things" like Recipe, User, Food, etc.

  • edges - connections between nodes (Recipe includes multiple Food items)

  • fields - details of node (Recipe instructions, urls)

The Graph API is HTTP-based, so it works with any language that has an HTTP library, such as cURL.

Most Graph API requests require the use of .

The Graph API

All requests are passed to the API at graph.whisk.com.

Object IDs

Each node has a unique ID that is used to access it via the Graph API. Here's how you'd use the ID to make a request for a node:

curl "https://graph.whisk.com/v1/10343992" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer <Access-Token>"

URL Lookup

Most objects can be discovered using their IDs, but sometimes you have the only the URL of a resource. A canonical example is getting or extracting Recipe by url:

curl "https://graph.whisk.com/v1/?id=https%3A%2F%2Fwww.bbcgoodfood.com%2Frecipes%2Fomelette-pancakes-tomato-pepper-sauce" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <Access-Token>"

Searching

You can search over multiple types with the /search endpoint:

curl "https://graph.whisk.com/v1/search?q=salmon&type=recipe&diet=paleo" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <Access-Token>"

Multiple IDs request

We provide a convenient way to get a batch of different nodes. You can provide ?ids parameter with the object IDs of those nodes. You also can use URLs with node ids simultaneously.

curl "https://graph.whisk.com/v1/?ids=10343992,https%3A%2F%2Fwww.bbcgoodfood.com%2Frecipes%2Fegg-fried-rice" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <Access-Token>"

It will return a response for each id or URL like this:

{
  "10343992": {
    "field": "..."
  },
  "https://www.bbcgoodfood.com/recipes/egg-fried-rice": {
    "field": "..."
  }
}

Cursor Pagination

Some of our endpoints provide cursor-based pagination. A cursor is a random string which points to a specific item in a list of data. A string pointed to an element can be changed in future. Therefore, your app should not store cursors.

curl "https://graph.whisk.com/v1/products/autocomplete?language=en&limit=5&after=eyJpZCI6IlBPUksgQkFCWSBCQUNLIFJJQiIsImluZGV4Ijo5fQ==" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <Access-Token>"

A result will contain segment with pagination which includes cursors to the first and the last item in the result. Reference will be empty if there are no elements before or after cursor.

Example of a segment with cursors:

{
  "after": "eyJpZCI6IkNISUEgU0VFRFMiLCJpbmRleCI6MTR9",
  "before": "eyJpZCI6IkdSQU5PTEEiLCJpbmRleCI6MTB9"
}

Limits

Some of our endpoints have limits:

  • POST /carts/checkout, POST /lists, POST /carts and other endpoints accepting items can accept maximum 50 of them

  • POST /carts/checkout, POST /lists, POST /carts and other endpoints accepting recipescan accept maximum 25 of them

v2 documentation
access tokens