Overview
Last updated
Was this helpful?
Last updated
Was this helpful?
Graph API is the recommended way of interacting with the Whisk Platform. It is made as HTTP-based API, heavily inspired by Facebook Graph.
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 .
All requests are passed to the API at graph.whisk.com
.
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:
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:
You can search over multiple types with the /search
endpoint:
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.
It will return a response for each id or URL like this:
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.
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:
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 recipes
can accept maximum 25 of them