Skip to Content
🎉 Four new video automation code examples landed in our GitHub repo. Check them out →

Examples

This section points to practical code samples and integration patterns for using Plainly’s REST API for various tasks. Each example includes a brief description and a link to the relevant documentation for further details.

The source code and setup instructions for all examples can be found on the @plainly-videos/video-automation-examples  GitHub repository.

Render and webhook

The purpose of this example is to demonstrate the render only integration approach using the Renders API and webhook handling. It covers the following topics:

  • Creating video render jobs via the Plainly API
  • Setting up webhook endpoints to receive render completion notifications
  • Database integration to track render status and results
  • User interface for managing video generation requests

Check the detailed guide in the Plainly examples GitHub repository .

MCP AI Crypto video agent

The purpose of this example is to demonstrate how to build an AI-powered video generation agent using Plainly’s MCP server  alongside other MCP servers. The example uses Crypto Data MCP server as data source and covers the following topics:

  • Setting up both the Plainly MCP server and the Crypto Data MCP server
  • Creating an OpenAI agent that interacts with both MCP servers and with users
  • Generating videos based on cryptocurrency data fetched from the Crypto Data MCP server

Check the detailed guide in the Plainly examples GitHub repository .

Batch render

The purpose of this example is to demonstrate rendering multiple videos in a single request using the Batch Renders API. It covers the following topics:

  • Creating multiple renders with a single Batch Renders API request
  • Tagging every render with custom attributes to match renders back to the input data
  • Polling the batch renders until they are finished, without webhooks or a database
  • Keeping the API key on the server using server functions

Check the detailed guide in the Plainly examples GitHub repository .

Dynamic video ads

The purpose of this example is to demonstrate dynamic creative for video advertising, where one template produces many ad variants with a different hook, products, prices and call to action. Every variant is rendered in 16:9, 9:16 and 1:1 aspect ratios using the Renders API. It covers the following topics:

  • Rendering one ad in multiple aspect ratios, one template rendered per format
  • Finding the template for each format from the project templates
  • Tagging renders with custom attributes and finding them again with the attribute filter

Check the detailed guide in the Plainly examples GitHub repository .

Personalized videos

The purpose of this example is to demonstrate rendering a unique video per recipient from a CSV file using the Batch Renders API. It covers the following topics:

  • Turning each CSV row into one batch entry, so a single request creates one render per recipient
  • Validating rows before rendering and skipping the ones that can not be used
  • Setting a file name and a thumbnail for every recipient’s video
  • Rendering free draft videos first to check the results

Check the detailed guide in the Plainly examples GitHub repository .

AI localized videos

The purpose of this example is to demonstrate generating the same video in multiple languages, with ChatGPT translating the on-screen text before rendering with the Renders API. It covers the following topics:

  • Translating the text into many languages with a single OpenAI call that returns structured output
  • Reviewing every translation next to a preview before anything is rendered
  • Sending one render request per language from the same template
  • Switching a text layer’s font per render with render properties, so Japanese, Chinese and Korean render with the right glyphs

Check the detailed guide in the Plainly examples GitHub repository .