{
  "openapi": "3.0.1",
  "info": {
    "title": "Spotify Scraper - Streams, Monthly Listeners, Charts",
    "description": "Scrape Spotify stream counts for every track and album of an artist, monthly listeners, top artists and daily or weekly charts for 70+ countries. No login or API key. Daily numbers, only-new mode. Export to Excel, CSV or API.",
    "version": "0.1",
    "x-build-id": "OaNrczjUE2lNsjA8R"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pshivam~spotify-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pshivam-spotify-stats-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/pshivam~spotify-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-pshivam-spotify-stats-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/pshivam~spotify-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-pshivam-spotify-stats-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",
        "properties": {
          "resultType": {
            "title": "What to get",
            "enum": [
              "tracks",
              "artists",
              "albums",
              "charts",
              "topListeners",
              "topArtists",
              "topTracks"
            ],
            "type": "string",
            "description": "tracks: every track of the artists with its total streams and daily streams. artists: one summary row per artist with total streams and monthly listeners. albums: every album of the artists with streams. charts: Spotify's daily or weekly chart of countries. topListeners: the artists with the most monthly listeners. topArtists: the artists with the most streams. topTracks: the most streamed songs of all time or of a year.",
            "default": "tracks"
          },
          "artists": {
            "title": "Artists",
            "type": "array",
            "description": "For tracks, artists and albums: artist names (Taylor Swift), Spotify links (https://open.spotify.com/artist/...) or Spotify artist ids. One per line. Names are matched against the top artists that Kworb lists; a link or id always works.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "For charts: country names or two-letter codes (us, gb, de, in, br), or global. One per line. Empty means global. More than 70 countries have a chart.",
            "items": {
              "type": "string"
            }
          },
          "periods": {
            "title": "Chart periods",
            "type": "array",
            "description": "For charts: daily (the last day, with the 7-day numbers), weekly, or both. Empty means daily.",
            "items": {
              "type": "string",
              "enum": [
                "daily",
                "weekly"
              ],
              "enumTitles": [
                "Daily chart",
                "Weekly chart"
              ]
            }
          },
          "songsYear": {
            "title": "Year of the most streamed songs",
            "type": "string",
            "description": "For topTracks: all for all time, or a year such as 2025. Years before 2010 are available for 2005, 2000, 1990 and so on.",
            "default": "all"
          },
          "includeFeatures": {
            "title": "Include features",
            "type": "boolean",
            "description": "For tracks: also return the tracks where the artist is a featured artist, marked with isFeature.",
            "default": true
          },
          "onlyNew": {
            "title": "Only new records",
            "type": "boolean",
            "description": "Skip rows of days that earlier runs of this same search already returned, so you get and pay for new days only. Schedule it daily to collect a history. The first run works as usual and remembers what it returned, in your key-value store 'spotify-stats-scraper-only-new'.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Stop after this many records in total. You are charged per record.",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Pages at the same time",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many pages are read in parallel. The source is a small site, so keep it low.",
            "default": 2
          },
          "secondsBetweenRequests": {
            "title": "Seconds between requests",
            "minimum": 0.05,
            "maximum": 60,
            "type": "number",
            "description": "Pause between requests. After a slow-down answer the Actor doubles the pause and switches to Apify Proxy when it can.",
            "default": 0.5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}