---
updatedAt: 2025-03-13T20:23:05.000Z
agentTools:
  projectIndex: https://spotscraper.readme.io/llms.txt
---

# Get artist discography

Retrieves the complete discography for a specific artist

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "SpotScraper API",
    "description": "API for retrieving Spotify data including albums, artists, playlists, tracks, podcasts, and users",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.spotscraper.com/v1",
      "description": "Production server"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/artists/{id}/discography": {
      "get": {
        "tags": [
          "Artists"
        ],
        "summary": "Get artist discography",
        "description": "Retrieves the complete discography for a specific artist",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Spotify Artist ID"
          },
          {
            "in": "query",
            "name": "fetchTracks",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Whether to fetch full track data for each album"
          }
        ],
        "responses": {
          "200": {
            "description": "Discography found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscographyResponse"
                }
              }
            }
          },
          "404": {
            "description": "Discography not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "Track": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Spotify Track ID"
          },
          "uri": {
            "type": "string",
            "description": "Spotify Track URI"
          },
          "name": {
            "type": "string",
            "description": "Track name"
          },
          "popularity": {
            "type": "integer",
            "description": "Track popularity (0-100)"
          },
          "isrc": {
            "type": "string",
            "nullable": true,
            "description": "International Standard Recording Code (ISRC)"
          },
          "metadata": {
            "type": "object",
            "properties": {
              "explicit": {
                "type": "boolean",
                "description": "Whether the track contains explicit content"
              },
              "isPlayable": {
                "type": "boolean",
                "description": "Whether the track is playable"
              },
              "durationMs": {
                "type": "integer",
                "description": "Duration of the track in milliseconds"
              },
              "discNumber": {
                "type": "integer",
                "description": "Disc number of the track"
              },
              "trackNumber": {
                "type": "integer",
                "description": "Track number on the disc"
              },
              "attributes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Track attributes"
              }
            }
          },
          "statistics": {
            "type": "object",
            "properties": {
              "playCount": {
                "type": "integer",
                "description": "Total play count for the track"
              }
            }
          },
          "artists": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Spotify Artist ID"
                },
                "uri": {
                  "type": "string",
                  "description": "Spotify Artist URI"
                },
                "name": {
                  "type": "string",
                  "description": "Artist name"
                },
                "images": {
                  "type": "object",
                  "properties": {
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string"
                          },
                          "width": {
                            "type": "integer"
                          },
                          "height": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "description": "Artists who performed the track"
          },
          "album": {
            "type": "object",
            "nullable": true,
            "properties": {
              "id": {
                "type": "string",
                "description": "Spotify Album ID"
              },
              "uri": {
                "type": "string",
                "description": "Spotify Album URI"
              },
              "name": {
                "type": "string",
                "description": "Album name"
              },
              "images": {
                "type": "object",
                "properties": {
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "width": {
                          "type": "integer"
                        },
                        "height": {
                          "type": "integer"
                        }
                      }
                    }
                  },
                  "hex": {
                    "type": "string",
                    "description": "Extracted color hex value"
                  }
                }
              },
              "copyright": {
                "type": "string",
                "description": "Album copyright information"
              }
            },
            "description": "Album the track belongs to"
          }
        }
      },
      "DiscographyResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/DiscographyData"
          },
          "type": {
            "type": "string",
            "enum": [
              "artist_discography"
            ]
          }
        }
      },
      "DiscographyData": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "description": "Whether the discography fetch was successful"
          },
          "albums": {
            "$ref": "#/components/schemas/DiscographySection"
          },
          "singles": {
            "$ref": "#/components/schemas/DiscographySection"
          },
          "eps": {
            "$ref": "#/components/schemas/DiscographySection"
          }
        }
      },
      "DiscographySection": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "description": "Whether this section was fetched successfully"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscographyAlbum"
            }
          }
        }
      },
      "DiscographyAlbum": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Album ID"
          },
          "uri": {
            "type": "string",
            "description": "Album URI"
          },
          "name": {
            "type": "string",
            "description": "Album name"
          },
          "type": {
            "type": "string",
            "description": "Release type (ALBUM, SINGLE, EP)"
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "description": "Release date"
          },
          "images": {
            "type": "object",
            "properties": {
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "width": {
                      "type": "integer"
                    },
                    "height": {
                      "type": "integer"
                    }
                  }
                }
              },
              "hex": {
                "type": "string",
                "description": "Extracted color hex value"
              }
            }
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Track"
            },
            "description": "Album tracks (only included if fetchTracks parameter is true)"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "HTTP status code"
          }
        }
      }
    }
  }
}
```