Engagement rate calculator API
Enter likes, comments, shares and saves, choose what to divide by, and get the engagement rate together with the exact formula behind it.
- Endpoint:
POST https://postboost.co/app/api/tools/engagement-rate-calculator(operationIdcalculateEngagementRate) - Web tool: postboost.co/tools/engagement-rate-calculator
- Token: optional (limits)
- MCP: tool
calculate-engagement-rateonhttps://postboost.co/mcp/tools
Request
| Field | Type | Default | Description |
|---|---|---|---|
likes | integer | 0 | |
comments | integer | 0 | |
shares | integer | 0 | |
saves | integer | 0 | |
clicks | integer | 0 | |
method | string: followers, reach, impressions | "followers" | What to divide by. |
base | integer | Followers, or the total reach or impressions of the posts. | |
posts | integer | 1 | Number of posts the engagements come from. |
Call it
- curl
- Python
- Node.js
- PHP
- Go
- Ruby
- Java
- C#
- Rust
- CLI
curl -X POST https://postboost.co/app/api/tools/engagement-rate-calculator \
-H 'Content-Type: application/json' \
-d '{"likes":120,"comments":30,"shares":10,"base":4000,"posts":2}'
from postboost import ApiClient, Configuration
from postboost.api.free_tools_api import FreeToolsApi
from postboost.models import FreeToolCalculateEngagementRateRequest
with ApiClient(Configuration()) as client:
api = FreeToolsApi(client)
result = api.calculate_engagement_rate(FreeToolCalculateEngagementRateRequest.from_dict({"likes": 120, "comments": 30, "shares": 10, "base": 4000, "posts": 2}))
print(result.to_dict())
import { FreeToolsApi } from 'postboost';
const api = new FreeToolsApi();
const { body } = await api.calculateEngagementRate({ likes: 120, comments: 30, shares: 10, base: 4000, posts: 2 });
console.log(body);
use PostBoostClient\Api\FreeToolsApi;
use PostBoostClient\Model\FreeToolCalculateEngagementRateRequest;
$api = new FreeToolsApi(new GuzzleHttp\Client());
$result = $api->calculateEngagementRate(new FreeToolCalculateEngagementRateRequest(['likes' => 120, 'comments' => 30, 'shares' => 10, 'base' => 4000, 'posts' => 2]));
echo $result;
import (
"context"
"encoding/json"
"fmt"
postboost "github.com/postboost-co/postboost-go"
)
var request postboost.FreeToolCalculateEngagementRateRequest
if err := json.Unmarshal([]byte(`{"likes":120,"comments":30,"shares":10,"base":4000,"posts":2}`), &request); err != nil {
panic(err)
}
client := postboost.NewAPIClient(postboost.NewConfiguration())
result, _, err := client.FreeToolsAPI.CalculateEngagementRate(context.Background()).FreeToolCalculateEngagementRateRequest(request).Execute()
fmt.Println(result, err)
require 'postboost'
api = PostBoost::FreeToolsApi.new
result = api.calculate_engagement_rate(PostBoost::FreeToolCalculateEngagementRateRequest.new({ likes: 120, comments: 30, shares: 10, base: 4000, posts: 2 }))
puts result.to_hash
import com.postboost.ApiClient;
import com.postboost.api.FreeToolsApi;
import com.postboost.model.FreeToolCalculateEngagementRateRequest;
import com.postboost.model.FreeToolCalculateEngagementRateResponse;
FreeToolsApi api = new FreeToolsApi(new ApiClient());
FreeToolCalculateEngagementRateRequest request = FreeToolCalculateEngagementRateRequest.fromJson("{\"likes\":120,\"comments\":30,\"shares\":10,\"base\":4000,\"posts\":2}");
FreeToolCalculateEngagementRateResponse result = api.calculateEngagementRate(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<FreeToolCalculateEngagementRateRequest>(@"{""likes"":120,""comments"":30,""shares"":10,""base"":4000,""posts"":2}");
var result = await api.CalculateEngagementRateAsync(request);
Console.WriteLine(result.ToJson());
use postboost::apis::configuration::Configuration;
use postboost::apis::free_tools_api;
use postboost::models::FreeToolCalculateEngagementRateRequest;
let config = Configuration::new();
let request: FreeToolCalculateEngagementRateRequest = serde_json::from_str(r##"{"likes":120,"comments":30,"shares":10,"base":4000,"posts":2}"##)?;
let result = free_tools_api::calculate_engagement_rate(&config, request).await?;
println!("{:?}", result);
echo '{"likes":120,"comments":30,"shares":10,"base":4000,"posts":2}' | ./postboost-cli --content-type application/json calculateEngagementRate -
With a token, send Authorization: Bearer YOUR_API_TOKEN as a default header (how, per SDK).
Response
{
"engagements": 160,
"posts": 2,
"rate": 2,
"formula": "160 engagements ÷ 2 posts ÷ 4,000 followers × 100 = 2.00%"
}
With MCP
Connect https://postboost.co/mcp/tools (setup) and ask, for example: Calculate an engagement rate with the PostBoost calculate-engagement-rate 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. |