{
  "openapi": "3.0.1",
  "info": {
    "title": "Social Media Competitor Analytics API - Facelift Data Studio",
    "description": "Export social media analytics and competitor benchmarks from your own Facelift Data Studio (quintly) account: Facebook, Instagram, X, YouTube, LinkedIn and TikTok followers, posts and engagement over time via QQL, plus profile search and listing. Read only. Bring your own API keys.",
    "version": "0.1",
    "x-build-id": "3OCfZhhnvNCYwtLHx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~social-media-competitor-analytics-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-social-media-competitor-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-competitor-analytics-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-social-media-competitor-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-competitor-analytics-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-social-media-competitor-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",
              "metrics",
              "search",
              "spaces",
              "adAccounts",
              "dataSources"
            ],
            "type": "string",
            "description": "Profiles lists every profile in your account with the profile IDs the metrics mode filters on, and needs nothing else, so it is the default. Metrics and posts runs one QQL query over a data source for a date range. Profile search finds public profiles by name, term or URL. Spaces, ad accounts and the data source catalogue list the rest of the account.",
            "default": "profiles"
          },
          "dataSource": {
            "title": "Data source",
            "enum": [
              "facebook",
              "facebookAdsPostAds",
              "facebookComments",
              "facebookInsights",
              "facebookInsightsByCity",
              "facebookInsightsByCountry",
              "facebookInsightsByGenderAndAge",
              "facebookInsightsConversations",
              "facebookInsightsConversationMessages",
              "facebookInsightsOwnPosts",
              "facebookInsightsTaggedPosts",
              "facebookInsightsExpiredPosts",
              "facebookInsightsPostAuthors",
              "facebookInsightsOwnVideos",
              "facebookInsightsReels",
              "facebookInsightsStories",
              "facebookInsightsPageFansOnline",
              "facebookInsightsPageViewsReferrals",
              "facebookOwnPosts",
              "facebookQuestions",
              "facebookUserPosts",
              "instagram",
              "instagramInsights",
              "instagramInsightsOwnPosts",
              "instagramInsightsPaidPosts",
              "instagramInsightsStories",
              "instagramInsightsComments",
              "instagramOwnPosts",
              "metaAdsCampaigns",
              "metaAdsCampaignsTimeSeries",
              "linkedIn",
              "linkedInAnalytics",
              "linkedInAnalyticsOwnPosts",
              "linkedInAnalyticsStories",
              "tiktokAnalytics",
              "tiktokAnalyticsOwnPosts",
              "threadsInsights",
              "threadsInsightsOwnPosts",
              "threadsInsightsOwnReplies",
              "twitter",
              "twitterAnalyticsOwnTweets",
              "twitterAnalyticsOwnReplies",
              "twitterOwnReplies",
              "twitterOwnTweets",
              "youtube",
              "youtubeAnalytics",
              "youtubeAnalyticsCountries",
              "youtubeAnalyticsDevices",
              "youtubeAnalyticsPlaybackLocations",
              "youtubeAnalyticsTopPlaylists",
              "youtubeAnalyticsTopVideos",
              "youtubeAnalyticsTotal",
              "youtubeAnalyticsTrafficSources",
              "youtubeAnalyticsVideos",
              "youtubeVideos",
              "youtubeAnalyticsVideosTimeSeries",
              "snapchatShowInsights",
              "snapchatShowInsightsStories",
              "snapchatShowInsightsSnaps",
              "gmbLocalPostsTimeSeries",
              "gmbReviewsTimeSeries",
              "gmbLocalPosts",
              "gmbReviews",
              "gmbPerformanceMetrics",
              "pinterestProfileInfo",
              "pinterestBoards",
              "pinterestPins",
              "pinterestAnalytics",
              "profiles",
              "postTags",
              "adAccounts"
            ],
            "type": "string",
            "description": "Metrics mode. The documented QQL data source (table) to read. Time series sources return one row per profile per interval (followers, fans, subscribers, engagement); item level sources return one row per post, video, comment or review. Public sources work for any profile in your account, competitors included; sources marked owner connection need the profile owner to connect private statistics.",
            "default": "facebook"
          },
          "columns": {
            "title": "Columns",
            "type": "array",
            "description": "Metrics mode. The data source columns to return, exactly as the API documentation names them (for example profileId, time, fans, followersChange). Leave empty for every documented column of the data source.",
            "items": {
              "type": "string"
            }
          },
          "qqlQuery": {
            "title": "Custom QQL query",
            "type": "string",
            "description": "Metrics mode, advanced. A whole QQL SELECT query, for example one that joins the profiles table or uses an aggregate. When set it replaces the data source and columns above. Build and test queries in the Metric Builder of the web app."
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Metrics mode. First day of the period, YYYY-MM-DD. Default: 30 days ago."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Metrics mode. Last day of the period, YYYY-MM-DD. Default: today."
          },
          "interval": {
            "title": "Interval",
            "enum": [
              "daily",
              "weekly",
              "monthly",
              "total"
            ],
            "type": "string",
            "description": "Metrics mode. Aggregation interval of time series sources. Weekly and monthly periods are expanded to whole weeks or months; total returns one row per profile.",
            "default": "daily"
          },
          "timezone": {
            "title": "Time zone",
            "type": "string",
            "description": "Metrics mode. PHP time zone name used to fetch and aggregate, such as UTC or Europe/Berlin. Set explicitly so results do not depend on the account admin's setting.",
            "default": "UTC"
          },
          "profileIds": {
            "title": "Profile IDs",
            "type": "array",
            "description": "Metrics mode. Internal numeric profile IDs to read, as the profiles mode lists them. Leave empty for the provider default.",
            "items": {
              "type": "string"
            }
          },
          "postTextKeywords": {
            "title": "Post text contains",
            "type": "array",
            "description": "Metrics mode, item level sources. Keep only posts whose text contains any of these keywords.",
            "items": {
              "type": "string"
            }
          },
          "postTagIds": {
            "title": "Post tag IDs",
            "type": "array",
            "description": "Metrics mode, item level sources. Keep only posts carrying any of these post tag IDs (the postTags data source lists them).",
            "items": {
              "type": "string"
            }
          },
          "adAccountIds": {
            "title": "Ad account IDs",
            "type": "array",
            "description": "Metrics mode, ad data sources. Numeric ad account IDs, as the ad accounts mode lists them.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by column",
            "type": "string",
            "description": "Metrics mode. A column of the data source to sort on. Item level sources default to their creation time column, newest first."
          },
          "sortDirection": {
            "title": "Sort direction",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Metrics mode.",
            "default": "desc"
          },
          "searchQuery": {
            "title": "Search term",
            "type": "string",
            "description": "Profile search. A profile name or term (Facebook, X, YouTube, LinkedIn), an Instagram username, or a profile URL such as https://www.facebook.com/quintly. TikTok and Snapchat profiles are not searchable; their owners must connect them."
          },
          "network": {
            "title": "Network",
            "enum": [
              "facebook",
              "twitter",
              "youtube",
              "linkedIn",
              "instagram"
            ],
            "type": "string",
            "description": "Profile search. Limit results to one network. Leave empty for all searchable networks."
          },
          "spaceId": {
            "title": "Space ID",
            "type": "string",
            "description": "Profiles mode. Only list profiles of this space (the spaces mode lists them)."
          },
          "groupId": {
            "title": "Group ID",
            "type": "string",
            "description": "Profiles mode. Only list profiles of this profile group."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for. QQL results are paged 1,000 rows at a time.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Pacing. The provider documents very loose rate limits; a rate limit answer is waited out and retried.",
            "default": 60
          },
          "clientId": {
            "title": "Client ID",
            "type": "string",
            "description": "Your quintly client ID (Basic Auth user name), issued with the API secret by Facelift Data Studio support for business accounts. Stored as a secret. You can instead set the DATA_API_AUTH_ID environment secret."
          },
          "apiKey": {
            "title": "API secret",
            "type": "string",
            "description": "Your API secret (Basic Auth password). You can also paste clientId:secret here and leave the client ID empty. Stored as a secret. You can instead set the DATA_API_KEY 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}