> **For coding agents and LLMs:** This is one page from the Social Fetch docs (markdown export). The sections below mirror the orientation block in [`/llms.txt`](https://www.socialfetch.dev/llms.txt); use [`/llms.json`](https://www.socialfetch.dev/llms.json) when you need a structured operation inventory. The catalog covers documented operations with on-site reference pages.

## This page

- **On-site (HTML):** [https://www.socialfetch.dev/docs/api/v1/spotify/artist/get](https://www.socialfetch.dev/docs/api/v1/spotify/artist/get)
- **Markdown (.mdx) URL:** [https://www.socialfetch.dev/docs/api/v1/spotify/artist/get.mdx](https://www.socialfetch.dev/docs/api/v1/spotify/artist/get.mdx)

## API base URL and authentication

- **API origin (from OpenAPI `servers`):** `https://api.socialfetch.dev`
- **Authentication:** send `x-api-key: sfk_...` on `/v1/**` routes unless the operation is explicitly anonymous (check OpenAPI `security`, the [API reference hub](https://www.socialfetch.dev/docs/api.mdx), [`/llms.txt`](https://www.socialfetch.dev/llms.txt), or [`/llms.json`](https://www.socialfetch.dev/llms.json) for each route).
- **OpenAPI JSON:** [https://www.socialfetch.dev/openapi.json](https://www.socialfetch.dev/openapi.json)

## Recommended docs entrypoints (this site)

- [Documentation overview](https://www.socialfetch.dev/docs.mdx) — top-level orientation (markdown).
- [Quickstart](https://www.socialfetch.dev/docs/quickstart.mdx) — authenticate with `x-api-key`, validate auth with `whoami`, and understand the JSON envelope.
- [SDK](https://www.socialfetch.dev/docs/sdk.mdx) — official TypeScript SDK guide, including `SocialFetchClient`, `Result`, and `unwrap()`.
- [SDK reference](https://www.socialfetch.dev/docs/sdk-reference.mdx) — exhaustive SDK method inventory and route mapping for agents, tooling, and power users.
- [Choose the right endpoint](https://www.socialfetch.dev/docs/choose-endpoint.mdx) — task-oriented route selection for smoke tests, profiles, list endpoints, and single-item lookups.
- [Capability matrix](https://www.socialfetch.dev/docs/capability-matrix.mdx) — fast comparison of identifiers, pagination, outcomes, media download, and SDK coverage.
- [`/llms.json`](https://www.socialfetch.dev/llms.json) — structured machine-readable operation inventory with parameter names, pagination, outcomes, credits, and SDK mapping.
- [API reference hub](https://www.socialfetch.dev/docs/api.mdx) — human-friendly index of operations with links into generated pages.
- [Errors](https://www.socialfetch.dev/docs/errors.mdx) — shared error envelope and HTTP status guidance.
- [Credits](https://www.socialfetch.dev/docs/credits.mdx) — metering, `402`, and planning batch jobs.
- Outcome semantics such as `found`, `not_found`, and `private` are documented in [Errors](https://www.socialfetch.dev/docs/errors.mdx) and on operation pages when present in the OpenAPI contract.

## Markdown docs convention

- Every docs page has a markdown twin: append **`.mdx`** to the docs pathname (for example `/docs/quickstart` → `/docs/quickstart.mdx`).
- Agents that send `Accept: text/markdown` on `/docs/**` HTML URLs may receive markdown directly (same URL, `Vary: Accept`).

---
# Get Spotify artist (https://www.socialfetch.dev/docs/api/v1/spotify/artist/get)

## Summary

Get a Spotify artist by id or profile URL.

**Tags:** `Spotify`

## HTTP

- **Method:** GET
- **Path:** `/v1/spotify/artist`
- **Base URL:** `https://api.socialfetch.dev`

## Capability summary

- **SDK mapping:** `client.spotify.getArtist({ artistId?, url? })`
- **Accepted identifiers:** `url` (query)
- **Pagination:** none
- **Business outcome field:** `data.lookupStatus` with values `found`, `not_found`

## Authentication

- **`x-api-key`**: API key (`sfk_...`)

## Parameters

### `artistId` (query)

- **Required:** no
- **Constraints:** type `string`; minLength: 1; maxLength: 128
- **Description:** Optional Spotify artist id for the request.

### `url` (query)

- **Required:** no
- **Constraints:** type `string`; minLength: 1; maxLength: 4096
- **Description:** Optional Spotify artist URL for the request.

## Responses (status codes)

- **200**: Lookup result. Check `data.lookupStatus` for `found` or `not_found`.
- **400**: Invalid query or bad request
- **401**: Missing or invalid API key
- **402**: Insufficient credits
- **500**: Unexpected or billing error
- **502**: Lookup could not be completed from the response (unexpected or invalid data).
- **503**: Service temporarily unavailable; safe to retry with backoff.

## Response body (200)

Lookup result. Check `data.lookupStatus` for `found` or `not_found`.

### Field outline

- **data** (required) — type `object`. Endpoint-specific response payload.
  - **lookupStatus** (required) — type `string`; enum: found, not_found. Whether the artist was found or not found.
  - **artist** (required) — type `object`; nullable. Artist details when available.
    - **platform** (required) — type `string`; enum: spotify. Platform for this artist.
    - **artistId** (required) — type `string`; minLength: 1. Stable Spotify artist identifier.
    - **displayName** (required) — type `string`; minLength: 1. Public display name for the artist.
    - **bio** (required) — type `string`; nullable. Artist biography text when available.
    - **avatarUrl** (required) — type `string`; nullable. Best available square avatar image URL when available.
    - **profileUrl** (required) — type `string`; minLength: 1. Canonical public Spotify artist profile URL.
    - **verified** (required) — type `boolean`. Whether the artist is marked as verified on Spotify.
    - **externalLinks** (optional) — type `array`. Outbound profile links when available.
      - _items:_
        - **name** (required) — type `string`; minLength: 1. Link label as shown on the artist profile (e.g. INSTAGRAM).
        - **url** (required) — type `string`; minLength: 1. Outbound URL for this link.
  - **metrics** (required) — type `object`; nullable. Artist metrics when available.
    - **followers** (required) — type `integer`; minimum: 0. Follower count for the artist.
    - **monthlyListeners** (optional) — type `integer`; minimum: 0. Monthly listener count when available.
    - **worldRank** (optional) — type `integer`; minimum: 0. Global popularity rank when available.
    - **topCities** (optional) — type `array`. Top listener cities when available.
      - _items:_
        - **city** (required) — type `string`; minLength: 1. City name.
        - **country** (required) — type `string`; minLength: 1. ISO country code when available.
        - **listeners** (required) — type `integer`; minimum: 0. Monthly listener count for this city when available.
        - **region** (optional) — type `string`. Region code within the country when available.
  - **relatedArtists** (required) — type `array`. Related artists when available (may be empty).
    - _items:_
      - **artistId** (required) — type `string`; minLength: 1. Related artist Spotify id.
      - **displayName** (required) — type `string`; minLength: 1. Related artist display name.
      - **avatarUrl** (required) — type `string`; nullable. Best available avatar URL for the related artist.
      - **profileUrl** (required) — type `string`; minLength: 1. Canonical public Spotify URL for the related artist.
  - **discographySummary** (optional) — type `object`. Discography counts when available.
    - **albumCount** (required) — type `integer`; minimum: 0. Number of albums listed in the artist discography.
    - **singleCount** (required) — type `integer`; minimum: 0. Number of singles listed in the artist discography.
    - **compilationCount** (required) — type `integer`; minimum: 0. Number of compilations listed in the artist discography.
- **meta** (required) — type `object`. Metadata describing the request and billing outcome.
  - **requestId** (required) — type `string`; minLength: 1. Unique request identifier for tracing this API call.
  - **creditsCharged** (required) — type `integer`; minimum: 0. Credits charged for this request.
  - **version** (required) — type `string`; enum: v1. Public API version that served the response.

### Example JSON (found)

```json
{
  "data": {
    "lookupStatus": "found",
    "artist": {
      "platform": "spotify",
      "artistId": "1uNFoZAHBGtllmzznpCI3s",
      "displayName": "Justin Bieber",
      "bio": "Since his emergence in 2008, Justin Bieber has quietly worked towards delivering a career-defining artistic statement with his 2025 seventh full-length album, SWAG via Def Jam Recordings. Beyond writing songs and performing, he co-produced the LP which is a 21-track opus evocative of his evolution, yet indicative of the signature spirit millions of fans first fell in love with. \n\nUp to this point, he has smashed countless records, captivated crowds globally and led 21st century pop music and culture as both the preeminent entertainer of his generation and a peerless boundary-pushing creative force. From humble beginnings in Ontario, Canada, the Los Angeles-based singer, songwriter, and producer has elevated to one of the best-selling artists in history, moving over 150 million albums worldwide, generating nearly 200 billion streams, and scoring an astonishing 5 RIAA Diamond certifications. Speaking to his versatility, he has also delivered cross-generational hits in genres as diverse as pop, electronic, hip-hop, R&amp;B, Latin, and more. With SWAG, he continues an unbelievable journey as an era-defining superstar whose influence is unstoppable and unparalleled.",
      "avatarUrl": null,
      "profileUrl": "https://open.spotify.com/artist/1uNFoZAHBGtllmzznpCI3s?si=4W1DlCLSTR2plslOINBq_A",
      "verified": true
    },
    "metrics": {
      "followers": 90965890,
      "monthlyListeners": 143198848,
      "worldRank": 1,
      "topCities": [
        {
          "city": "London",
          "country": "GB",
          "listeners": 2216095,
          "region": "ENG"
        },
        {
          "city": "São Paulo",
          "country": "BR",
          "listeners": 1847775,
          "region": "SP"
        },
        {
          "city": "Jakarta",
          "country": "ID",
          "listeners": 1639263,
          "region": "JK"
        },
        {
          "city": "Quezon City",
          "country": "PH",
          "listeners": 1476119,
          "region": "00"
        },
        {
          "city": "Mexico City",
          "country": "MX",
          "listeners": 1424041,
          "region": "CMX"
        }
      ]
    },
    "relatedArtists": [
      {
        "artistId": "0du5cEVh5yTK9QJze8zA0C",
        "displayName": "Bruno Mars",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5ebc7688aad1bf03986934d7e26",
        "profileUrl": "https://open.spotify.com/artist/0du5cEVh5yTK9QJze8zA0C"
      },
      {
        "artistId": "66CXWjxzNUsdJxJ2JdwvnR",
        "displayName": "Ariana Grande",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb766397ec42a573a53eb5fb87",
        "profileUrl": "https://open.spotify.com/artist/66CXWjxzNUsdJxJ2JdwvnR"
      },
      {
        "artistId": "5pKCCKE2ajJHZ9KAiaK11H",
        "displayName": "Rihanna",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5ebcb565a8e684e3be458d329ac",
        "profileUrl": "https://open.spotify.com/artist/5pKCCKE2ajJHZ9KAiaK11H"
      },
      {
        "artistId": "6S0dmVVn4udvppDhZIWxCr",
        "displayName": "Sean Kingston",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5ebee205e5029a04bd0460e16e4",
        "profileUrl": "https://open.spotify.com/artist/6S0dmVVn4udvppDhZIWxCr"
      },
      {
        "artistId": "04gDigrS5kc9YWfZHwBETP",
        "displayName": "Maroon 5",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5ebf8349dfb619a7f842242de77",
        "profileUrl": "https://open.spotify.com/artist/04gDigrS5kc9YWfZHwBETP"
      },
      {
        "artistId": "2tIP7SsRs7vjIcLrU85W8J",
        "displayName": "The Kid LAROI",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb8ae6a1046094624d95b115cb",
        "profileUrl": "https://open.spotify.com/artist/2tIP7SsRs7vjIcLrU85W8J"
      },
      {
        "artistId": "6jJ0s89eD6GaHleKKya26X",
        "displayName": "Katy Perry",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb049c9a9ae6f93f81ab517798",
        "profileUrl": "https://open.spotify.com/artist/6jJ0s89eD6GaHleKKya26X"
      },
      {
        "artistId": "1Xyo4u8uXC1ZmMpatF05PJ",
        "displayName": "The Weeknd",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5ebc1719ac9e6a75c1c25835018",
        "profileUrl": "https://open.spotify.com/artist/1Xyo4u8uXC1ZmMpatF05PJ"
      },
      {
        "artistId": "6VuMaDnrHyPL1p4EHjYLi7",
        "displayName": "Charlie Puth",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb6721f541fb123145d4cb3ace",
        "profileUrl": "https://open.spotify.com/artist/6VuMaDnrHyPL1p4EHjYLi7"
      },
      {
        "artistId": "7n2wHs1TKAczGzO7Dd2rGr",
        "displayName": "Shawn Mendes",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb58b4b9419486550f6fda0535",
        "profileUrl": "https://open.spotify.com/artist/7n2wHs1TKAczGzO7Dd2rGr"
      },
      {
        "artistId": "540vIaP2JwjQb9dm3aArA4",
        "displayName": "DJ Snake",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb175df1a8848d8ff67c6d5600",
        "profileUrl": "https://open.spotify.com/artist/540vIaP2JwjQb9dm3aArA4"
      },
      {
        "artistId": "5CiGnKThu5ctn9pBxv7DGa",
        "displayName": "benny blanco",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb9e339e423b680759b0006a63",
        "profileUrl": "https://open.spotify.com/artist/5CiGnKThu5ctn9pBxv7DGa"
      },
      {
        "artistId": "1Xylc3o4UrD53lo9CvFvVg",
        "displayName": "Zara Larsson",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5ebd519a7e349541cba8f85e965",
        "profileUrl": "https://open.spotify.com/artist/1Xylc3o4UrD53lo9CvFvVg"
      },
      {
        "artistId": "5ZsFI1h6hIdQRw2ti0hz81",
        "displayName": "ZAYN",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb830845d2fa6c5c7874176951",
        "profileUrl": "https://open.spotify.com/artist/5ZsFI1h6hIdQRw2ti0hz81"
      },
      {
        "artistId": "31TPClRtHm23RisEBtV3X7",
        "displayName": "Justin Timberlake",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb7a5cfe2597665a3d160e805e",
        "profileUrl": "https://open.spotify.com/artist/31TPClRtHm23RisEBtV3X7"
      },
      {
        "artistId": "6eUKZXaKkcviH0Ku9w2n3V",
        "displayName": "Ed Sheeran",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5ebd55c95ad400aed87da52daec",
        "profileUrl": "https://open.spotify.com/artist/6eUKZXaKkcviH0Ku9w2n3V"
      },
      {
        "artistId": "5ndkK3dpZLKtBklKjxNQwT",
        "displayName": "B.o.B",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb834607348a8574d8f3b7a2ca",
        "profileUrl": "https://open.spotify.com/artist/5ndkK3dpZLKtBklKjxNQwT"
      },
      {
        "artistId": "0C8ZW7ezQVs4URX5aX7Kqx",
        "displayName": "Selena Gomez",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5eb815e520e3ce7fe210046ba66",
        "profileUrl": "https://open.spotify.com/artist/0C8ZW7ezQVs4URX5aX7Kqx"
      },
      {
        "artistId": "4AK6F7OLvEQ5QYCBNiQWHq",
        "displayName": "One Direction",
        "avatarUrl": "https://i.scdn.co/image/5bb443424a1ad71603c43d67f5af1a04da6bb3c8",
        "profileUrl": "https://open.spotify.com/artist/4AK6F7OLvEQ5QYCBNiQWHq"
      },
      {
        "artistId": "21E3waRsmPlU7jZsS13rcj",
        "displayName": "Ne-Yo",
        "avatarUrl": "https://i.scdn.co/image/ab6761610000e5ebca118e3822061f7b7f6bc537",
        "profileUrl": "https://open.spotify.com/artist/21E3waRsmPlU7jZsS13rcj"
      }
    ],
    "discographySummary": {
      "albumCount": 10,
      "singleCount": 10,
      "compilationCount": 0
    }
  },
  "meta": {
    "requestId": "req_01example",
    "creditsCharged": 1,
    "version": "v1"
  }
}
```

### Example JSON (not_found)

```json
{
  "data": {
    "lookupStatus": "not_found",
    "artist": null,
    "metrics": null,
    "relatedArtists": []
  },
  "meta": {
    "requestId": "req_01example_nf",
    "creditsCharged": 1,
    "version": "v1"
  }
}
```

### Machine-readable error codes

When an error JSON body is returned, it may include one of these `error.code` values (derived from the OpenAPI schemas for this operation; additional codes may exist at runtime):

- `bad_request`

## Error handling & retries

Interpret HTTP status codes using the descriptions below. Do not assume a JSON body unless the OpenAPI schema defines one for that status.

- **400**: Invalid query or bad request **Retry:** Fix the request; retrying the same invalid payload will not help.
- **401**: Missing or invalid API key **Retry:** Fix the API key first; retrying without changes will not help.
- **402**: Insufficient credits **Retry:** Do not retry without resolving billing/credits (retrying the same request will not help).
- **500**: Unexpected or billing error
- **502**: Lookup could not be completed from the response (unexpected or invalid data). **Retry:** May be transient; a few retries with backoff are reasonable.
- **503**: Service temporarily unavailable; safe to retry with backoff. **Retry:** Usually safe to retry with exponential backoff and jitter.

### Suggested client defaults

- Send the API key using the `x-api-key` header on every request.
- On `503` (and sometimes `502`), retry with backoff; cap retries and surface a clear error to the user.
- On `402`, surface an actionable billing message rather than blind retries.

## Examples

### TypeScript SDK

```typescript
import { SocialFetchClient } from "@socialfetch/sdk";

const client = new SocialFetchClient({
  apiKey: process.env.SOCIALFETCH_API_KEY!,
});

const result = await client.spotify.getArtist({
  artistId: "1uNFoZAHBGtllmzznpCI3s",
});

if (!result.ok) {
  console.error(result.error);
} else {
  console.log(result.value.data);
}
```

### Node.js

```javascript
const response = await fetch(
  "https://api.socialfetch.dev/v1/spotify/artist",
  {
    headers: {
      "x-api-key": "YOUR_API_KEY",
    }
  }
);

const data = await response.json();
console.log(data);
```

### cURL

```bash
curl "https://api.socialfetch.dev/v1/spotify/artist" \
  -H "x-api-key: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.get(
    "https://api.socialfetch.dev/v1/spotify/artist",
    headers={"x-api-key": "YOUR_API_KEY"},
)
data = response.json()
print(data)
```