{
  "openapi": "3.0.1",
  "info": {
    "title": "Apple Podcast Scraper",
    "description": "Scrape Apple Podcasts: search, show details + ratings, reviews, top charts with rank deltas, RSS episodes, and every podcast by a publisher. Six modes in one actor — plus AMP fields no other Store actor exposes (paid-flag, kind, release-frequency) + Spotify cross-map. $3 per 1K, no API key.",
    "version": "0.0",
    "x-build-id": "YfNAtSsbVQ1zjzeGk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sourabhbgp~apple-podcast-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sourabhbgp-apple-podcast-scraper",
        "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/sourabhbgp~apple-podcast-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sourabhbgp-apple-podcast-scraper",
        "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/sourabhbgp~apple-podcast-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sourabhbgp-apple-podcast-scraper",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "podcast",
              "reviews",
              "charts",
              "episodes",
              "artist"
            ],
            "type": "string",
            "description": "What to scrape. 'search' = search for podcasts by keyword. 'podcast' = get podcast details and metadata. 'reviews' = scrape user reviews for a podcast. 'charts' = top podcasts by genre/country. 'episodes' = extract episodes from RSS feed. 'artist' = list every podcast by a publisher (e.g. all NYT, all Wondery podcasts).",
            "default": "search"
          },
          "searchTerm": {
            "title": "Search Term",
            "type": "string",
            "description": "Keyword to search for podcasts. Used in 'search' mode."
          },
          "podcastUrl": {
            "title": "Podcast URL",
            "type": "string",
            "description": "Apple Podcasts URL for a specific podcast (e.g., https://podcasts.apple.com/us/podcast/the-daily/id1200361736). Used in 'podcast' and 'reviews' modes."
          },
          "rssFeedUrl": {
            "title": "RSS Feed URL",
            "type": "string",
            "description": "Direct RSS feed URL to extract episodes from (e.g., https://feeds.simplecast.com/54nAGcIl). Used in 'episodes' mode. With enrichWithAmp:true, paste an Apple Podcasts URL or numeric ID instead — the actor pulls episodes from Apple's AMP catalog (precise audio asset URL, duration in ms, per-episode contentRating)."
          },
          "artistId": {
            "title": "Apple Artist ID",
            "type": "string",
            "description": "Apple Podcasts publisher/artist ID (e.g., '121664449' for The New York Times). Used in 'artist' mode. If omitted, the actor will derive it from podcastUrl via Apple's public oEmbed endpoint — no JWT needed for discovery."
          },
          "genre": {
            "title": "Genre",
            "type": "string",
            "description": "Genre filter for charts mode. Examples: technology, business, comedy, true-crime, news, sports, education, health-fitness, society-culture, science, arts, history, kids-family, music, tv-film, religion-spirituality, fiction, government, leisure."
          },
          "country": {
            "title": "Country",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Two-letter country code for localized results (e.g., us, gb, au, ca, de). Used in 'search' and 'charts' modes.",
            "default": "us"
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of results to return.",
            "default": 50
          },
          "enrichWithRss": {
            "title": "Enrich with RSS metadata",
            "type": "boolean",
            "description": "Search mode only: fetch each podcast's RSS feed to extract owner email, website, language, episode frequency, and active status. Adds one HTTP request per podcast — slower but ideal for lead generation. Podcast Details mode always enriches automatically.",
            "default": false
          },
          "enrichWithAmp": {
            "title": "Enrich with Apple AMP catalog",
            "type": "boolean",
            "description": "Add subscription/paid-status fields, episodic-vs-serial 'kind', Apple's release-frequency label, podcast launch date, BCP-47 language tag, publisher artist ID, and (in episodes mode) precise audio URL + duration in milliseconds + content rating. Available in search, podcast, charts, and episodes modes. Episodes mode requires the input to be an Apple Podcasts URL or numeric ID (not a raw RSS URL).",
            "default": false
          },
          "trackDeltas": {
            "title": "Track chart rank changes",
            "type": "boolean",
            "description": "Charts mode only: persist chart snapshots between runs. Each entry gets priorRank, rankChange, and status (new/up/down/same). Podcasts that left the chart are emitted with status=\"exited\". On the first run all entries are marked \"new\".",
            "default": true
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "pattern": "^https?://",
            "type": "string",
            "description": "Optional HTTPS endpoint to POST each emitted record to as it is collected. Records are still pushed to the dataset (the webhook is additive). Payload: {event:'result', actorRunId, timestamp, record}. 5-second timeout, 1 retry on failure."
          },
          "dryRun": {
            "title": "Dry run (preview only)",
            "type": "boolean",
            "description": "Preview mode: fetch from Apple as usual but skip dataset writes, webhook calls, and charging. Logs how many records would be emitted. Useful for validating inputs before scheduling a run.",
            "default": false
          },
          "spotifyClientId": {
            "title": "Spotify Client ID",
            "type": "string",
            "description": "Optional. Pair with spotifyClientSecret to cross-map each Apple podcast to its Spotify show via the Spotify Web API. Adds spotifyId, spotifyUrl, and spotifyMatchConfidence (exact|fuzzy) fields. Used in search, podcast, charts, and artist modes. Get credentials at developer.spotify.com."
          },
          "spotifyClientSecret": {
            "title": "Spotify Client Secret",
            "type": "string",
            "description": "Spotify Client Secret. Required when spotifyClientId is set."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}