Run public-only reverse-image or lookalike searches in Yandex Images and return the visible public matches, source pages, labels, and related visual-search terms. Treat matches as leads rather than proof of identity.
Use Cases
Use when the caller has one or more publicly reachable image URLs and needs Yandex visual-search results. For attached images without public URLs, first obtain a caller-approved public image URL through the supported workflow; do not invent or persist upload credentials or private links.
Automation Flow
- For each public image URL
{image-url}, navigate directly tohttps://yandex.com/images/search?rpt=imageview&url={encodeURIComponent(image-url)}. This skips the homepage and image-search form. - Yandex may append a run-specific
cbir_idparameter to the result URL. Use the resulting page for extraction, but do not fabricate, persist, or replay that opaque value; regenerate the search from the base URL when retrying. - If Yandex redirects to
https://yandex.com/showcaptcha, complete the visible CAPTCHA with the browser tool, accept only mandatory consent if shown usingdiv#gdpr-popup-v3-button-mandatory, then retry the exact reverse-image URL. Do not use credentials or call non-Yandex origins. - After the result page is loaded, run this extractor in one evaluate call. Repeat the direct navigation and extraction for each still; keep each still's results associated with its input URL.
(() => {
const clean = s => (s || '').replace(/\s+/g, ' ').trim();
const abs = href => { try { return new URL(href, location.href).href; } catch (_) { return ''; } };
const cards = [...document.querySelectorAll('.CbirSites-Item, [data-bem*="CbirSites-Item"], .CbirSites-ItemList > *')];
const matches = cards.map(card => {
const link = card.querySelector('.CbirSites-ItemDomain[href], .CbirSites-ItemTitle a[href], a[href]:not(.Thumb)');
const thumbnail = card.querySelector('a.Thumb[href]');
const title = card.querySelector('.CbirSites-ItemTitle, [class*="Title"], h2, h3');
const text = card.querySelector('.CbirSites-ItemSnippet, [class*="Snippet"], [class*="Description"], p');
return { url: link ? abs(link.getAttribute('href')) : '', imageUrl: thumbnail ? abs(thumbnail.getAttribute('href')) : null, title: clean(title?.textContent), snippet: clean(text?.textContent) };
}).filter(x => x.url || x.title || x.snippet);
const tags = [...document.querySelectorAll('.Tags_type_expandable a, .CbirTags-Item, .CbirTags-Tag, [data-bem*="CbirTags"] a')]
.map(x => clean(x.textContent)).filter(Boolean);
const image = document.querySelector('.CbirObject img, .Cbir-Object img, img[src]');
return {
page: location.href,
searchedImage: image?.currentSrc || image?.src || '',
visualSearchTerms: [...new Set(tags)],
matches,
captchaOrConsent: /showcaptcha|captcha/i.test(location.pathname + location.search)
};
})()Possible Friction Points
- The durable reverse-image entry point is
/images/search?rpt=imageview&url={encoded-public-image-url}; do not first visit the homepage. - Yandex can append an opaque, run-specific
cbir_idafter loading. Never guess or store it as part of the reusable URL. - Yandex may redirect the search to
/showcaptcha; solve the displayed challenge and retry the original URL rather than guessing alternate endpoints. - Mandatory GDPR consent can appear as
div#gdpr-popup-v3-button-mandatory; it is optional to click only when present. - Result-card class names can vary by Yandex experiment or locale. The extractor intentionally checks the observed
CbirSitesstructure plus limited class-pattern fallbacks; empty output should be reported as no extractable public matches, not silently treated as no matches. - Read source-page URLs from
.CbirSites-ItemDomainor title links;a.Thumbpoints to the image file and is returned separately asimageUrl. Search-term chips use.Tags_type_expandable a; plain.Tagsalso includes image-size chips. - Reverse-image matches may contain reposts, thumbnails, or visually similar material. Preserve source URLs and avoid asserting that a match identifies a person.
- Process each still independently and label results with the corresponding input image URL.
Example Result
{
"page": "https://example.com/search",
"searchedImage": "https://example.com/image.jpg",
"visualSearchTerms": [
"Example Tag"
],
"matches": [
{
"url": "https://example.com/result",
"imageUrl": "https://example.com/thumbnail.jpg",
"title": "Example Title",
"snippet": "Example snippet"
}
],
"captchaOrConsent": false
}