{
  "openapi": "3.0.1",
  "info": {
    "title": "Brand Pulse: News & Social Monitor",
    "description": "Monitor your brand and competitors across Google News (incl. African editions), Bing News, RSS feeds and TikTok/social datasets. Brand-level sentiment, risk flags, story clustering, share of voice, spike alerts and AI briefings.",
    "version": "1.0",
    "x-build-id": "VINW332gJtqDvkjeW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codepal~brand-pulse/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codepal-brand-pulse",
        "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/codepal~brand-pulse/runs": {
      "post": {
        "operationId": "runs-sync-codepal-brand-pulse",
        "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/codepal~brand-pulse/run-sync": {
      "post": {
        "operationId": "run-sync-codepal-brand-pulse",
        "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": {
          "brandName": {
            "title": "Brand name",
            "type": "string",
            "description": "The name the media uses for you."
          },
          "brandAliases": {
            "title": "Brand aliases",
            "type": "array",
            "description": "Product names, short names, CEO or ticker (e.g. M-Pesa, SCOM). Short ALL-CAPS aliases match case-sensitively.",
            "items": {
              "type": "string"
            }
          },
          "excludeTerms": {
            "title": "Exclude mentions containing",
            "type": "array",
            "description": "Ignore false hits, e.g. a stadium or sports team named after you.",
            "items": {
              "type": "string"
            }
          },
          "competitors": {
            "title": "Competitors",
            "type": "array",
            "description": "One per line; add aliases after a pipe, comma-separated: 'Airtel|Airtel Money,Airtel Kenya'.",
            "items": {
              "type": "string"
            }
          },
          "editions": {
            "title": "News countries (Google News editions)",
            "type": "array",
            "description": "Two-letter codes. Each edition surfaces that country's local outlets: KE, NG, ZA, GH, UG, TZ, RW, ET, EG, MA, SN, CI, US, GB, IN…",
            "default": [
              "KE"
            ],
            "items": {
              "type": "string"
            }
          },
          "useGoogleNews": {
            "title": "Google News",
            "type": "boolean",
            "description": "Search Google News RSS in each edition (headlines from thousands of outlets).",
            "default": true
          },
          "useBingNews": {
            "title": "Bing News",
            "type": "boolean",
            "description": "Bing News RSS adds direct article links and snippets, which give better sentiment.",
            "default": true
          },
          "includeAfricaFeeds": {
            "title": "African business & tech feeds",
            "type": "boolean",
            "description": "Also scan a built-in list of African publisher feeds (TechCabal, Techpoint Africa, Disrupt Africa, Capital FM, Punch, Premium Times, BusinessDay, Mail & Guardian, The Africa Report, Africanews). Only items naming a tracked entity are kept.",
            "default": false
          },
          "feedUrls": {
            "title": "Extra RSS/Atom feeds",
            "type": "array",
            "description": "Any publisher, blog, regulator or press-release feed. Only items naming a tracked entity are kept.",
            "items": {
              "type": "string"
            }
          },
          "socialDatasetIds": {
            "title": "Social datasets (TikTok, X, Reddit…)",
            "type": "array",
            "description": "Apify dataset IDs to merge, e.g. the output of the TikTok Sentiment & Trend Intelligence Actor or any X/Reddit/YouTube scraper. Text, date, engagement and existing sentiment are detected automatically.",
            "items": {
              "type": "string"
            }
          },
          "maxSocialItems": {
            "title": "Max items per social dataset",
            "minimum": 1,
            "type": "integer",
            "description": "Upper limit read from each dataset.",
            "default": 3000
          },
          "lookbackDays": {
            "title": "Look back (days)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Mentions published in the last N days.",
            "default": 7
          },
          "fetchArticles": {
            "title": "Read articles",
            "type": "boolean",
            "description": "Open articles with direct links to analyse the paragraphs that mention you (more accurate sentiment).",
            "default": true
          },
          "maxArticles": {
            "title": "Max articles to read",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Per run.",
            "default": 40
          },
          "maxMentions": {
            "title": "Max mentions",
            "minimum": 1,
            "type": "integer",
            "description": "Upper limit of mentions saved per run (newest first).",
            "default": 2000
          },
          "onlyNew": {
            "title": "Only new mentions in dataset",
            "type": "boolean",
            "description": "For scheduled runs: save only mentions not seen by this monitor before. Metrics still use the whole window.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Runs with the same name share history (spike baseline, seen mentions, alerts already sent).",
            "default": "default"
          },
          "alertOnRiskNews": {
            "title": "Alert on risk stories",
            "type": "boolean",
            "description": "Alert on new negative stories with legal, security, outage, financial or reputation risk on a major outlet or several outlets, and on viral negative social posts.",
            "default": true
          },
          "spikeFactor": {
            "title": "Volume spike factor",
            "minimum": 1.2,
            "type": "number",
            "description": "Alert when the last 24 h has this many times the usual daily mentions (min 3 mentions).",
            "default": 2.5
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "HTTPS URL for alerts (Slack/Discord formatted automatically; JSON for Zapier, Make, n8n, Teams workflows)."
          },
          "webhookSecret": {
            "title": "Webhook secret",
            "type": "string",
            "description": "Optional HMAC signature (x-signature-256)."
          },
          "enableAi": {
            "title": "AI briefing",
            "type": "boolean",
            "description": "Executive summary, key stories, risks with recommended actions, competitor watch and a holding statement when needed. Uses your own API key.",
            "default": false
          },
          "aiBaseUrl": {
            "title": "AI API base URL",
            "type": "string",
            "description": "Any OpenAI-compatible API (OpenAI, OpenRouter, Groq, Together, DeepSeek, local Ollama…).",
            "default": "https://api.openai.com/v1"
          },
          "aiModel": {
            "title": "AI model",
            "type": "string",
            "description": "Model name at your provider.",
            "default": "gpt-4o-mini"
          },
          "aiApiKey": {
            "title": "AI API key",
            "type": "string",
            "description": "Stored encrypted; billed by your provider."
          },
          "brandContext": {
            "title": "Brand context",
            "type": "string",
            "description": "Optional: what you do, current campaigns or known issues, to sharpen the briefing."
          },
          "includeSocialAuthors": {
            "title": "Include social usernames",
            "type": "boolean",
            "description": "Off by default. News article authors are always included.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Turn on if news sources start refusing requests.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}