{
  "openapi": "3.0.1",
  "info": {
    "title": "Podcast Sponsor Tracker - Which Brands Advertise on Which Shows",
    "description": "Reads public podcast RSS show notes and returns one row per detected sponsor placement: show, episode, advertiser, tracked URL, and the offer or promo code when the notes contain one. Keeps advertiser history between runs and emits first-seen, returned, lapsed and promo-code-changed events.",
    "version": "1.0",
    "x-build-id": "ugOkjJlYJjUL7S9N6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mibedk~podcast-sponsor-placement-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mibedk-podcast-sponsor-placement-feed",
        "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/mibedk~podcast-sponsor-placement-feed/runs": {
      "post": {
        "operationId": "runs-sync-mibedk-podcast-sponsor-placement-feed",
        "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/mibedk~podcast-sponsor-placement-feed/run-sync": {
      "post": {
        "operationId": "run-sync-mibedk-podcast-sponsor-placement-feed",
        "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": {
          "feedUrls": {
            "title": "Podcast RSS feed URLs",
            "type": "array",
            "description": "The podcast RSS feeds to scan. This is the fastest and most reliable way to name a show - no Apple lookup needed. Find a feed URL with a podcast database, or let 'Podcast search terms' resolve it for you.",
            "default": [
              "https://feeds.megaphone.fm/hubermanlab",
              "https://feeds.megaphone.fm/HS2300184645"
            ],
            "items": {
              "type": "string"
            }
          },
          "applePodcastIds": {
            "title": "Apple Podcasts IDs or URLs",
            "type": "array",
            "description": "Shows named by their Apple Podcasts ID (for example 1469759170) or by a full Apple Podcasts URL containing '/id1469759170'. Each one is resolved to an RSS feed URL through Apple's public iTunes Lookup API and cached for later runs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Podcast search terms",
            "type": "array",
            "description": "Show names to look up through Apple's public iTunes Search API. The first result with a public RSS feed is used, so prefer an exact show title. Apple rate-limits this to roughly 20 lookups per minute per IP; resolved feeds are cached between runs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "daysBack": {
            "title": "Episode window (days)",
            "minimum": 1,
            "maximum": 1825,
            "type": "integer",
            "description": "Only look at episodes published within this many days. Feeds are streamed newest-first and the download is aborted once episodes fall outside the window, which is what keeps 30 MB podcast archives cheap to scan.",
            "default": 90
          },
          "maxEpisodesPerShow": {
            "title": "Max episodes per show",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on how many in-window episodes are parsed per show, whichever comes first with the episode window.",
            "default": 50
          },
          "maxShows": {
            "title": "Max shows per run",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Stop after this many shows, counting feed URLs, Apple IDs and search terms together.",
            "default": 10
          },
          "minConfidence": {
            "title": "Minimum detection confidence",
            "enum": [
              "high",
              "medium"
            ],
            "type": "string",
            "description": "'high' only returns links backed by strong evidence: the tracked URL ends in the show's own slug (brand.com/huberman), or the link directly follows an explicit cue like 'brought to you by'. 'medium' also returns links that merely follow a call to action ('visit', 'check out') or sit next to a promo code - more coverage, more false positives.",
            "default": "high"
          },
          "showAliases": {
            "title": "Extra show slugs",
            "type": "array",
            "description": "Additional URL path slugs that identify this show in sponsor links, beyond the ones derived from the show title. Use this when a show's tracked links use a slug you cannot guess - for example add 'tfs' if sponsors link to brand.com/tfs. Applied to every show in the run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "extraSponsorDomains": {
            "title": "Always-sponsor domains",
            "type": "array",
            "description": "Domains to always treat as an advertiser when they appear in show notes, regardless of cue phrases. Useful for tracking one specific brand across many shows.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "ignoreDomains": {
            "title": "Extra ignored domains",
            "type": "array",
            "description": "Domains to never treat as an advertiser, added to the built-in list (social networks, podcast platforms, ad-tech hosts, link shorteners). The show's own domain is always ignored automatically.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "brandNameOverrides": {
            "title": "Brand name overrides",
            "type": "array",
            "description": "Force a readable advertiser name for a domain, as objects like {\"domain\": \"joinhampton.com\", \"brandName\": \"Hampton\"}. Brand names are otherwise read from the show notes and fall back to the domain, which is not always the name a human would use.",
            "default": []
          },
          "resolveRedirects": {
            "title": "Resolve shortened links",
            "type": "boolean",
            "description": "Follow each tracked URL with a HEAD request (up to 3 redirects) to record the final landing URL. Turn this on when shows use link shorteners or ad-network redirects. It adds one request per unique link, so runs take longer.",
            "default": false
          },
          "lapsedAfterDays": {
            "title": "Lapsed after (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "How many days without a placement before an advertiser counts as lapsed. Also decides when a reappearance is reported as 'advertiser-returned' instead of business as usual. Set this above the show's publishing gap - a weekly show needs a larger value than a daily one.",
            "default": 45
          },
          "emitChangeEvents": {
            "title": "Emit advertiser change events",
            "type": "boolean",
            "description": "Include 'change_event' rows (advertiser-first-seen-on-show, advertiser-returned, advertiser-lapsed, promo-code-changed). These only appear from the second run onwards against the same state store, because the first run is a baseline.",
            "default": true
          },
          "emitBrandRollups": {
            "title": "Emit brand rollups",
            "type": "boolean",
            "description": "Include one 'brand_show_rollup' row per (advertiser, show) with tenure, placement count, cadence and last known offer. Rollups are never charged for.",
            "default": true
          },
          "forceFullRescan": {
            "title": "Force full rescan",
            "type": "boolean",
            "description": "Re-process every in-window episode even if a previous run already saw it. Use for a first backfill or after changing detection settings. Note that this re-charges for placements already delivered in earlier runs.",
            "default": false
          },
          "stateKeyValueStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store holding advertiser history and cached feed lookups between runs. Keep it identical across scheduled runs of the same watchlist to get real change events. Use a different name to track a second watchlist independently, or to start from a clean baseline.",
            "default": "podcast-sponsor-placement-state"
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "How long to wait for a feed or lookup to respond before treating it as failed.",
            "default": 45
          },
          "maxRequestRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many times to retry a failed feed fetch or Apple lookup, with exponential backoff, before skipping that show.",
            "default": 2
          },
          "maxFeedMegabytes": {
            "title": "Max feed read (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Safety cap on how much of any single feed is downloaded. Feeds are parsed as they stream and normally stop well before this; the cap only matters for very large archives sorted oldest-first.",
            "default": 12
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Podcast RSS feeds are plain public XML and normally need no proxy, so this defaults to off. Turn it on only if a feed host blocks Apify's data-center IPs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}