Validate character count
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.
API key authentication - use your Zernio API key as a Bearer token
In: header
The post text to check
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.validate.validatePostLength({ body: { text: 'Check out https://zernio.com for scheduling posts!', },});console.log(data);{
"text": "string",
"platforms": {
"twitter": {
"count": 51,
"limit": 280,
"valid": true
},
"twitterPremium": {
"count": 51,
"limit": 25000,
"valid": true
},
"instagram": {
"count": 51,
"limit": 2200,
"valid": true
},
"bluesky": {
"count": 51,
"limit": 300,
"valid": true
},
"snapchat": {
"count": 51,
"limit": 160,
"valid": true
}
}
}{
"error": "Unauthorized"
}Validate media URL POST
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.
Validate post content POST
Dry-run the full post validation pipeline without publishing. Catches issues like missing media for Instagram/TikTok/YouTube, hashtag limits, invalid thread formats, Facebook Reel requirements, and character limit violations. Accepts the same body as POST /v1/posts. Does NOT validate accounts, process media, or track usage. Account lookups are limit-only: a twitter accountId is resolved, scoped to the caller, only to pick the 280 vs 25000 character limit. Missing, foreign, or invalid ids fall back to 280 and never error. Returns errors for failures and warnings for near-limit content (>90% of character limit).