Generate a GIF
curl --request POST \
--url https://api.pictify.io/gif \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"html": "<string>",
"url": "<string>",
"template": "<string>",
"variables": {},
"width": 800,
"height": 600
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
html: '<string>',
url: '<string>',
template: '<string>',
variables: {},
width: 800,
height: 600
})
};
fetch('https://api.pictify.io/gif', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/gif"
payload = {
"html": "<string>",
"url": "<string>",
"template": "<string>",
"variables": {},
"width": 800,
"height": 600
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pictify.io/gif"
payload := strings.NewReader("{\n \"html\": \"<string>\",\n \"url\": \"<string>\",\n \"template\": \"<string>\",\n \"variables\": {},\n \"width\": 800,\n \"height\": 600\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/gif")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html\": \"<string>\",\n \"url\": \"<string>\",\n \"template\": \"<string>\",\n \"variables\": {},\n \"width\": 800,\n \"height\": 600\n}"
response = http.request(request)
puts response.read_body{
"gif": {
"url": "<string>",
"uid": "<string>",
"width": 123,
"height": 123,
"animationLength": 123
}
}GIFs
HTML to GIF API
Create animated GIFs from HTML/CSS animations or live URL captures — set duration and fps, get a CDN-hosted GIF
POST
/
gif
Generate a GIF
curl --request POST \
--url https://api.pictify.io/gif \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"html": "<string>",
"url": "<string>",
"template": "<string>",
"variables": {},
"width": 800,
"height": 600
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
html: '<string>',
url: '<string>',
template: '<string>',
variables: {},
width: 800,
height: 600
})
};
fetch('https://api.pictify.io/gif', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/gif"
payload = {
"html": "<string>",
"url": "<string>",
"template": "<string>",
"variables": {},
"width": 800,
"height": 600
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pictify.io/gif"
payload := strings.NewReader("{\n \"html\": \"<string>\",\n \"url\": \"<string>\",\n \"template\": \"<string>\",\n \"variables\": {},\n \"width\": 800,\n \"height\": 600\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/gif")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html\": \"<string>\",\n \"url\": \"<string>\",\n \"template\": \"<string>\",\n \"variables\": {},\n \"width\": 800,\n \"height\": 600\n}"
response = http.request(request)
puts response.read_body{
"gif": {
"url": "<string>",
"uid": "<string>",
"width": 123,
"height": 123,
"animationLength": 123
}
}GIF Generation
Generate animated GIFs from HTML with CSS animations or by recording live web pages.Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /gif | Create GIF from HTML with CSS animations |
GET | /gif | List GIFs |
GET | /gif/{uid} | Get GIF |
POST | /gif/capture | Capture GIF from a live URL |
Quality Presets
| Preset | Frame Rate | Max Duration | Best For |
|---|---|---|---|
low | 10 fps | 10 seconds | Small file size, simple animations |
medium | 15 fps | 15 seconds | Balanced quality and size |
high | 24 fps | 30 seconds | Smooth animations, detailed content |
The response is wrapped in a
gif object. Higher quality settings produce larger files.Key Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
width | integer | - | Output width (1-2000, required) |
height | integer | - | Output height (1-2000, required) |
quality | string | medium | Quality preset |
frameDurationSeconds | number | - | Animation duration to capture |
selector | string | - | CSS selector to capture specific element (URL capture only) |
waitForSelector | string | - | Wait for element before recording (URL capture only) |
Tips for Better GIFs
- Keep dimensions reasonable — smaller GIFs load faster and compress better
- Optimize animations — simple, smooth animations compress better than complex ones
- Use solid backgrounds — gradients and transparency increase file size
- Limit colors — GIFs are limited to 256 colors per frame
- Loop seamlessly — design animations to loop smoothly for better visual appeal
Authorizations
API key obtained from the Pictify dashboard
Body
application/json
Response
200 - application/json
GIF generated
Show child attributes
Show child attributes