Skip to content

Convert a video to a 360 spin

By , Head of IntegrationsUpdated

Open this page in a new chat

Short answer

Convert a video to a 360 spin with POST /v2/files/video2spin. Choose the start and end time if you only wish to convert part of the video. Each call needs a bearer token and counts towards your hourly API limit. Below are the parameters, sample code in 9 languages and a sample answer.

After reading this you will know

  • How to convert a video to a 360 spin
  • Which parameters it takes
  • Sample code in 9 languages and a sample answer

This command needs a bearer token and counts towards your hourly limit.

POSThttps://api.sirv.com/v2/files/video2spin

Use this API method to create a 360 spin from a video file.

Choose the start and end time if you only wish to convert part of the video.

Request body (JSON)

FieldTypeRequiredExampleDescription
filenamestringYes/REST API Examples/video.mp4Path of the video to turn into a spin.
optionsobjectNoWhich part of the video to use, and how many frames the spin gets.
options.startnumberNo2Where in the video the spin starts, in seconds.
options.endnumberNo8Where in the video the spin ends, in seconds.
options.framesnumberNo32Up to 512.

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/files/video2spin', {
method: 'POST',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}`, 'content-type': 'application/json' },
body: JSON.stringify({
"filename": "/REST API Examples/video.mp4",
"options": {
"frames": 32
}
}),
});
console.log(res.status, await res.text());

Example response

{
"filename": "/REST API Examples/video/video.spin"
}
Back to top