# Discogs Search API Documentation

<p><strong>Discogs Search API Documentation</strong> Search the Discogs database for releases, masters, artists or labels. Each hit has its id, type, title, year, country, formats, labels, genres, styles, catalog number, barcodes, master id, page url and the community have and want counts. Filters narrow the hits on the Discogs side: every hit follows format, genre, style, year and country. Results are paged with page and per_page (up to 100). Discogs serves at most 10,000 hits per search: a page past that, or past the last page, answers 422 and is never page 1 again. Cover images are not in search hits: the release endpoint returns the images. Cost: 1 credit per successful search with hits. A search with no hit answers 200 and costs nothing.</p>

- **Documentation:** [https://scrappa.co/docs/discogs-api/discogs_search](https://scrappa.co/docs/discogs-api/discogs_search)
- **API group:** Discogs API
- **Endpoint:** `GET https://scrappa.co/api/discogs/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `q` | string | No | Search text, up to 200 characters. Example: nirvana nevermind. Required unless you send at least one filter. |
| `type` | string | No | release, master, artist or label. Default: release. |
| `format` | string | No | Format filter, for example Vinyl, CD, Cassette or LP. |
| `genre` | string | No | Genre filter, for example Rock or Electronic. |
| `style` | string | No | Style filter, for example Grunge or House. |
| `year` | integer | No | Four digit release year, for example 1991. |
| `country` | string | No | Country of release as Discogs names it, for example US, UK or Germany. |
| `page` | integer | No | Page number, starting at 1. Default: 1. |
| `per_page` | integer | No | Hits per page, 1 to 100. Default: 25. |

## Example response

```json
{
    "data": {
        "type": "release",
        "query": "nirvana",
        "results": [
            {
                "id": 7445961,
                "url": "https://www.discogs.com/release/7445961-Nirvana-Nirvana",
                "type": "release",
                "year": 2015,
                "title": "Nirvana - Nirvana",
                "genres": [
                    "Rock"
                ],
                "labels": [
                    "DGC",
                    "Sub Pop",
                    "Geffen Records",
                    "Geffen Records",
                    "Optimal Media GmbH"
                ],
                "styles": [
                    "Grunge",
                    "Alternative Rock"
                ],
                "country": "Europe",
                "formats": [
                    "Vinyl",
                    "LP",
                    "Compilation",
                    "Reissue"
                ],
                "barcodes": [
                    "6 02547 37878 1",
                    "602547378781",
                    "BIEM/SDRM",
                    "BF93390-01 A1 602547378781-A CB",
                    "BF93390-01 B1 602547378781-B CB"
                ],
                "community": {
                    "have": 22846,
                    "want": 1802
                },
                "master_id": 42476,
                "catalog_number": "0602547378781"
            }
        ],
        "pagination": {
            "page": 1,
            "pages": 1793,
            "total": 3585,
            "per_page": 2
        }
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing or invalid. This response is not billable. |
| 422 | Page Out Of Range | The page is past the last page or past the 10,000 hit limit of Discogs. This response is not billable. |
| 503 | Service Unavailable | Discogs could not be reached, refused the request or changed its answer. This response is not billable. Retry later. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
