feat(ebay): search.searchByImage — eBay's own visual search - #33
Merged
Conversation
POST /v1/ebay/search/by-image, the SDK's first eBay POST: the body carries either image_url (a public http(s) URL the API downloads) or image_base64 (a bare JPEG/PNG payload or a data: URL), never both. The guard runs client-side, so the wrong shape costs no round trip and no credits. Returns the same SearchResponse as search(), with query null. No sort_by: eBay ignores _sop on a visual results page, and a parameter that silently does nothing is worse than no parameter. Two filters the keyword endpoints do not expose yet ride along because the visual SRP honours them: location (domestic|worldwide) and language (english|japanese|chinese|korean). EbayCondition also gains graded/ungraded — eBay's trading-card conditions. The scraper has accepted them on search, completed and by-image alike; the union here was simply stale, so every eBay method picks up the fix. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RaAGmbLG3FotV7LFRkGhr3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
client.ebay.search.searchByImage(...)forPOST /v1/ebay/search/by-image— what eBay's camera icon does. 10 credits.The method
The SDK's first eBay POST, so it follows the
request(path, { method: "POST", body })shape the web-scraping and YouTube-batch endpoints already use, and keeps the eBay module's snake_case parameter names.Returns the same
SearchResponseassearch(), withquerynull.Notes
image_url/image_base64. Neither or both throws anErrorclient-side, so the wrong shape costs no round trip and no credits — mirroring the server's own validator.sort_by. eBay ignores_sopon a visual results page, and a parameter that silently does nothing is worse than no parameter.locationandlanguageride along. The visual SRP honours both, soEbaySearchByImageParamsexposes them via two new unions,EbayLocationandEbayLanguage.EbayConditiongainsgraded/ungraded— eBay's trading-card conditions (slabbed vs raw). The scraper has accepted them onsearch,completedand by-image alike; the union here was stale, so this fixes every eBay method, not just the new one.image_base64takes a bare payload or adata:image/jpeg;base64,...URL. JPEG and PNG, at most 10 MB decoded.Test plan
npm run typecheck— cleannpm run lint— cleannpm test— 279 passed (21 files);tests/ebay.test.ts14 → 17npm run build— ESM + CJS + DTS build successsort_bynever sent, and both bad-input shapes rejected beforefetchis calledDocs:
README.mdeBay row anddocs/ebay.md(sub-client table, param enums, a Search by Image section).🤖 Generated with Claude Code
https://claude.ai/code/session_01RaAGmbLG3FotV7LFRkGhr3