{
  "schemaVersion": 1,
  "slug": "instagram-engagement-rate-calculator",
  "category": "social-media",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "d06fc9483ade83e8520f614766c542d3d05371d7657baa7c5181f7737ea0572c",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/instagram-engagement-rate-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "ERf = (L + C + Sv + Sh) ÷ Np ÷ F × 100 ; ERr = (L + C + Sv + Sh) ÷ Np ÷ R × 100",
    "vars": [
      [
        "L",
        "likes"
      ],
      [
        "C",
        "comments"
      ],
      [
        "Sv",
        "saves"
      ],
      [
        "Sh",
        "shares"
      ],
      [
        "Np",
        "number of posts counted"
      ],
      [
        "F",
        "followers"
      ]
    ],
    "note": "Per-post average interactions = (likes + comments + saves + shares) ÷ posts. Rates divide this average by followers or reach."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const total = likes + comments + saves + shares; const perPost = total/posts; const erF = followers > 0 ? perPost/followers*100 : 0; const erR = reach > 0 ? perPost/reach*100 : 0; return { engagementRateFollowers: erF, engagementRateReach: erR, likeRate: followers > 0 ? (likes/posts)/followers*100 : 0, commentRate: followers > 0 ? (comments/posts)/followers*100 : 0, saveRate: followers > 0 ? (saves/posts)/followers*100 : 0, avgEngagements: perPost };",
    "inputs": [
      {
        "name": "followers",
        "type": "number",
        "default": 5000,
        "min": 1,
        "max": 1000000000,
        "step": 1
      },
      {
        "name": "posts",
        "type": "number",
        "default": 10,
        "min": 1,
        "max": 10000,
        "step": 1
      },
      {
        "name": "likes",
        "type": "number",
        "default": 2400,
        "min": 0,
        "max": 1000000000,
        "step": 1
      },
      {
        "name": "comments",
        "type": "number",
        "default": 180,
        "min": 0,
        "max": 1000000000,
        "step": 1
      },
      {
        "name": "saves",
        "type": "number",
        "default": 300,
        "min": 0,
        "max": 1000000000,
        "step": 1
      },
      {
        "name": "shares",
        "type": "number",
        "default": 90,
        "min": 0,
        "max": 1000000000,
        "step": 1
      },
      {
        "name": "reach",
        "type": "number",
        "default": 3500,
        "min": 0,
        "max": 1000000000,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "engagementRateFollowers",
        "precision": 2,
        "unit": "%"
      },
      {
        "name": "engagementRateReach",
        "precision": 2,
        "unit": "%"
      },
      {
        "name": "likeRate",
        "precision": 2,
        "unit": "%"
      },
      {
        "name": "commentRate",
        "precision": 2,
        "unit": "%"
      },
      {
        "name": "saveRate",
        "precision": 2,
        "unit": "%"
      },
      {
        "name": "avgEngagements",
        "precision": 1,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
