⚡Running glifs via the API
The Glif API is unstable and in beta, but we’re excited to see what y'all build.
To get started, create your API tokens on https://glif.app/settings/api-tokens
The API is currently subject to the same limits as user accounts, you can purchase more credits at https://glif.app/pricing. see FAQ details. This is all subject to change without notice.
If you're building with our API, please join our Discord or get in touch since we'd love to chat and learn more about what you're building. For selected apps we can extend a higher rate limit during this free testing period.
We ask that you include “powered by glif.app” and a link to glif.app within the UI of your integration. Please use a Glif logo badge in the zip file below.
Running glifs using the Simple API
curl -X POST -H "Authorization: Bearer abzfasdf2349820349" -d '{"id": "clgh1vxtu0011mo081dplq3xs", "inputs": ["cute friendly oval shaped bot friend"]}' https://simple-api.glif.app
Here’s the expected output of that command:
{
"id": "clgh1vxtu0011mo081dplq3xs",
"inputs": { "node_6": "cute friendly oval shaped bot friend" },
"output":"https://res.cloudinary.com/dzkwltgyd/image/upload/v1686242317/glif-run-outputs/fhbvbp9bwf0pkmm4woj2.png",
"outputFull": { "...": "..." },
"price": "2.1000875",
"nodes": [{"...": "..."}]
}
You're most likely interested in the output
field, which is the final output of the glif.
outputFull
is a JSON object with more info about the final output, including it's type.
If there’s an error it’ll be in an error
field, but the response will have a "200 OK" status code. For legacy reasons the the Simple API always returns 200 OK. This might change in the future.
price
tells you how many credits a run took.
nodes
is the output of each individual block inside the workflow (e.g. including inputs, Combiners, WebFetchers, etc)
Parameters
id
You can put the glif id in the url:
https://simple-api.glif.app/clgh1vxtu0011mo081dplq3xs
Or put it in the body:
{
"id": "clgh1vxtu0011mo081dplq3xs",
"inputs": ["..."]
}
inputs
for now only string values are allowed
You can either use a positional array:
{
"inputs": ["a happy horse", "living on a farm", "in France"]
}
Or name your parameters. The names have to correspond to your glif-block names. If you don't know the block names, check out Looking up the internal names of a glif's inputs.
{
"inputs": {
"param1": "a happy horse",
"param2": "living on a farm",
"param3": "in France"
}
}
visibility
You can set the visibility of the glif to PUBLIC
or PRIVATE
. This is optional, and defaults to PRIVATE
.
{
"visibility": "PUBLIC"
}
So, an example request with the parameter looks like:
{
"id": "clfmq1j1d0000jz080d9glh7v",
"visibility": "PUBLIC"
}
Looking up the internal names of a glif's inputs
To specify named parameters, you need to use the internal block name. This has no spaces and usually is something like "text1", "multipick2", but each glif creator can customize it.
On the glif.app website you can look at the block names in the "View source" page of a glif, like this one:

Or you can look at the nodes
field of a glif's data via our API:
https://glif.app/api/glifs?id=clkbasluf0000mi08h541a3j4 This glif has blocks with the names:
username
ego
radmilk
text1
Lastly, you can use the commandline to fetch field names dynamically using curl
+ jq
:
curl -s https://glif.app/api/glifs?id=clmdnx8fa0000lf0fbovo8lv1 | jq -r '.[] .data .nodes[] .name'
here's the output:
input1
image1
meaning this glif requires two inputs, input1
and image1
. We plan to improve this in the near future.
⚠️ Strict mode and default glif input value substitution
If you do not provide enough inputs, the default values in the glif values will be automatically substituted.
So if you specify arg1, that'll be used, but if it requires arg1 and arg2, it'll use your arg1 but use the defualt value for arg2.
If you'd prefer to have API calls with insufficient inputs to fail, append ?strict=1
to your URLs, e.g. https://simple-api.glif.app?strict=1
⚠️ CORS (cross-origin requests)
CORS is allowed by the Simple API, but not by our other API endpoints. You'll need to make your own serverside wrappers for these cases.
Last updated