Get Avatars
curl --request GET \
--url https://api.pictory.ai/pictoryapis/v1/avatars \
--header 'Authorization: <authorization>'import requests
url = "https://api.pictory.ai/pictoryapis/v1/avatars"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.pictory.ai/pictoryapis/v1/avatars', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pictory.ai/pictoryapis/v1/avatars",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pictory.ai/pictoryapis/v1/avatars"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pictory.ai/pictoryapis/v1/avatars")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pictory.ai/pictoryapis/v1/avatars")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "e0e84faea390465896db75a83be45085",
"name": "Annie",
"gender": "Female",
"looks": [
{
"id": "Annie_expressive12_public",
"name": "Annie in Tan Jacket",
"previewImage": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive12_public/previewImage.webp",
"previewVideo": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive12_public/previewVideo_blurred.webm"
},
{
"id": "Annie_expressive2_public",
"name": "Annie in Blue Casual",
"previewImage": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive2_public/previewImage.webp",
"previewVideo": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive2_public/previewVideo_blurred.webm"
}
]
},
{
"id": "d08c85e6cff84d78b6dc41d83a2eccce",
"name": "Brandon",
"gender": "Male",
"looks": [
{
"id": "Brandon_expressive2_public",
"name": "Brandon in Grey Suit",
"previewImage": "https://pictory-static.pictorycontent.com/avatars/preview/d08c85e6cff84d78b6dc41d83a2eccce/Brandon_expressive2_public/previewImage.webp",
"previewVideo": "https://pictory-static.pictorycontent.com/avatars/preview/d08c85e6cff84d78b6dc41d83a2eccce/Brandon_expressive2_public/previewVideo_blurred.webm"
}
]
}
],
"nextPageKey": null
}
{
"message": "Unauthorized"
}
Avatars
Get Avatars
Retrieve the list of available AI avatars and their looks for video creation
GET
/
pictoryapis
/
v1
/
avatars
Get Avatars
curl --request GET \
--url https://api.pictory.ai/pictoryapis/v1/avatars \
--header 'Authorization: <authorization>'import requests
url = "https://api.pictory.ai/pictoryapis/v1/avatars"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.pictory.ai/pictoryapis/v1/avatars', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pictory.ai/pictoryapis/v1/avatars",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pictory.ai/pictoryapis/v1/avatars"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pictory.ai/pictoryapis/v1/avatars")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pictory.ai/pictoryapis/v1/avatars")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "e0e84faea390465896db75a83be45085",
"name": "Annie",
"gender": "Female",
"looks": [
{
"id": "Annie_expressive12_public",
"name": "Annie in Tan Jacket",
"previewImage": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive12_public/previewImage.webp",
"previewVideo": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive12_public/previewVideo_blurred.webm"
},
{
"id": "Annie_expressive2_public",
"name": "Annie in Blue Casual",
"previewImage": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive2_public/previewImage.webp",
"previewVideo": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive2_public/previewVideo_blurred.webm"
}
]
},
{
"id": "d08c85e6cff84d78b6dc41d83a2eccce",
"name": "Brandon",
"gender": "Male",
"looks": [
{
"id": "Brandon_expressive2_public",
"name": "Brandon in Grey Suit",
"previewImage": "https://pictory-static.pictorycontent.com/avatars/preview/d08c85e6cff84d78b6dc41d83a2eccce/Brandon_expressive2_public/previewImage.webp",
"previewVideo": "https://pictory-static.pictorycontent.com/avatars/preview/d08c85e6cff84d78b6dc41d83a2eccce/Brandon_expressive2_public/previewVideo_blurred.webm"
}
]
}
],
"nextPageKey": null
}
{
"message": "Unauthorized"
}
Overview
The Get Avatars API retrieves a paginated list of all available AI avatars organized by avatar groups. Each avatar group contains multiple “looks” (different styles/outfits) that you can use to create presenter-style videos.Use this endpoint to discover available avatars before creating avatar videos. The look
id becomes your avatarId when using the Create Storyboard Preview API.API Endpoint
GET https://api.pictory.ai/pictoryapis/v1/avatars
Request Headers
string
required
API key for authentication
Authorization: YOUR_API_KEY
Query Parameters
string
Base64 pagination token returned in
nextPageKey from previous response. Omit for first page.Response
The API returns avatar groups with their available looks.array
Array of avatar group objects
string | null
Base64 pagination token for next page.
null indicates no more pages available.Avatar Group Object (items[])
string
Unique avatar group ID (e.g., “e0e84faea390465896db75a83be45085”)
string
Display name of the avatar person (e.g., “Annie”, “Brandon”).
string | null
Gender of the avatar:
"Male", "Female", or nullarray
Array of available looks/styles for this avatar person
Avatar Look Object (items[].looks[])
string
Unique look identifier (e.g., “Annie_expressive12_public”). Use this as
avatarId in video creation.string
Display name of the look (e.g., “Annie in Tan Jacket”, “Brandon in Grey Suit”)
string
URL to static preview image (.webp format)
string
URL to blurred preview video (.webm format) showing the avatar in action
Code Examples
Replace
YOUR_API_KEY with your actual API keycurl --request GET \
--url 'https://api.pictory.ai/pictoryapis/v1/avatars' \
--header 'Authorization: YOUR_API_KEY'
const response = await fetch('https://api.pictory.ai/pictoryapis/v1/avatars', {
method: 'GET',
headers: {
'Authorization': 'YOUR_API_KEY'
}
});
const data = await response.json();
console.log('Avatar groups:', data.items.length);
console.log('Next page key:', data.nextPageKey);
import requests
response = requests.get(
'https://api.pictory.ai/pictoryapis/v1/avatars',
headers={
'Authorization': 'YOUR_API_KEY'
}
)
data = response.json()
print(f"Avatar groups: {len(data['items'])}")
print(f"Next page key: {data['nextPageKey']}")
Response Example
{
"items": [
{
"id": "e0e84faea390465896db75a83be45085",
"name": "Annie",
"gender": "Female",
"looks": [
{
"id": "Annie_expressive12_public",
"name": "Annie in Tan Jacket",
"previewImage": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive12_public/previewImage.webp",
"previewVideo": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive12_public/previewVideo_blurred.webm"
},
{
"id": "Annie_expressive2_public",
"name": "Annie in Blue Casual",
"previewImage": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive2_public/previewImage.webp",
"previewVideo": "https://pictory-static.pictorycontent.com/avatars/preview/e0e84faea390465896db75a83be45085/Annie_expressive2_public/previewVideo_blurred.webm"
}
]
},
{
"id": "d08c85e6cff84d78b6dc41d83a2eccce",
"name": "Brandon",
"gender": "Male",
"looks": [
{
"id": "Brandon_expressive2_public",
"name": "Brandon in Grey Suit",
"previewImage": "https://pictory-static.pictorycontent.com/avatars/preview/d08c85e6cff84d78b6dc41d83a2eccce/Brandon_expressive2_public/previewImage.webp",
"previewVideo": "https://pictory-static.pictorycontent.com/avatars/preview/d08c85e6cff84d78b6dc41d83a2eccce/Brandon_expressive2_public/previewVideo_blurred.webm"
}
]
}
],
"nextPageKey": null
}
{
"message": "Unauthorized"
}
Pagination
The API returns results in pages. Use thenextPageKey to fetch subsequent pages:
// Fetch first page
let response = await fetch('https://api.pictory.ai/pictoryapis/v1/avatars', {
headers: { 'Authorization': 'YOUR_API_KEY' }
});
let data = await response.json();
let allAvatars = [...data.items];
// Fetch remaining pages
while (data.nextPageKey) {
response = await fetch(`https://api.pictory.ai/pictoryapis/v1/avatars?nextPageKey=${encodeURIComponent(data.nextPageKey)}`, {
headers: { 'Authorization': 'YOUR_API_KEY' }
});
data = await response.json();
allAvatars.push(...data.items);
}
console.log('Total avatar groups:', allAvatars.length);
Usage Example
Here’s how to fetch avatars and use them in video creation:// Step 1: Get available avatars
const avatarsResponse = await fetch('https://api.pictory.ai/pictoryapis/v1/avatars', {
headers: { 'Authorization': 'YOUR_API_KEY' }
});
const avatarsData = await avatarsResponse.json();
// Step 2: Find an avatar group by name
const annieGroup = avatarsData.items.find(group => group.name === 'Annie');
// Step 3: Select a specific look
const selectedLook = annieGroup.looks.find(look => look.name.includes('Tan Jacket'));
console.log('Selected avatar:');
console.log(' avatarId:', selectedLook.id);
console.log(' Preview:', selectedLook.previewVideo);
// Step 4: Create video with the selected avatar
const videoResponse = await fetch('https://api.pictory.ai/pictoryapis/v2/video/storyboard', {
method: 'POST',
headers: {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
videoName: 'my_avatar_video',
language: 'en',
videoWidth: 1920,
videoHeight: 1080,
voiceOver: {
enabled: true,
aiVoices: [{
speaker: 'Matthew',
speed: 100
}]
},
avatar: {
avatarId: selectedLook.id, // "Annie_expressive12_public"
position: 'bottom-right',
width: '20%'
},
scenes: [{
story: 'Welcome to my video!',
createSceneOnEndOfSentence: true,
minimumDuration: 4
}]
})
});
const videoData = await videoResponse.json();
console.log('Video job created:', videoData.data.jobId);
Filtering and Selecting Avatars
You can filter avatars based on your requirements:const avatarsData = await getAvatars();
// Filter by gender
const femaleAvatars = avatarsData.items.filter(group => group.gender === 'Female');
const maleAvatars = avatarsData.items.filter(group => group.gender === 'Male');
// Get all looks for female avatars
const femaleLooks = femaleAvatars.flatMap(group =>
group.looks.map(look => ({
avatarId: look.id,
lookName: look.name,
gender: group.gender
}))
);
// Find specific avatar by name
const caroline = avatarsData.items.find(group => group.name === 'Caroline');
const carolineLooks = caroline ? caroline.looks : [];
// Search for looks by outfit
const suitLooks = avatarsData.items.flatMap(group =>
group.looks.filter(look => look.name.toLowerCase().includes('suit'))
);
console.log('Female avatars:', femaleAvatars.length);
console.log('Male avatars:', maleAvatars.length);
console.log('Suit looks:', suitLooks.length);
Best Practices
Cache Avatar List
Cache Avatar List
Recommendation: Cache the avatar list to reduce API callsThe avatar list does not change frequently, so you can cache it:
- Store the response locally or in your database
- Refresh the cache periodically (e.g., daily or weekly)
- Reduce latency and API calls in your application
- Remember to handle pagination when caching
Handle Pagination Properly
Handle Pagination Properly
Recommendation: Fetch all pages for complete avatar listThe API returns paginated results:
- Check
nextPageKeyfor additional pages - Continue fetching until
nextPageKeyisnull - Combine results from all pages
- Cache the complete list after fetching all pages
Preview Before Selection
Preview Before Selection
Recommendation: Show preview videos to usersUse the
previewVideo and previewImage URLs to:- Display avatar previews in your UI
- Let users see avatar appearance and style
- Show different looks for the same avatar person
- Help users make informed selections
Validate Avatar Availability
Validate Avatar Availability
Recommendation: Check avatar availability before creating videosBefore hardcoding avatar IDs:
- Fetch the latest avatar list
- Verify the look ID exists
- Handle cases where a look might be deprecated
- Provide fallback options
Understand Avatar Structure
Understand Avatar Structure
Recommendation: Group vs Look distinction mattersRemember the hierarchy:
- Avatar Group (
items[]): The avatar person (e.g., “Annie”) - Avatar Look (
items[].looks[]): A specific style/outfit (e.g., “Annie in Tan Jacket”)- Use
items[].looks[].idasavatarIdin video creation
- Use
Error Handling
401 - Unauthorized
401 - Unauthorized
{
"message": "Unauthorized"
}
Invalid Page Key
Invalid Page Key
Issue: Providing an invalid or expired
nextPageKey parameterSolution:- Only use
nextPageKeyvalues returned from previous API responses - Do not manually construct or modify page keys
- If pagination fails, restart from the first page
Network Error
Network Error
Issue: Request fails or times outSolution:
- Check network connectivity
- Verify the endpoint URL is correct
- Implement retry logic with exponential backoff
- Handle timeout errors gracefully
Related Resources
Create Storyboard Preview
Create presenter-style videos with avatars
Create Avatar Video Guide
Step-by-step guide to creating avatar videos
Avatar Positioning
Learn to position avatars in videos
Get Voiceover Tracks
Get available AI voices for avatar narration
Was this page helpful?
