Skip to main content
Welcome to the Pictory API! This guide will help you get started with automated video creation. Whether you’re building an application, automating your content workflow, or integrating video capabilities into your platform, the Pictory API makes it simple and straightforward.

What You Can Do

Text to Video

Turn written content into engaging videos with visuals

Blog to Video

Transform blog articles into video content automatically

PowerPoint to Video

Convert presentations into shareable videos

Video Highlights

Extract short clips from long videos

AI Voice-Overs

Add natural-sounding narration to your videos

Subtitles & Captions

Generate and customize subtitles in multiple languages

Branding

Maintain consistent brand styling across all your videos

Integrations

Auto-upload to AWS S3, Vimeo, and more

What You’ll Need

1

A Pictory Account

Sign up for free at app.pictory.ai if you don’t have one
2

An API Subscription

Choose a plan that fits your usage from the API Subscription page
3

Your API Key

This is like a password for your app to connect - we’ll show you how to get it below

Step 1: Create Your Account & Subscribe

Don’t have an account yet? Here’s how to get started:
  1. Visit app.pictory.ai and create a free account
  2. Click on your profile picture in the top-right corner
  3. Select API Subscription from the menu
  4. Choose a plan based on how many videos you’ll create per month
  5. Complete the purchase to activate your API access
How to buy API subscription

Step 2: Get Your API Key

Once you have an active subscription, you can find your API Key:
  1. Go to the API Subscription page in your Pictory account
  2. Your API Key will be displayed on this page
  3. Click the Copy button to copy it to your clipboard
  4. Save it securely - you’ll need it for every API request
API Subscription Page showing API Key
Keep your API Key secure!Treat it like a password. Never share it publicly or include it in client-side code that users can see. Anyone with your API Key can create videos using your account.

Step 3: Make Your First API Call

Now let’s create your first video! This example shows how to turn text into a video:
  1. Send your API Key in the request header so Pictory knows it’s you
  2. Give your video a name and provide the text content
  3. Get a job ID - Pictory will return this immediately so you can track progress
The video doesn’t create instantly - it takes a few minutes. That’s why you get a job ID to check on it later.
import axios from "axios";

const API_BASE_URL = "https://api.pictory.ai/pictoryapis";
const API_KEY = "YOUR_API_KEY"; // Replace with your actual API Key

async function createVideo() {
  try {
    const response = await axios.post(
      `${API_BASE_URL}/v2/video/storyboard/render`,
      {
        videoName: "my_first_video",
        scenes: [
          {
            story: "Welcome to Pictory! This is my first video created with the API.",
            createSceneOnNewLine: true,
            createSceneOnEndOfSentence: true,
          },
        ],
      },
      {
        headers: {
          "Content-Type": "application/json",
          Authorization: API_KEY, // Use API Key directly
        },
      }
    );

    console.log("Job created:", response.data.data.jobId);
    return response.data;
  } catch (error) {
    console.error("Error:", error.response?.data || error.message);
    throw error;
  }
}

createVideo();

Step 4: Check When Your Video is Ready

Since video creation takes time, you’ll need to check if it’s finished:
  1. Use the job ID from Step 3 to check the current status
  2. Call the status endpoint every 5-10 seconds until it’s done
  3. When status is “completed” - your video URL will be in the response
Think of it like checking on food in the oven - you peek in every few minutes until it’s ready!
async function checkJobStatus(jobId) {
  const response = await axios.get(
    `${API_BASE_URL}/v1/jobs/${jobId}`,
    {
      headers: {
        Authorization: API_KEY,
      },
    }
  );

  const status = response.data.data.status;
  console.log("Status:", status);

  if (status === "completed") {
    console.log("Video URL:", response.data.data.videoURL);
  }

  return response.data;
}
Understanding Status Values:
StatusWhat It MeansWhat To Do
in-progressVideo is still being createdKeep checking every 5-10 seconds
completedYour video is ready!Download it using the video URL in the response
failedSomething went wrongCheck the error message and try again
Tip: Check the status every 5-10 seconds. Checking too often (like every second) may cause rate limiting and slow things down.

Best Practices

Follow these tips to use the API safely and efficiently:

Keep Your API Key Safe

  • Use environment variables - Don’t hardcode your key directly in your code
  • Never commit to Git - Add your key file to .gitignore
  • Use server-side code only - Don’t expose your key in websites or mobile apps
  • Rotate regularly - Change your key every few months for extra security

Handle Errors Well

  • Use try-catch blocks - Wrap API calls so your app doesn’t crash if something fails
  • Retry intelligently - If a request fails, wait a bit (2s, then 4s, then 8s) before trying again
  • Save job IDs - Keep track of them so you can debug issues later
  • Check your inputs - Make sure required fields are filled before calling the API

Make It Fast

  • Check status every 5-10 seconds - Not faster, not slower
  • Cache results - If you need the same data multiple times, save it instead of calling the API again
  • Batch your work - When creating many videos, process them together instead of one at a time

Troubleshooting Common Issues

Running into problems? Here are the most common issues and how to fix them:
What it means: Pictory doesn’t recognize your API key.How to fix:
  1. Check that your API key starts with pictai_ - if not, you copied it wrong
  2. Make sure you’re sending it in the Authorization header
  3. Your subscription might have expired - check your account
  4. If nothing works, generate a new API key from the API Access page
What it means: The AI voice name you specified doesn’t exist.How to fix:
  1. Voice names are case-sensitive - “Brian” works, but “brian” doesn’t
  2. Check the complete list of available voices
  3. Make sure you’re spelling it exactly as shown in the API
What it means: You forgot a required field or sent the wrong data type.How to fix:
  1. Double-check the API documentation for required fields
  2. Make sure text values are in quotes, numbers aren’t, and booleans are true/false
  3. Check for typos in field names - videoName not VideoName
What it means: You’re making too many API calls too quickly.How to fix:
  1. Slow down - wait at least 5-10 seconds between status checks
  2. Use exponential backoff: if you get this error, wait 2 seconds, then 4, then 8
  3. Check your subscription limits - you might need to upgrade
What it means: Your video is still being created, or something went wrong.How to fix:
  1. Be patient - videos can take 5-15 minutes depending on length
  2. Keep checking every 5-10 seconds
  3. If it’s been stuck for over 30 minutes, contact our support with your job ID

What’s Next?

You’ve learned the basics! Here are some helpful resources to explore:

API Reference

Need technical details? Check out our complete API documentation:

Need Help?

Stay Connected

Join our community and stay updated with the latest features, tips, and announcements: