Skip to Content
Podcast Lookup

Errors

Error format, every error code, and how to handle each.

Errors use standard HTTP status codes and a JSON body with a stable, machine-readable code and a human-readable message:

{
  "error": {
    "code": "credits_exhausted",
    "message": "All 50 credits of this month on the Free plan are used. Upgrade at https://www.podcastlookup.com/pricing or wait until 2027-01-01."
  }
}

Branch on code, never on message: messages may be reworded.

Error codes

StatusCodeWhat happenedWhat to do
400invalid_parameterA numeric parameter isn't an integerFix the request
400invalid_podcast_idPodcast ids are positive integersUse an id from search
400invalid_episode_idEmpty or too long episode idUse an id from the episodes list
400invalid_page / invalid_page_sizepage < 1, or page_size outside 1–100Fix the request
400too_many_valuesMore than 10 values for one filterSplit the search
400cannot_requestThe episode can't be transcribed (no audio)Nothing to do
401missing_api_keyNo key in the requestSend Authorization: Bearer pl_…
401invalid_api_keyThe key is wrong, revoked or expiredCheck or create a key
402payment_past_dueThe last subscription payment failedUpdate your card from your account
402credits_exhaustedThe month's credits (and any extra credits) are spentWait for the reset or upgrade
403email_not_verifiedThe account's email isn't confirmedConfirm it from the email we sent
404podcast_not_foundNo podcast with this idCheck the id
404episode_not_foundThe episode isn't storedList episodes first
404transcript_not_availableNo transcript for this episode yetRequest one
429rate_limitedPer-minute limit reachedWait Retry-After seconds
429refresh_too_soonPodcast refreshed less than a minute agoWait Retry-After seconds
500internal_errorSomething broke on our sideRetry with backoff
502feed_unavailableThe podcast's own feed didn't answerRetry later

Retrying

Only retry 429, 500 and 502. For 429, wait the number of seconds in Retry-After. For 5xx, use exponential backoff (1 s, 2 s, 4 s…) and give up after a few attempts.

async function call(url: string, init: RequestInit = {}, attempt = 0): Promise<Response> {
  const response = await fetch(url, {
    ...init,
    headers: { ...init.headers, Authorization: `Bearer ${process.env.PODCAST_LOOKUP_API_KEY}` },
  })
  const retryable = response.status === 429 || response.status >= 500
  if (!retryable || attempt >= 4) return response

  const retryAfter = Number(response.headers.get("Retry-After"))
  const delay = retryAfter > 0 ? retryAfter * 1000 : 2 ** attempt * 1000
  await new Promise((resolve) => setTimeout(resolve, delay))
  return call(url, init, attempt + 1)
}

MCP errors

MCP tools return the same codes as text, with isError: true, for example episode_not_found: No such episode. List the podcast's episodes first (that also reads its feed). Agents read these messages and usually recover on their own. Authentication and subscription errors (401, 402, 403) are returned as HTTP errors before the MCP session starts.