Overview
The Piximg API is a simple HTTP endpoint for uploading images from tools, scripts, ShareX, or custom applications. It returns clean, CDN-backed direct URLs plus deletion links and optional gallery URLs for batch uploads.
Fast & Simple
Standard multipart/form-data. Optional API token for Pro features.
CDN Backed
All images are served via a CDN for fast global delivery.
Deletion Control
Every upload gets a unique deletion token for image management.
Endpoint
All uploads, whether single or multiple, use the same endpoint:
Parameters
-
fileSingle image upload -
files[]Multiple images (creates gallery)
Supported Formats
- PNG, JPEG, GIF, WebP
- Limits depend on account tier
- JSON response format
Upload Limits
Upload limits depend on your account tier. Free users have standard limits, while Pro users enjoy higher limits.
Free Tier
- ▸ 10 files per upload
- ▸ 2MB maximum file size
- ▸ No API token required
Pro Tier
£2/month- ▸ 20 files per upload
- ▸ 5MB maximum file size
- ▸ API token included
- ▸ Personal gallery & dashboard
Anonymous Uploads
Uploads without an API token use free tier limits. Pro users must include their API token in requests to access Pro tier limits.
Authentication (Optional)
Pro users can generate an API token from their account dashboard to access Pro tier limits and have uploads linked to their account.
Header
Getting Your API Token
Pro users can generate and manage API tokens from /account/api-tokens. Tokens enable Pro tier limits and link uploads to your account.
# Upload with API token for Pro limits
curl -H "X-Piximg-Token: your_token_here" \
-F "file=@image.png" \
https://pixi.mg/api
Single Image Upload
Upload a single image and receive a direct URL, deletion link, and metadata.
# Single image upload using cURL
curl -F "file=@/path/to/image.png" https://pixi.mg/api
<?php
$endpoint = 'https://pixi.mg/api';
$filePath = __DIR__ . '/image.png';
$ch = curl_init($endpoint);
$postFields = [
'file' => new CURLFile($filePath, 'image/png', 'image.png'),
];
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $postFields,
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException('cURL error: ' . curl_error($ch));
}
curl_close($ch);
$data = json_decode($response, true);
if (!($data['success'] ?? false)) {
var_dump($data);
exit("Upload failed\n");
}
echo "Direct URL: " . $data['direct_url'] . PHP_EOL;
echo "Delete URL: " . $data['delete_url'] . PHP_EOL;
// Node.js example (using node-fetch & form-data)
import fetch from 'node-fetch';
import FormData from 'form-data';
import fs from 'fs';
const endpoint = 'https://pixi.mg/api';
const form = new FormData();
form.append('file', fs.createReadStream('./image.png'));
const res = await fetch(endpoint, {
method: 'POST',
body: form,
});
const data = await res.json();
if (!data.success) {
console.error('Upload failed:', data);
} else {
console.log('Direct URL:', data.direct_url);
console.log('Delete URL:', data.delete_url);
}
import requests
endpoint = "https://pixi.mg/api"
files = {
"file": ("image.png", open("image.png", "rb"), "image/png")
}
resp = requests.post(endpoint, files=files)
data = resp.json()
if not data.get("success"):
print("Upload failed:", data)
else:
print("Direct URL:", data["direct_url"])
print("Delete URL:", data["delete_url"])
package main
import (
"bytes"
"fmt"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
filePath := "image.png"
endpoint := "https://pixi.mg/api"
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
file, err := os.Open(filePath)
if err != nil {
panic(err)
}
defer file.Close()
part, err := writer.CreateFormFile("file", "image.png")
if err != nil {
panic(err)
}
if _, err = io.Copy(part, file); err != nil {
panic(err)
}
writer.Close()
req, err := http.NewRequest("POST", endpoint, body)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", writer.FormDataContentType())
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
}
use reqwest::blocking::Client;
use reqwest::blocking::multipart;
use std::fs::File;
use std::io::Read;
fn main() -> Result<(), Box> {
let endpoint = "https://pixi.mg/api";
let mut file = File::open("image.png")?;
let mut buf = Vec::new();
file.read_to_end(&mut buf)?;
let part = multipart::Part::bytes(buf)
.file_name("image.png")
.mime_str("image/png")?;
let form = multipart::Form::new().part("file", part);
let client = Client::new();
let resp = client.post(endpoint).multipart(form).send()?;
let text = resp.text()?;
println!("{}", text);
Ok(())
}
Example Response
{
"success": true,
"direct_url": "https://i.pixi.mg/i/abc123.png",
"delete_url": "https://pixi.mg/delete?f=abc123.png&t=DELETETOKEN",
"images": [
{
"direct_url": "https://i.pixi.mg/i/abc123.png",
"delete_url": "https://pixi.mg/delete?f=abc123.png&t=DELETETOKEN",
"original_name": "image.png"
}
]
}
Multiple Images & Galleries
Upload multiple files using files[]
to automatically create a gallery with a shareable URL.
# Multi-image upload (creates a gallery)
curl -F "files[]=@/path/to/one.png" \
-F "files[]=@/path/to/two.jpg" \
https://pixi.mg/api
Example Response
{
"success": true,
"gallery_url": "https://pixi.mg/g/affb09a203a94654",
"gallery_delete_url": "https://pixi.mg/delete-gallery?g=affb09a203a94654&t=GALLERYTOKEN",
"images": [
{
"direct_url": "https://i.pixi.mg/i/first.png",
"delete_url": "https://pixi.mg/delete?f=first.png&t=TOKEN1",
"original_name": "one.png"
},
{
"direct_url": "https://i.pixi.mg/i/second.jpg",
"delete_url": "https://pixi.mg/delete?f=second.jpg&t=TOKEN2",
"original_name": "two.jpg"
}
]
}
Gallery URLs
Use gallery_url for sharing collections,
or individual direct_url values for embedding images separately.
Response Format
All API responses are JSON objects with the following structure:
success
true on successful upload,
false on error
direct_url
delete_url
gallery_url
gallery_delete_url
images
direct_url,
delete_url, and
original_name
⚠️ Important Notes
- • The API may evolve over time. Check this page for updates.
- • Upload limits are enforced server-side and will return an error if exceeded.
- • Avoid abusive or extremely high-volume automated uploads.
- • Cache direct URLs on your side to reduce API calls.
- • Deletion URLs contain sensitive tokens — never expose them publicly.