Social media post preview API
Paste a caption and pick an image to see your post as feed cards for Instagram, X, LinkedIn and Facebook: where the text folds behind more, how each network crops the image and whether the caption fits the limit. Download any card as a PNG mockup.
- Endpoint:
POST https://postboost.co/app/api/tools/social-media-post-preview(operationIdpreviewPost) - Web tool: postboost.co/tools/social-media-post-preview
- Token: optional (limits)
- MCP: tool
preview-postonhttps://postboost.co/mcp/tools
Request
| Field | Type | Default | Description |
|---|---|---|---|
text | string | ||
instagram_ratio | string: 1:1, 4:5, 1.91:1 | "1:1" | Image ratio of the Instagram feed post. |
image_width | integer | Image width in pixels. Give it with image_height to get display_ratio and cropped per card. | |
image_height | integer | Image height in pixels. Give it with image_width. |
Call it
- curl
- Python
- Node.js
- PHP
- Go
- Ruby
- Java
- C#
- Rust
- CLI
curl -X POST https://postboost.co/app/api/tools/social-media-post-preview \
-H 'Content-Type: application/json' \
-d '{"text":"New feature: schedule a month of posts in one sitting."}'
from postboost import ApiClient, Configuration
from postboost.api.free_tools_api import FreeToolsApi
from postboost.models import FreeToolPreviewPostRequest
with ApiClient(Configuration()) as client:
api = FreeToolsApi(client)
result = api.preview_post(FreeToolPreviewPostRequest.from_dict({"text": "New feature: schedule a month of posts in one sitting."}))
print(result.to_dict())
import { FreeToolsApi } from 'postboost';
const api = new FreeToolsApi();
const { body } = await api.previewPost({ text: "New feature: schedule a month of posts in one sitting." });
console.log(body);
use PostBoostClient\Api\FreeToolsApi;
use PostBoostClient\Model\FreeToolPreviewPostRequest;
$api = new FreeToolsApi(new GuzzleHttp\Client());
$result = $api->previewPost(new FreeToolPreviewPostRequest(['text' => "New feature: schedule a month of posts in one sitting."]));
echo $result;
import (
"context"
"encoding/json"
"fmt"
postboost "github.com/postboost-co/postboost-go"
)
var request postboost.FreeToolPreviewPostRequest
if err := json.Unmarshal([]byte(`{"text":"New feature: schedule a month of posts in one sitting."}`), &request); err != nil {
panic(err)
}
client := postboost.NewAPIClient(postboost.NewConfiguration())
result, _, err := client.FreeToolsAPI.PreviewPost(context.Background()).FreeToolPreviewPostRequest(request).Execute()
fmt.Println(result, err)
require 'postboost'
api = PostBoost::FreeToolsApi.new
result = api.preview_post(PostBoost::FreeToolPreviewPostRequest.new({ text: "New feature: schedule a month of posts in one sitting." }))
puts result.to_hash
import com.postboost.ApiClient;
import com.postboost.api.FreeToolsApi;
import com.postboost.model.FreeToolPreviewPostRequest;
import com.postboost.model.FreeToolPreviewPostResponse;
FreeToolsApi api = new FreeToolsApi(new ApiClient());
FreeToolPreviewPostRequest request = FreeToolPreviewPostRequest.fromJson("{\"text\":\"New feature: schedule a month of posts in one sitting.\"}");
FreeToolPreviewPostResponse result = api.previewPost(request);
System.out.println(result.toJson());
using Newtonsoft.Json;
using PostBoost.Client.Api;
using PostBoost.Client.Client;
using PostBoost.Client.Model;
var api = new FreeToolsApi(new Configuration());
var request = JsonConvert.DeserializeObject<FreeToolPreviewPostRequest>(@"{""text"":""New feature: schedule a month of posts in one sitting.""}");
var result = await api.PreviewPostAsync(request);
Console.WriteLine(result.ToJson());
use postboost::apis::configuration::Configuration;
use postboost::apis::free_tools_api;
use postboost::models::FreeToolPreviewPostRequest;
let config = Configuration::new();
let request: FreeToolPreviewPostRequest = serde_json::from_str(r##"{"text":"New feature: schedule a month of posts in one sitting."}"##)?;
let result = free_tools_api::preview_post(&config, request).await?;
println!("{:?}", result);
echo '{"text":"New feature: schedule a month of posts in one sitting."}' | ./postboost-cli --content-type application/json previewPost -
With a token, send Authorization: Bearer YOUR_API_TOKEN as a default header (how, per SDK).
Response
{
"networks": [
{
"key": "instagram",
"count": 54,
"limit": 2200,
"over": false,
"preview": "New feature: schedule a month of posts in one sitting.",
"folded": false,
"min_ratio": "1:1",
"max_ratio": "1:1"
},
{
"key": "x",
"count": 54,
"limit": 280,
"over": false,
"preview": "New feature: schedule a month of posts in one sitting.",
"folded": false,
"min_ratio": "4:5",
"max_ratio": "2:1"
},
{
"key": "linkedin",
"count": 54,
"limit": 3000,
"over": false,
"preview": "New feature: schedule a month of posts in one sitting.",
"folded": false,
"min_ratio": "4:5",
"max_ratio": "1.91:1"
},
{
"key": "facebook",
"count": 54,
"limit": 5000,
"over": false,
"preview": "New feature: schedule a month of posts in one sitting.",
"folded": false,
"min_ratio": "4:5",
"max_ratio": "1.91:1"
}
]
}
With MCP
Connect https://postboost.co/mcp/tools (setup) and ask, for example: Preview where a post folds and when its image is cropped on Instagram, X, LinkedIn and Facebook with the PostBoost preview-post tool.
Errors
| Status | When |
|---|---|
401 | The Authorization header holds an invalid token. Leave it out to call as a guest. |
413 | The JSON body is larger than 128 KB. |
422 | A field is invalid; the body lists the errors per field. |
429 | A limit is reached; see limits. |