{
  "openapi": "3.0.1",
  "info": {
    "title": "Sada: Audience Research & Demand Signals",
    "description": "Turn public conversations into demand signals: comments and posts from YouTube (your API key), Hacker News, Bluesky and Mastodon sorted into themes (pain, solution requests, advice, money talk, alternatives), plus a Patterns report with hooks and content ideas. Links and excerpts, no usernames.",
    "version": "0.2",
    "x-build-id": "bQ88eZxyYPb3PBUbB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/xomiadata~sada/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-xomiadata-sada",
        "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/xomiadata~sada/runs": {
      "post": {
        "operationId": "runs-sync-xomiadata-sada",
        "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/xomiadata~sada/run-sync": {
      "post": {
        "operationId": "run-sync-xomiadata-sada",
        "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": {
          "audience": {
            "title": "Audience (preset)",
            "enum": [
              "custom",
              "egyptian-drama",
              "arabic-ecommerce-ads",
              "ai-voice-agents",
              "ai-tools-founders"
            ],
            "type": "string",
            "description": "A curated collection of channels and keywords for one niche. Choose 'Custom' to use just your own keywords and channels below. Your keywords and channels override the preset's.",
            "default": "custom"
          },
          "keywords": {
            "title": "Keywords / topics",
            "type": "array",
            "description": "Topics in any language (Arabic, French, English...). Used for Hacker News, Bluesky, Mastodon (as hashtag) and as YouTube searches if you add them below. E.g. 'UGC ads', 'إعلانات فيديو', 'pub vidéo IA'.",
            "items": {
              "type": "string"
            }
          },
          "productContext": {
            "title": "Your product or goal (for AI scoring)",
            "type": "string",
            "description": "One sentence, e.g. 'AI video ad generator for Arabic e-commerce stores' or 'Egyptian micro-drama app looking for viewers'. Makes intent scores and suggested actions specific to you."
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Official or open APIs. Reddit is not included (its commercial use requires a Reddit contract). Leave empty to use the audience preset's sources (Hacker News + Bluesky for Custom).",
            "items": {
              "type": "string",
              "enum": [
                "youtube",
                "hackernews",
                "bluesky",
                "mastodon"
              ],
              "enumTitles": [
                "YouTube Data API (your key)",
                "Hacker News (Algolia API)",
                "Bluesky (public search API)",
                "Mastodon (public hashtag timelines)"
              ]
            }
          },
          "youtubeApiKey": {
            "title": "YouTube Data API key (yours)",
            "type": "string",
            "description": "Required for YouTube. Create one in Google Cloud Console (YouTube Data API v3; Google gives a daily quota). Stored encrypted and used for this run alone."
          },
          "youtubeChannels": {
            "title": "YouTube channels to monitor",
            "type": "array",
            "description": "Channel IDs (UC...) or @handles of big channels where your audience already is. Recent videos and their top comments are analysed.",
            "items": {
              "type": "string"
            }
          },
          "youtubeSearchQueries": {
            "title": "YouTube searches",
            "type": "array",
            "description": "Each search costs 100 quota units (channels/comments cost 1). E.g. 'تصميم اعلان منتج بالذكاء الاصطناعي'.",
            "items": {
              "type": "string"
            }
          },
          "youtubeRegion": {
            "title": "YouTube region (search)",
            "type": "string",
            "description": "ISO country code, e.g. SA, AE, MA, EG, FR."
          },
          "youtubeLanguage": {
            "title": "YouTube relevance language (search)",
            "type": "string",
            "description": "e.g. ar, fr, en."
          },
          "youtubeMaxUnits": {
            "title": "Max YouTube quota units per run",
            "minimum": 10,
            "maximum": 9500,
            "type": "integer",
            "description": "Hard budget so a run never eats your daily quota (10,000 by default at Google).",
            "default": 1500
          },
          "videosPerChannel": {
            "title": "Videos per channel",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Most-viewed recent videos (by views/day) analysed per channel.",
            "default": 6
          },
          "videosPerQuery": {
            "title": "Videos per YouTube search",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Videos with the most comments analysed per search.",
            "default": 8
          },
          "commentsPerVideo": {
            "title": "Top comments per video",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "Top comments (relevance order) read per video; 1 quota unit per video.",
            "default": 100
          },
          "mastodonInstance": {
            "title": "Mastodon instance",
            "type": "string",
            "description": "Public instance whose hashtag timelines are read.",
            "default": "mastodon.social"
          },
          "lookbackDays": {
            "title": "Look back (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Conversations and videos published within this window.",
            "default": 14
          },
          "language": {
            "title": "Language filter",
            "enum": [
              "any",
              "ar",
              "fr",
              "en"
            ],
            "type": "string",
            "description": "Keep conversations in this language.",
            "default": "any"
          },
          "maxItems": {
            "title": "Max conversations",
            "minimum": 10,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper limit of conversations returned (highest engagement kept). Hard ceiling: 1,000 per run. Each one is a 'conversation' event; AI-classified ones add an 'ai-insight' event.",
            "default": 300
          },
          "minIntent": {
            "title": "Minimum intent score (0-100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Return conversations at or above this score (tracked keyword hits are always kept).",
            "default": 0
          },
          "minConfidence": {
            "title": "Minimum AI confidence",
            "type": "string",
            "description": "AI classifications below this confidence (0 to 1) are kept but capped at intent 40 and never counted as signals.",
            "default": "0.6"
          },
          "includeNoise": {
            "title": "Keep filtered noise",
            "type": "boolean",
            "description": "Greetings, prayers and blessings, generic praise, pure-emoji and bare-timestamp comments are filtered out before AI (not charged). Turn on to keep them in the dataset with intent 0.",
            "default": false
          },
          "allowLinksInReplies": {
            "title": "Allow links in suggested replies",
            "type": "boolean",
            "description": "By default suggested actions never include links. Sada never suggests DMs, contacting or tagging individuals, mass replies or auto-posting, whatever this setting.",
            "default": false
          },
          "aiClassification": {
            "title": "AI themes, intent, action & hook",
            "type": "boolean",
            "description": "Without it, rule-based themes are used. Available to paid Apify plans (charged per item as 'ai-insight'); on other plans rule-based themes are used.",
            "default": true
          },
          "report": {
            "title": "Patterns report",
            "type": "boolean",
            "description": "Top themes, trending titles (views/day), hook formulas, content and distribution ideas.",
            "default": true
          },
          "reportLanguage": {
            "title": "Report language",
            "enum": [
              "en",
              "fr",
              "ar"
            ],
            "type": "string",
            "description": "Report language",
            "default": "en"
          },
          "askQuestion": {
            "title": "Ask (optional)",
            "type": "string",
            "description": "A question answered from the collected conversations, with source links. E.g. 'What do sellers hate about AI ad tools?'"
          },
          "includeVideos": {
            "title": "Include trending videos",
            "type": "boolean",
            "description": "Add the trending videos (views/day) as separate items.",
            "default": true
          },
          "trackKeywords": {
            "title": "Tracked keywords (alerts)",
            "type": "array",
            "description": "Your brand, competitors or phrases. Matching conversations are flagged and always kept.",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "New since last run",
            "type": "boolean",
            "description": "For scheduled daily alerts.",
            "default": false
          },
          "collectionName": {
            "title": "Collection name",
            "type": "string",
            "description": "Keeps 'new since last run' memory and saved conversations separate per project.",
            "default": "default"
          },
          "saveSignals": {
            "title": "Save strong signals to the collection",
            "type": "boolean",
            "description": "Append signals with intent 50+ to the collection in the key-value store 'sada-state'.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}