{"record":{"id":"b13ebc53fd7963f6","repo":"jackwener/OpenCLI","slug":"pinterest-search-users","errorCode":null,"errorMessage":"pinterest search-users","messagePattern":"pinterest search-users","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/pinterest/search-users.js","lineNumber":49,"sourceCode":"      baseOptions: { query, scope: 'users' },\n      sourceUrl,\n      limit,\n      keyField: 'username',\n      pageSize: DEFAULT_PAGE_SIZE,\n      mapItem: (user) => {\n        if (!user || user.type !== 'user' || !user.username) return null;\n        return {\n          username: user.username,\n          fullName: (user.full_name || '').trim(),\n          followerCount: typeof user.follower_count === 'number' ? user.follower_count : 0,\n          pinCount: typeof user.pin_count === 'number' ? user.pin_count : 0,\n          url: `${PINTEREST_BASE}/${user.username}/`,\n        };\n      },\n    });\n\n    if (rows.length === 0) {\n      throw new EmptyResultError('pinterest search-users', `no users found for \"${query}\"`);\n    }\n    return rows;\n  },\n});\n","sourceCodeStart":31,"sourceCodeEnd":54,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/search-users.js#L31-L54","documentation":"EmptyResultError from pinterest search-users: the user search page returned no user rows for the keyword. The command throws rather than returning an empty list, making 'no users matched' an explicit, catchable outcome.","triggerScenarios":"A valid keyword where /search/users/ renders zero creator rows within the limit — obscure or misspelled names, a locale where the search has no user matches, or a page the extractor cannot parse.","commonSituations":"Searching real names with unusual spellings, Pinterest's user-search being deprioritized in some regions (users tab empty even when pins exist), or stale selectors after a Pinterest UI change.","solutions":["Try a shorter or alternate spelling of the name/keyword","Check the users tab on pinterest.com in a browser to confirm whether user results exist at all","Catch EmptyResultError and fall back to search-pins or search-boards for the same keyword"],"exampleFix":"// before\nconst users = await pinterest.searchUsers({ query: 'veryobscurename12345' }); // throws\n// after\ntry {\n  return await pinterest.searchUsers({ query: 'anna' });\n} catch (e) {\n  if (e.name === 'EmptyResultError') return { users: [], note: 'no matches' };\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"if (typeof query !== 'string' || !query.trim()) throw new Error('pre-check: query required');","typeGuard":null,"tryCatchPattern":"try { users = await pinterest.searchUsers({ query }); }\ncatch (e) {\n  if (e.name === 'EmptyResultError') return fallbackToPinSearch(query);\n  throw e;\n}","preventionTips":["Use short name fragments — user search matches loosely","Confirm the users tab has results in a browser for your region before scripting","Implement a fallback path (pins/boards search) when user search is empty"],"tags":["empty-results","scraping","no-data"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}