{
  "openapi": "3.0.1",
  "info": {
    "title": "Spotify Playlist Intelligence",
    "description": "Analyze public Spotify playlists for followers, track mix, artist concentration, play-count distribution, duplicates and duration stats. No cookies needed; works with Apify MCP and the API.",
    "version": "0.2",
    "x-build-id": "p6sR0wZh4pmsIhdEy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~analyze-spotify-playlist/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-analyze-spotify-playlist",
        "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/khadinakbar~analyze-spotify-playlist/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-analyze-spotify-playlist",
        "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/khadinakbar~analyze-spotify-playlist/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-analyze-spotify-playlist",
        "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": [
          "playlistUrls"
        ],
        "properties": {
          "playlistUrls": {
            "title": "Spotify playlist URLs, URIs, or IDs",
            "type": "array",
            "description": "Public Spotify playlists to analyze. Accepts full URLs (https://open.spotify.com/playlist/37i9dQZF1DX0XUsuxWHRQd), URIs (spotify:playlist:37i9dQZF1DX0XUsuxWHRQd) or bare 22-character playlist IDs. Artist, album, track, show and episode links are rejected. Duplicates are merged.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          "maxTracks": {
            "title": "Max tracks per playlist",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many tracks per playlist to read and include in the statistics (and the tracklist). Billing is per playlist, not per track. Up to 5,000; long playlists take longer.",
            "default": 100
          },
          "includeTracklist": {
            "title": "Include tracklist",
            "type": "boolean",
            "description": "When true (default), each report includes the sampled tracks array (name, artists, playcount, duration, explicit flag). Set false for compact agent rows with analytics only.",
            "default": true
          },
          "includeAnalytics": {
            "title": "Include derived analytics",
            "type": "boolean",
            "description": "When on (default), each report includes the analytics block: unique artists, artist concentration, duplicate count, duration stats, play-count spread and an editorial guess.",
            "default": true
          },
          "trackChanges": {
            "title": "Track changes since last run",
            "type": "boolean",
            "description": "When on (default), the Actor remembers each playlist between runs (track list and follower count) and each row says what was added, removed or moved and how followers changed. The memory is kept in a small store in your own Apify account named spotify-playlist-snapshots. The first run for a playlist only saves the starting point.",
            "default": true
          },
          "onlyChanged": {
            "title": "Only playlists that changed",
            "type": "boolean",
            "description": "When on, playlists with no change since the last run are skipped and not charged. Needs Track changes. Useful for scheduled runs.",
            "default": false
          },
          "previousSnapshots": {
            "title": "Previous follower snapshots",
            "type": "array",
            "description": "Optional. Earlier follower counts as a JSON list, each { \"playlistId\": \"22-char-id\", \"followers\": number }. Only needed if you do not use Track changes; the follower change is then added to the row.",
            "items": {
              "type": "object",
              "properties": {
                "playlistId": {
                  "type": "string",
                  "title": "Playlist ID",
                  "description": "22-character Spotify playlist ID matching a playlist in playlistUrls."
                },
                "followers": {
                  "type": "number",
                  "title": "Followers",
                  "description": "Earlier public follower count for that playlist."
                }
              },
              "required": [
                "playlistId",
                "followers"
              ]
            }
          },
          "maxPlaylists": {
            "title": "Max playlists per run",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Most playlists analyzed (and billed) in one run. Default 50, up to 100. Free Apify plan: 10 per run.",
            "default": 50
          },
          "includeArtistReach": {
            "title": "Top-artist reach (not available yet)",
            "type": "boolean",
            "description": "Not available yet. When it is switched on later, it will add monthly listeners of the most frequent artists. Turning it on today does nothing and costs nothing.",
            "default": false
          },
          "comparePlaylists": {
            "title": "Compare playlists (not available yet)",
            "type": "boolean",
            "description": "Not available yet. When it is switched on later, it will add shared tracks and shared artists between the playlists in one run. Turning it on today does nothing and costs nothing.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Leave empty: the Actor connects directly and switches to a plain datacenter proxy by itself if Spotify blocks the direct connection. Set your own proxy only if you need one."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}