{"record":{"id":"c23a099400889567","repo":"jackwener/OpenCLI","slug":"not-found-c23a09","errorCode":"NOT_FOUND","errorMessage":"NOT_FOUND: No podcasts found","messagePattern":"NOT_FOUND: No podcasts found","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"warning","filePath":"clis/apple-podcasts/search.js","lineNumber":21,"sourceCode":"import { itunesFetch } from './utils.js';\ncli({\n    site: 'apple-podcasts',\n    name: 'search',\n    access: 'read',\n    description: 'Search Apple Podcasts',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'query', positional: true, required: true, help: 'Search keyword' },\n        { name: 'limit', type: 'int', default: 10, help: 'Max results' },\n    ],\n    columns: ['id', 'title', 'author', 'episodes', 'genre', 'url'],\n    func: async (args) => {\n        const term = encodeURIComponent(args.query);\n        const limit = Math.max(1, Math.min(Number(args.limit), 25));\n        const data = await itunesFetch(`/search?term=${term}&media=podcast&limit=${limit}`);\n        if (!data.results?.length)\n            throw new CliError('NOT_FOUND', 'No podcasts found', `Try a different keyword`);\n        return data.results.map((p) => ({\n            id: p.collectionId,\n            title: p.collectionName,\n            author: p.artistName,\n            episodes: p.trackCount ?? '',\n            genre: p.primaryGenreName ?? '',\n            url: p.collectionViewUrl || '',\n        }));\n    },\n});\n","sourceCodeStart":3,"sourceCodeEnd":32,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/apple-podcasts/search.js#L3-L32","documentation":"Thrown by `apple-podcasts search` as a CliError with code NOT_FOUND when the iTunes search endpoint returns an empty results array for the given query. The command requires at least one podcast match to build its output table. It indicates the query succeeded over the network but matched nothing.","triggerScenarios":"`opencli apple-podcasts search <query>` where /search?term=...&media=podcast&limit=N returns data.results with length 0 (or undefined).","commonSituations":"Overly specific or misspelled keywords; searching for a show not distributed on Apple Podcasts; non-English store locale with no matching titles; query that only matches music/apps (filtered out by media=podcast).","solutions":["Shorten or simplify the search term (e.g. show name only, without host names)","Check spelling and try synonyms or the English title","Verify the podcast exists at https://podcasts.apple.com before debugging further"],"exampleFix":"// before\nopencli apple-podcasts search \"the daily show with trevor noah full episodes\"\n// NOT_FOUND: No podcasts found\n// after\nopencli apple-podcasts search \"the daily\"","handlingStrategy":"validation","validationCode":"const term = 'the daily';\nif (!term.trim()) { console.log('Provide a non-empty query'); }\n// Optionally probe first:\nconst res = await fetch(`https://itunes.apple.com/search?term=${encodeURIComponent(term)}&media=podcast&limit=1`);\nconst data = await res.json();\nif (!data.results?.length) console.log('Query has no podcast matches; simplify the term.');","typeGuard":"function hasResults(data) {\n  return data != null && Array.isArray(data.results) && data.results.length > 0;\n}","tryCatchPattern":"try {\n  await cli.run(['apple-podcasts', 'search', query]);\n} catch (e) {\n  if (e.code === 'NOT_FOUND') {\n    console.log('No podcasts matched; try shorter or alternate keywords.');\n  } else throw e;\n}","preventionTips":["Use short, specific show names as search terms","Handle zero-match queries in scripts instead of assuming results","Cross-check availability on podcasts.apple.com for rare/non-English shows"],"tags":["not-found","itunes-api","apple-podcasts"],"backgroundTag":"resource-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}