Instagram line break generator API
Write your caption with blank lines between paragraphs. The generator puts an invisible spacer on each blank line so the gap stays when you paste the caption into Instagram, removes stray spaces at line ends and counts the caption against the 2,200 character limit.
- Endpoint:
POST https://postboost.co/app/api/tools/instagram-line-break-generator(operationIdformatInstagramCaption) - Web tool: postboost.co/tools/instagram-line-break-generator
- Token: optional (limits)
- MCP: tool
format-instagram-captiononhttps://postboost.co/mcp/tools
Request
| Field | Type | Default | Description |
|---|---|---|---|
text | string | ||
spacer | string: braille, dot | "braille" | What fills a blank line: braille (U+2800 Braille blank, shows as an empty line) or dot (a line with "."). |
hashtags_to_end | boolean | false | Move the hashtags that end a line to the bottom, after three spacer lines. A hashtag inside a sentence stays where it is. |
Call it
- curl
- Python
- Node.js
- PHP
- Go
- Ruby
- Java
- C#
- Rust
- CLI
curl -X POST https://postboost.co/app/api/tools/instagram-line-break-generator \
-H 'Content-Type: application/json' \
-d '{"text":"Line one\n\n\nLine two "}'
from postboost import ApiClient, Configuration
from postboost.api.free_tools_api import FreeToolsApi
from postboost.models import FreeToolFormatInstagramCaptionRequest
with ApiClient(Configuration()) as client:
api = FreeToolsApi(client)
result = api.format_instagram_caption(FreeToolFormatInstagramCaptionRequest.from_dict({"text": "Line one\n\n\nLine two "}))
print(result.to_dict())
import { FreeToolsApi } from 'postboost';
const api = new FreeToolsApi();
const { body } = await api.formatInstagramCaption({ text: "Line one\n\n\nLine two " });
console.log(body);
use PostBoostClient\Api\FreeToolsApi;
use PostBoostClient\Model\FreeToolFormatInstagramCaptionRequest;
$api = new FreeToolsApi(new GuzzleHttp\Client());
$result = $api->formatInstagramCaption(new FreeToolFormatInstagramCaptionRequest(['text' => "Line one\n\n\nLine two "]));
echo $result;
import (
"context"
"encoding/json"
"fmt"
postboost "github.com/postboost-co/postboost-go"
)
var request postboost.FreeToolFormatInstagramCaptionRequest
if err := json.Unmarshal([]byte(`{"text":"Line one\n\n\nLine two "}`), &request); err != nil {
panic(err)
}
client := postboost.NewAPIClient(postboost.NewConfiguration())
result, _, err := client.FreeToolsAPI.FormatInstagramCaption(context.Background()).FreeToolFormatInstagramCaptionRequest(request).Execute()
fmt.Println(result, err)
require 'postboost'
api = PostBoost::FreeToolsApi.new
result = api.format_instagram_caption(PostBoost::FreeToolFormatInstagramCaptionRequest.new({ text: "Line one\n\n\nLine two " }))
puts result.to_hash
import com.postboost.ApiClient;
import com.postboost.api.FreeToolsApi;
import com.postboost.model.FreeToolFormatInstagramCaptionRequest;
import com.postboost.model.FreeToolFormatInstagramCaptionResponse;
FreeToolsApi api = new FreeToolsApi(new ApiClient());
FreeToolFormatInstagramCaptionRequest request = FreeToolFormatInstagramCaptionRequest.fromJson("{\"text\":\"Line one\\n\\n\\nLine two \"}");
FreeToolFormatInstagramCaptionResponse result = api.formatInstagramCaption(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<FreeToolFormatInstagramCaptionRequest>(@"{""text"":""Line one\n\n\nLine two ""}");
var result = await api.FormatInstagramCaptionAsync(request);
Console.WriteLine(result.ToJson());
use postboost::apis::configuration::Configuration;
use postboost::apis::free_tools_api;
use postboost::models::FreeToolFormatInstagramCaptionRequest;
let config = Configuration::new();
let request: FreeToolFormatInstagramCaptionRequest = serde_json::from_str(r##"{"text":"Line one\n\n\nLine two "}"##)?;
let result = free_tools_api::format_instagram_caption(&config, request).await?;
println!("{:?}", result);
echo '{"text":"Line one\n\n\nLine two "}' | ./postboost-cli --content-type application/json formatInstagramCaption -
With a token, send Authorization: Bearer YOUR_API_TOKEN as a default header (how, per SDK).
Response
{
"text": "Line one\n⠀\n⠀\nLine two",
"count": 21,
"limit": 2200,
"over": false,
"hashtags": 0,
"max_hashtags": 5
}
With MCP
Connect https://postboost.co/mcp/tools (setup) and ask, for example: Keep blank lines in an Instagram caption with spacer lines, and count it with the PostBoost format-instagram-caption 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. |