Developer resources

How to Import Vimeo Videos into DynTube

A server-side migration can ask Vimeo for an authorized downloadable source URL and submit that URL to DynTube's URL-upload endpoint. Run the transfer only for videos you own or are permitted to migrate, and keep both providers' credentials outside browser code.

Prepare the migration

  1. Create a Vimeo access token with the permissions required to read your videos and download sources.
  2. Create a DynTube API key and store both credentials in a server-side secret manager.
  3. Choose the target DynTube project and decide how Vimeo title, description, tags, and privacy should map.
  4. Create a migration record keyed by Vimeo video ID so retries do not create accidental duplicates.
  5. Start with one representative video and verify its output before processing the library.

Transfer one video from a trusted worker

Node.js
const vimeoId = process.argv[2];
const vimeoToken = process.env.VIMEO_ACCESS_TOKEN;
const dynTubeKey = process.env.DYNTUBE_API_KEY;

const vimeoResponse = await fetch(`https://api.vimeo.com/videos/${vimeoId}`, {
  headers: { Authorization: `Bearer ${vimeoToken}` },
});
if (!vimeoResponse.ok) throw new Error(`Vimeo request failed: ${vimeoResponse.status}`);

const video = await vimeoResponse.json();
const source = [...(video.download ?? [])]
  .filter((file) => file.link && file.type === "video/mp4")
  .sort((a, b) => (b.width ?? 0) - (a.width ?? 0))[0];
if (!source) throw new Error("No permitted MP4 download is available for this video");

const form = new FormData();
form.set("url", source.link);
form.set("title", video.name ?? `Vimeo ${vimeoId}`);

const uploadResponse = await fetch("https://upload.dyntube.com/v1/videos", {
  method: "POST",
  headers: { Authorization: `Bearer ${dynTubeKey}` },
  body: form,
});
if (!uploadResponse.ok) {
  throw new Error(`DynTube upload failed: ${uploadResponse.status} ${await uploadResponse.text()}`);
}

const created = await uploadResponse.json();
console.log({ vimeoId, dynTubeVideoId: created.videoId, uploadId: created.uploadId });

Vimeo download links are permission-dependent and can be temporary, so submit each source soon after obtaining it. DynTube's URL upload returns identifiers for the accepted transfer; acceptance starts processing rather than proving that every rendition is already published.

Make a library migration reliable

  • Persist Vimeo ID, DynTube video ID, upload ID, attempt count, and final status.
  • Check the migration record before every retry and resume incomplete work instead of submitting blindly.
  • Limit concurrency and retry temporary provider or network failures with backoff.
  • Poll DynTube video status or consume configured webhooks before marking a video ready.
  • Compare duration, title, thumbnail, captions, audio, and playback for a sample from each source format.

Complete the move

After processing, apply the intended DynTube project settings, security, player, captions, and metadata. Update your application embeds only after the corresponding DynTube video is published and verified. Keep the original migration map so individual assets can be traced and corrected without repeating the full transfer.

Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.