Recoup

Get started with Recoup.

API REFERENCE

Research Search

On this page
GET/api/research

Search Recoup Research for artists, tracks or labels by name. Artist and track matches include an id when an identifier is available. Select a match and reuse that ID for detail requests. type accepts artists, tracks or labels, plus their singular aliases, case-insensitively. Playlist search is unavailable. Recoup defaults limit to 10; pagination strings are passed to the data connection and its limits apply.

Use your Recoup API key (x-api-key) or supported bearer credential. Successful artist and track research reads cost $0.05 (50,000 micro-dollar credits). Recoup manages the data connections. Coverage and rate limits vary; see Research availability.

Authentication

See the authentication guide for API key and account access requirements.

Request

cURL
curl --request GET \
  --url 'https://api.recoupable.dev/api/research?q=YOUR_Q' \
  --header 'x-api-key: YOUR_API_KEY'

Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.

Try it

Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.

Kept in this browser tab only and cleared when it closes.

cURL for this request
curl --request GET \
  --url 'https://recoup-api.vercel.app/api/research'

Parameters

Query parameters

qstringrequired

Required search text, such as an artist or track name. For a Spotify artist URL use the lookup endpoint.

typestring · enum

Entity type to search: artists, tracks, or labels.

Values: "artists", "tracks", "labels", "artist", "track", "label"

Default: "artists"

limitstring

Raw pagination string forwarded to the configured research data connection. Recoup defaults limit to 10; offset is omitted when absent. Provider limits apply.

Default: "10"

offsetstring

Raw pagination string forwarded to the configured research data connection. Recoup defaults limit to 10; offset is omitted when absent. Provider limits apply.

Responses

200Search results

application/json

statusstring · enum

Values: "success", "error"

resultsarray<ResearchSearchResult>

Matching artists, tracks or labels with provider identifiers and metadata.

Item properties for results
idstring

Provider-neutral ID.

namestring
avatarstringnullable
site_urlstringnullable
Additional properties

Additional keys are allowed.

400Validation error (e.g., missing required query parameter q)

application/json

statusstring · enumrequired

Values: "error"

errorstringrequired

Human-readable error message describing what went wrong.

401Authentication failed — invalid or missing API key

application/json

statusstring · enumrequired

Values: "error"

errorstringrequired

Human-readable error message describing what went wrong.

402Insufficient research credits. The response includes a static billingUrl; no checkout session is created.

application/json

errorstring · enumrequired

Values: "insufficient_credits"

remaining_creditsintegerrequired
required_creditsintegerrequired
billingUrlstringrequired

Static link to the Recoup app, where a human can save a card and buy credits. It is a constant, not a freshly minted Stripe Checkout Session, so a credit-gated endpoint that keeps returning 402 creates nothing. To buy credits programmatically, call POST /api/credits/sessions.

403Credential, account or provider permission denied.

application/json

statusstring · enumrequired

Values: "error"

errorstringrequired

Human-readable error message describing what went wrong.

404Artist/track resolution or requested provider data was not found. A failed name search may be reported as 404; retry with an exact provider ID when known.

application/json

statusstring · enumrequired

Values: "error"

errorstringrequired

Human-readable error message describing what went wrong.

429Provider rate or quota limit. The adapter returns an error status but does not forward provider Retry-After headers. Avoid an unbounded retry loop.

application/json

statusstring · enumrequired

Values: "error"

errorstringrequired

Human-readable error message describing what went wrong.

500Missing provider configuration, transport failure or internal error.

application/json

statusstring · enumrequired

Values: "error"

errorstringrequired

Human-readable error message describing what went wrong.

501The configured research data source does not support this endpoint or data shape.

application/json

statusstring · enumrequired

Values: "error"

errorstringrequired

Human-readable error message describing what went wrong.

501 example
{
  "status": "error",
  "error": "Request failed with status 501"
}

502Upstream provider failed.

application/json

statusstring · enumrequired

Values: "error"

errorstringrequired

Human-readable error message describing what went wrong.

504the configured research data connection request timed out.

application/json

statusstring · enumrequired

Values: "error"

errorstringrequired

Human-readable error message describing what went wrong.

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download research.json
View operation source
json
{
  "description": "Search Recoup Research for artists, tracks or labels by name. Artist and track matches include an `id` when an identifier is available. Select a match and reuse that ID for detail requests. `type` accepts artists, tracks or labels, plus their singular aliases, case-insensitively. Playlist search is unavailable. Recoup defaults `limit` to 10; pagination strings are passed to the data connection and its limits apply.\n\nUse your Recoup API key (`x-api-key`) or supported bearer credential. Successful artist and track research reads cost $0.05 (50,000 micro-dollar credits). Recoup manages the data connections. Coverage and rate limits vary; see [Research availability](/research-availability).",
  "parameters": [
    {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "Required search text, such as an artist or track name. For a Spotify artist URL use the lookup endpoint.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "type",
      "in": "query",
      "required": false,
      "description": "Entity type to search: artists, tracks, or labels.",
      "schema": {
        "type": "string",
        "enum": [
          "artists",
          "tracks",
          "labels",
          "artist",
          "track",
          "label"
        ],
        "default": "artists"
      }
    },
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Raw pagination string forwarded to the configured research data connection. Recoup defaults limit to 10; offset is omitted when absent. Provider limits apply.",
      "schema": {
        "type": "string",
        "default": "10"
      }
    },
    {
      "name": "offset",
      "in": "query",
      "required": false,
      "description": "Raw pagination string forwarded to the configured research data connection. Recoup defaults limit to 10; offset is omitted when absent. Provider limits apply.",
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Search results",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResearchSearchResponse"
          }
        }
      }
    },
    "400": {
      "description": "Validation error (e.g., missing required query parameter `q`)",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResearchErrorResponse"
          }
        }
      }
    },
    "401": {
      "description": "Authentication failed — invalid or missing API key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResearchErrorResponse"
          }
        }
      }
    },
    "402": {
      "description": "Insufficient research credits. The response includes a static billingUrl; no checkout session is created.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResearchInsufficientCreditsResponse"
          }
        }
      }
    },
    "403": {
      "description": "Credential, account or provider permission denied.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResearchErrorResponse"
          }
        }
      }
    },
    "404": {
      "description": "Artist/track resolution or requested provider data was not found. A failed name search may be reported as 404; retry with an exact provider ID when known.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResearchErrorResponse"
          }
        }
      }
    },
    "429": {
      "description": "Provider rate or quota limit. The adapter returns an error status but does not forward provider Retry-After headers. Avoid an unbounded retry loop.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResearchErrorResponse"
          }
        }
      }
    },
    "500": {
      "description": "Missing provider configuration, transport failure or internal error.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResearchErrorResponse"
          }
        }
      }
    },
    "501": {
      "$ref": "#/components/responses/ResearchDataSourceUnsupported"
    },
    "502": {
      "description": "Upstream provider failed.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResearchErrorResponse"
          }
        }
      }
    },
    "504": {
      "description": "the configured research data connection request timed out.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResearchErrorResponse"
          }
        }
      }
    }
  }
}