{
  "openapi": "3.0.1",
  "info": {
    "title": "Social Media Analytics API - Posts, Metrics, Listening, Emplifi",
    "description": "Export social media analytics from your own Emplifi account: posts with engagement and insights for Facebook, Instagram, TikTok, LinkedIn, YouTube, X, Pinterest and Snapchat, daily profile metrics, Listening mentions, Community inbox and Care cases. Read only. Bring your own API token.",
    "version": "0.1",
    "x-build-id": "uhAZvSuFQeBWTmh1N"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~social-media-analytics-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-social-media-analytics-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nabeelbaghoor~social-media-analytics-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-social-media-analytics-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nabeelbaghoor~social-media-analytics-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-social-media-analytics-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to read",
            "enum": [
              "profiles",
              "posts",
              "profileMetrics",
              "aggregatedMetrics",
              "listeningPosts",
              "listeningMetrics",
              "communityPosts",
              "communityMetrics",
              "careCases",
              "careMessages",
              "listeningQueries",
              "contentLabels",
              "contentLabelGroups",
              "profileLabels",
              "adAccounts"
            ],
            "type": "string",
            "description": "Connected profiles lists the profiles of one network in your Emplifi account and needs nothing else, so it is the default; run it first to get profile IDs. Content labels, label groups, profile labels and Listening queries list account setup. Profile metrics, posts and aggregated post metrics read profiles. Community content and metrics read profiles or Listening queries. Listening mentions and metrics read Listening queries. Care cases read the Care inbox; Care case messages read one case.",
            "default": "profiles"
          },
          "network": {
            "title": "Network",
            "enum": [
              "facebook",
              "instagram",
              "twitter",
              "youtube",
              "linkedin",
              "pinterest",
              "tiktok",
              "snapchat",
              "whatsapp",
              "googlebp"
            ],
            "type": "string",
            "description": "Connected profiles, posts and profile metrics: the social network to read. Also the default network for profile IDs written without a prefix in the cross-network modes. Profile metrics exist for Facebook, Instagram, X, YouTube, LinkedIn, Pinterest and TikTok; posts also for Snapchat; WhatsApp and Google Business appear in the profiles list and in Community.",
            "default": "facebook"
          },
          "profileIds": {
            "title": "Profile IDs",
            "type": "array",
            "description": "Profiles to read, as the connected profiles mode lists them (up to 100 per run). Write platform:id, such as instagram:17841400000000000, to mix networks in aggregated metrics, Community or Care; a bare ID uses the network above. LinkedIn IDs look like urn:li:organization:2056516.",
            "items": {
              "type": "string"
            }
          },
          "listeningQueryIds": {
            "title": "Listening query IDs",
            "type": "array",
            "description": "Listening mentions and metrics, or Community instead of profiles: query IDs as the Listening queries mode lists them.",
            "items": {
              "type": "string"
            }
          },
          "dateStart": {
            "title": "Start date",
            "type": "string",
            "description": "YYYY-MM-DD (Community, Care and Listening metrics also take YYYY-MM-DDTHH:MM:SS). Defaults to 30 days back for metrics, posts and ad accounts, 7 days back for mentions, Community and Care. Metrics requests cover at most 12 months; Community keeps 90 days; older history depends on your Emplifi plan."
          },
          "dateEnd": {
            "title": "End date",
            "type": "string",
            "description": "YYYY-MM-DD, included. Defaults to today (UTC)."
          },
          "metrics": {
            "title": "Profile metrics",
            "type": "array",
            "description": "Profile metrics mode: up to 25 metric names from the provider tables for the chosen network, such as fans_lifetime, fans_change, insights_reach or insights_media_views (Facebook), followers_lifetime or insights_reach (Instagram), subscribers_lifetime or views_change (YouTube), insights_fans_lifetime (TikTok). Metrics starting with insights_ need profiles with insights enabled. Defaults to the network follower count.",
            "items": {
              "type": "string"
            }
          },
          "aggregatedMetric": {
            "title": "Aggregated metric",
            "enum": [
              "engagement_rate",
              "insights_avg_time_watched",
              "insights_completion_rate",
              "insights_engagements",
              "insights_impressions",
              "insights_impressions_engagement_rate",
              "insights_initial_video_views",
              "insights_link_clicks",
              "insights_media_view_time",
              "insights_media_views",
              "insights_post_clicks",
              "insights_post_saves",
              "insights_reach_engagement",
              "insights_reach_per_content",
              "insights_save_rate",
              "insights_screenshots",
              "insights_shares",
              "insights_story_exits",
              "insights_story_taps_back",
              "insights_story_taps_forward",
              "insights_swipe_down",
              "insights_swipe_up",
              "insights_video_completed_views",
              "insights_video_starts",
              "insights_video_views",
              "insights_video_views_10s",
              "insights_video_views_unique",
              "insights_view_time",
              "interactions",
              "interactions_per_1k_fans",
              "likes",
              "number_of_comments",
              "page_posts",
              "page_replies",
              "page_shares",
              "profile_tweets",
              "sentiment_manual_auto",
              "shares",
              "user_posts",
              "user_posts_average_response_time",
              "user_posts_responded",
              "user_posts_response_rate",
              "user_questions",
              "user_questions_average_response_time",
              "user_questions_responded",
              "user_questions_response_rate"
            ],
            "type": "string",
            "description": "Aggregated post metrics mode: one metric summed or averaged over the posts published in the date range.",
            "default": "interactions"
          },
          "communityMetric": {
            "title": "Community metric",
            "enum": [
              "content_count",
              "message_count",
              "response_time",
              "response_time_business_hours",
              "salesforce_lead_count",
              "salesforce_case_count"
            ],
            "type": "string",
            "description": "Community metrics mode.",
            "default": "content_count"
          },
          "listeningMetric": {
            "title": "Listening metric",
            "enum": [
              "authors",
              "comments",
              "content_count",
              "interactions",
              "potential_impressions",
              "shares"
            ],
            "type": "string",
            "description": "Listening metrics mode.",
            "default": "content_count"
          },
          "dimensions": {
            "title": "Dimensions",
            "type": "array",
            "description": "Metrics modes: how to split the values. Profile metrics: date.day, date.week, date.month, profile, profile_label and per network ones such as gender_age, country or post_attribution (default profile and date.day). Aggregated: up to 2 of date.day, date.week, date.month, date.quarter, date.year, platform, profile, post_labels, profile_label, content_type, media_type, published_status, sentiment_type, interaction_type, response_time, sentiment (default profile). Community: community_type, date, post_label, profile, profile_label, resolve_status, sentiment, response_date, user_actions_created_time, with date types written as date.day, date.week and so on (default profile and date.day). Listening: content_type, country, hashtag, keyword, language, listening_query, location, media_type, organization, person, platform, post_label, profession, sentiment, topic, url (default listening_query).",
            "items": {
              "type": "string"
            }
          },
          "dimensionLimit": {
            "title": "Buckets per dimension",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Community and Listening metrics: keep only the top N values of each non-date dimension (the provider default is 10)."
          },
          "fields": {
            "title": "Fields",
            "type": "array",
            "description": "Posts, Community, Listening and Care modes: the fields to return. Leave empty for a basic set (ID, date, URL, author, text, type, interactions, comments and labels). Insights fields such as insights_reach, insights_impressions or insights_video_views need profiles with insights enabled.",
            "items": {
              "type": "string"
            }
          },
          "sortField": {
            "title": "Sort by",
            "type": "string",
            "description": "Posts, Community, Listening mentions and Care cases: a field the provider allows for sorting on that endpoint, such as created_time (the default), interactions, comments, reactions, likes, shares, video_views or insights_reach. X posts take no sort; Listening mentions sort by interactions, comments, shares or potential_impressions."
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Descending or ascending.",
            "default": "desc"
          },
          "postLabelIds": {
            "title": "Content label IDs",
            "type": "array",
            "description": "Keep only posts or messages with these content labels, as the content labels mode lists them.",
            "items": {
              "type": "string"
            }
          },
          "profileLabelIds": {
            "title": "Profile label IDs",
            "type": "array",
            "description": "Aggregated and Community metrics: keep only profiles with these profile labels.",
            "items": {
              "type": "string"
            }
          },
          "contentTypes": {
            "title": "Content types",
            "type": "array",
            "description": "Facebook, Instagram and Pinterest posts, aggregated metrics, Community content and Listening: keep only these content types.",
            "items": {
              "type": "string",
              "enum": [
                "post",
                "shared",
                "share",
                "story",
                "reply",
                "snap",
                "collaboration",
                "comment",
                "conversation"
              ]
            }
          },
          "mediaTypes": {
            "title": "Media types",
            "type": "array",
            "description": "Facebook, Instagram, YouTube and LinkedIn posts, aggregated metrics and Listening: keep only these media types.",
            "items": {
              "type": "string",
              "enum": [
                "album",
                "animated_gif",
                "carousel",
                "document",
                "link",
                "note",
                "offer",
                "photo",
                "poll",
                "reel",
                "status",
                "video",
                "video_igtv",
                "audio",
                "activity",
                "doc",
                "map",
                "combined",
                "unknown"
              ]
            }
          },
          "origin": {
            "title": "Origin",
            "type": "array",
            "description": "Facebook, Instagram and X posts and Community: brand content or user-generated content.",
            "items": {
              "type": "string",
              "enum": [
                "User-Generated Content",
                "Brand's Content"
              ]
            }
          },
          "postAttribution": {
            "title": "Post attribution",
            "type": "array",
            "description": "Facebook and Instagram posts: organic or paid.",
            "items": {
              "type": "string",
              "enum": [
                "organic",
                "paid"
              ]
            }
          },
          "grades": {
            "title": "Post grades",
            "type": "array",
            "description": "Facebook and Instagram posts: keep only these grade scores.",
            "items": {
              "type": "string",
              "enum": [
                "A+",
                "A",
                "B",
                "C",
                "D"
              ]
            }
          },
          "communityTypes": {
            "title": "Community types",
            "type": "array",
            "description": "Community content and metrics: comments, direct messages, mentions, reviews and the other documented types.",
            "items": {
              "type": "string",
              "enum": [
                "ad_comment",
                "comment",
                "direct_message",
                "mention_comment",
                "mention_post",
                "mention_post_and_media_tag",
                "mention_story_mention",
                "post",
                "review",
                "wall_post"
              ]
            }
          },
          "platformsFilter": {
            "title": "Platforms",
            "type": "array",
            "description": "Aggregated metrics and Listening: keep only these platforms (Listening also has blogs, forums and news). Care cases: the case platforms.",
            "items": {
              "type": "string",
              "enum": [
                "facebook",
                "instagram",
                "twitter",
                "youtube",
                "linkedin",
                "pinterest",
                "tiktok",
                "snapchat",
                "blogs",
                "forums",
                "news"
              ]
            }
          },
          "sentiments": {
            "title": "Sentiment",
            "type": "array",
            "description": "Listening mentions and metrics: keep only this sentiment.",
            "items": {
              "type": "string",
              "enum": [
                "positive",
                "negative",
                "neutral",
                "no_sentiment"
              ]
            }
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Listening: ISO 639-1 language codes such as en or de.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Listening: ISO 3166-1 alpha-2 country codes such as GB or FR.",
            "items": {
              "type": "string"
            }
          },
          "filter": {
            "title": "Advanced filter",
            "type": "array",
            "description": "Extra filter clauses exactly as the provider documents under Advanced Post Filters, added to the ones above, such as [{\"match_any\": [{\"field\": \"post_labels\", \"value\": [\"fa14dde7e4f041e3a646\"]}]}]."
          },
          "caseIds": {
            "title": "Care case IDs",
            "type": "array",
            "description": "Care cases mode: read only these cases.",
            "items": {
              "type": "string"
            }
          },
          "careCaseId": {
            "title": "Care case ID",
            "type": "string",
            "description": "Care case messages mode: the case to read, as the Care cases mode lists it (for example CCC_123456_8GWYLU3OSK2d7rxwHg_3879)."
          },
          "includeInternalNotes": {
            "title": "Include internal notes",
            "type": "boolean",
            "description": "Care case messages mode: include the internal notes of the case.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for. Content endpoints page up to 100 records at a time.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Pacing. The provider allows 500 requests an hour per user and 1000 per account, shared with your other integrations.",
            "default": 10
          },
          "apiKey": {
            "title": "API token",
            "type": "string",
            "description": "Your own Emplifi API token, issued for your Emplifi user by Emplifi support. You can also paste token:secret here, or an OAuth 2.0 access token from your Emplifi custom integration (then leave the secret empty). Stored as a secret. You can instead set the DATA_API_KEY environment secret."
          },
          "apiSecret": {
            "title": "API secret",
            "type": "string",
            "description": "The secret that goes with the API token (Basic authorization uses both). Leave empty when the token field holds token:secret or an OAuth 2.0 access token. Stored as a secret. You can instead set the DATA_API_SECRET environment secret."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}