Validate media URL
Check if a media URL is accessible and return metadata (content type, file size) plus per-platform size limit comparisons. Performs a HEAD request (with GET fallback) to detect content type and size. Rejects private/localhost URLs for SSRF protection. Platform limits are sourced from each platform's actual upload constraints.
API key authentication - use your Zernio API key as a Bearer token
In: header
Public media URL to validate
uriResponse Body
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.validate.validateMedia({ body: { url: 'https://example.com/image.jpg', },});console.log(data);{
"valid": true,
"url": "http://example.com",
"error": "string",
"contentType": "image/jpeg",
"size": 0,
"sizeFormatted": "245 KB",
"type": "image",
"platformLimits": {
"instagram": {
"limit": 8388608,
"limitFormatted": "8.0 MB",
"withinLimit": true
},
"twitter": {
"limit": 5242880,
"limitFormatted": "5.0 MB",
"withinLimit": true
},
"bluesky": {
"limit": 1000000,
"limitFormatted": "977 KB",
"withinLimit": true
}
}
}Get upload URL POST
Get a presigned URL to upload files directly to cloud storage (up to 5GB). Returns an uploadUrl and publicUrl. PUT your file to the uploadUrl, then use the publicUrl in your posts.
Validate character count POST
Check weighted character count per platform and whether the text is within each platform's limit. Twitter/X uses weighted counting (URLs = 23 chars via t.co, emojis = 2 chars). All other platforms use plain character length. Returns counts and limits for all 15 supported platform variants.