API
Get started with the Snipri API
Send videos to Snipri from your own code: the plans that include the API, making a key, a first request, and how every request and answer is shaped.
On this page
The Snipri API lets your own code do what the Studio does: send a long recording, let Snipri pick the moments worth clipping, and get the finished vertical clips back. A job made through the API is the same job the Studio makes. It is held to the same plan and counted the same way, and its clips land in My clips, where the editor works on them as on any other.
Who can use it
#The API comes with the Starter, Pro and Scale plans. There is no separate price for it: a job sent through the API uses your plan's videos, the same way a job started in the Studio does. The Free plan does not include it.
Plans and limits compares the plans, and How videos are counted says what a job uses.
Make a key
#- Open the account menu, your picture or initial at the far right of the top bar, and choose API.
- Type a name under Name a new key that says where the key will be used, such as the script or the server that sends it.
- Press Create key and copy the key at once. It is shown this one time and never again.
Create and revoke API keys covers keeping a key safe and revoking one you no longer use.
Make a first call
#Every request goes to https://www.snipri.com/api/v1 and carries your key in the Authorization header, after the word Bearer. With the key in SNIPRI_API_KEY, this one asks for your account:
curl https://www.snipri.com/api/v1/account \
-H "Authorization: Bearer $SNIPRI_API_KEY"The answer gives your plan, the videos it has left and the limits a job is held to:
{
"plan": {
"key": "pro",
"name": "Pro"
},
"videos": {
"allowance": 30,
"used": 4,
"held": 1,
"remaining": 25
},
"limits": {
"maxVideoSeconds": 10800,
"maxUploadBytes": 10737418240,
"jobsInProgress": 2
},
"jobsInProgress": 1
}A key that is missing, mistyped or revoked gets an error in place of the account. API errors and limits lists every error and what to do about it.
What you can do
#| Request | What it does |
|---|---|
GET /account | Your plan, the videos it has left and the limits a job is held to. |
POST /jobs | Makes a job from a link, queued at once, or from a file you upload next. |
POST /jobs/{id}/start | Queues a job made from a file, once the file is uploaded. |
GET /jobs/{id} | One job, with its clips and links to download them. |
GET /jobs | Every job on the account, newest first, a page at a time. |
Editing is not part of the API. A clip made through it opens in the editor like any other, so a change to its words, captions, framing or length is made there. Read the job again afterwards and its link gives the clip as it is now.
How requests and answers look
#- Requests and answers are JSON. A request with a body sends Content-Type: application/json.
- Times are in ISO 8601, in UTC. Lengths are in seconds and sizes in bytes.
- No answer is cached anywhere: each one carries Cache-Control: no-store.
The steps of a job
#- Send the video, as a link or as a file you upload next: Send a video through the API.
- Choose how it is clipped in the same request, as the Studio's settings do: Set clip options in an API request.
- Wait for it to end, by reading the job or by having Snipri post it to your server: Read jobs and clips through the API and Receive webhooks when a job ends.
- Download each clip from the link the job gives.