{
  "openapi": "3.0.1",
  "info": {
    "title": "Spotify Music Catalog, Stats & Playlist Extractor",
    "description": "Export public Spotify catalog data without a login or developer key: artist audience stats, album and track play counts, full playlists and keyword search. Paste mixed Spotify URLs or URIs, or search the catalog, then export nested entity rows or one flat row per track.",
    "version": "0.1",
    "x-build-id": "eIT8XmUw0gn2EcumX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/xyrelith-data~spotify-music-catalog-stats-playlist-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-xyrelith-data-spotify-music-catalog-stats-playlist-extractor",
        "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/xyrelith-data~spotify-music-catalog-stats-playlist-extractor/runs": {
      "post": {
        "operationId": "runs-sync-xyrelith-data-spotify-music-catalog-stats-playlist-extractor",
        "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/xyrelith-data~spotify-music-catalog-stats-playlist-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-xyrelith-data-spotify-music-catalog-stats-playlist-extractor",
        "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",
              "byUrls"
            ],
            "type": "string",
            "description": "Choose how to find Spotify entities.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query (mode=search)",
            "type": "string",
            "description": "Keyword search text, for example an artist, song, album or playlist name. Spotify returns its own relevance order.",
            "default": "Taylor Swift"
          },
          "searchType": {
            "title": "Search result type (mode=search)",
            "enum": [
              "track",
              "artist",
              "album",
              "playlist",
              "all"
            ],
            "type": "string",
            "description": "Which Spotify entity type to search. Choose All to search tracks, artists, albums and playlists in one run.",
            "default": "track"
          },
          "spotifyUrls": {
            "title": "Spotify URLs or URIs (mode=byUrls)",
            "type": "array",
            "description": "Paste any mix of Spotify artist, album, track and playlist links or URIs. Examples: https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02, spotify:track:11dFghVXANMlKmJXsNCbNl, https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on emitted dataset rows for the whole run.",
            "default": 100
          },
          "maxItemsPerInput": {
            "title": "Maximum records per input (mode=byUrls)",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on emitted rows for each pasted URL/URI. Applies to artist expansions, album track rows and playlist track rows. It does not apply to search mode.",
            "default": 100
          },
          "maxTracksPerPlaylist": {
            "title": "Maximum tracks per playlist",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "How many playlist tracks to include. Spotify is paged 100 tracks at a time, so any playlist length can be covered; the playlist record still reports the full totalTracks count.",
            "default": 500
          },
          "outputLayout": {
            "title": "Output layout",
            "enum": [
              "entity",
              "track"
            ],
            "type": "string",
            "description": "Entity layout keeps one row per artist/album/track/playlist with nested track lists. Track layout emits one flat row per track, ready for play-count spreadsheets.",
            "default": "entity"
          },
          "includeTrackPlayCounts": {
            "title": "Include track play counts",
            "type": "boolean",
            "description": "Include exact Spotify play counts on tracks, plus album and playlist play-count totals. Turn off for a lighter record.",
            "default": true
          },
          "includeArtistTopCities": {
            "title": "Include artist top cities",
            "type": "boolean",
            "description": "Include the artist's top listener cities with listener counts (mode=search type=artist or mode=byUrls with an artist link).",
            "default": true
          },
          "expandArtistAlbums": {
            "title": "Expand artist albums (mode=byUrls)",
            "type": "boolean",
            "description": "When an artist URL is scraped, also emit one album record for every album in the discography.",
            "default": false
          },
          "expandArtistSingles": {
            "title": "Expand artist singles and EPs",
            "type": "boolean",
            "description": "When an artist URL is scraped, also emit one album record for every single and EP.",
            "default": false
          },
          "expandArtistCompilations": {
            "title": "Expand artist compilations",
            "type": "boolean",
            "description": "When an artist URL is scraped, also emit one album record for every compilation.",
            "default": false
          },
          "expandArtistAppearsOn": {
            "title": "Expand artist appears-on releases",
            "type": "boolean",
            "description": "When an artist URL is scraped, also emit one album record for every release the artist appears on.",
            "default": false
          },
          "expandArtistRelated": {
            "title": "Expand related artists",
            "type": "boolean",
            "description": "When an artist URL is scraped, also emit full artist records for Spotify's related artists.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}