Review one or more Alibaba products for corporate gifting by collecting product name, visible base price, MOQ, ratings, supplier and shipping signals, then presenting suitability remarks and an approximate landed-cost estimate to {destination-country} (India as an example) when freight, taxes, exchange rate, or other assumptions are available. Products may be supplied directly by URL, found by text search, or discovered from a product image using Alibaba's image-search uploader or its image-results URL.
Use Cases
Use when the task provides Alibaba product URLs, product names, product images, or product codes and requires structured comparison for gifting, procurement, market pricing, or {destination-country}-focused cost evaluation (for example India). This skill covers Alibaba product pages and Alibaba search results; gather other marketplaces separately when requested.
Automation Flow
- Prefer supplied Alibaba product-detail URLs. Alibaba product pages use the durable pattern
https://www.alibaba.com/product-detail/{title-slug}_{product-id}.html; preserve the supplied opaque numeric product ID rather than guessing it. Navigate directly to each URL and run the product extractor after the page loads. - If only a product name, code, or text description is provided, navigate once to
https://www.alibaba.com/trade/search?fsb=y&IndexArea=product_en&CatId=&SearchText={query}with{query}URL-encoded. To request the all-results view, append&has4Tab=true&tab=all. Extract candidate cards, choose the title matching the requested product and required attributes, read its product-detail href and opaque ID, then navigate directly to that href. Do not infer an ID from the product name. - If Alibaba presents a slider or other bot-verification challenge after navigation, solve the displayed challenge before extraction, then continue on the same search or product page. Do not report incomplete or challenge-page text as product data.
- If Alibaba has already supplied an image-search URL or
imagePath, use the single-navigation formhttps://www.alibaba.com/search/page?SearchScene=imageTextSearch&imagePath={image-url-encoded}®ions={regions-json-encoded}&tab=all&from=pcHomeContent. Preserve any site-generatedregionsvalue; do not invent an opaque product ID. Run the image-result extractor below, select matching candidates, and navigate directly to their product-detail hrefs. - If only a local image is provided and no image-results URL exists, open
https://www.alibaba.com/, activate the image-search control usingdiv[aria-label='Image search'], then upload the supplied local image toinput.upload-file(fall back toinput[type=file]). Use the browser's file-upload facility rather than fetching the image from a third-party origin. After Alibaba processes the upload, extract visible result cards with the image-result extractor below. Image search is a discovery step; do not treat snippets as final pricing. - For text-search result pages, use this extractor to collect candidate titles, prices, MOQ, supplier, and detail URLs in one evaluation:
(() => {
const clean=s=>(s||'').replace(/\s+/g,' ').trim();
const out=[];
for(const h2 of document.querySelectorAll('h2')){
const title=clean(h2.innerText); if(title.length<15) continue;
let el=h2,text='';
for(let i=0;i<10&⪙i++){el=el.parentElement;text=clean(el?.innerText);if(/\$[\d,]/.test(text)&&/\bMin\b/i.test(text))break;}
const prices=[...text.matchAll(/(?:US\s*)?\$\s*([\d,]+(?:\.\d+)?)/g)].map(m=>Number(m[1].replace(/,/g,''))).filter(n=>n>0&&n<5000);
const moq=text.match(/Min(?:imum)?\.?\s*order:?\s*(\d+)\s*([A-Za-z]+)/i);
const href=(h2.closest('a')?.href||el?.querySelector('a[href*="/product-detail/"]')?.href||'').split('?')[0];
const supplier=clean(el?.querySelector('a[href*="company_profile"]')?.innerText);
out.push({title:title.slice(0,180),prices,priceMin:prices.length?Math.min(...prices):null,priceMax:prices.length?Math.max(...prices):null,moqQty:moq?.[1]||null,moqUnit:moq?.[2]?.toLowerCase()||null,supplier:supplier.slice(0,100),href,snippet:text.slice(0,350)});
if(out.length>=50) break;
}
return {url:location.href,results:out};
})()- For Alibaba image-search result pages, run this concrete discovery extractor before opening individual products:
(() => {
const clean=s=>(s||'').replace(/\s+/g,' ').trim();
const seen=new Set(),results=[];
for(const a of document.querySelectorAll('a[href]')){
const href=new URL(a.href,location.href).href.split('?')[0];
if(!/alibaba\.com\/product-detail\//i.test(href)||seen.has(href))continue;
const card=a.closest('div[class*="card" i],li,article')||a.parentElement;
const title=clean(a.innerText||card?.innerText).slice(0,300),text=clean(card?.innerText||a.innerText);
if(!title)continue; seen.add(href);
const price=(text.match(/(?:US\$|USD|₹|INR|\$)\s?[0-9][0-9,.]*(?:\s*[-–]\s*(?:US\$|USD|₹|INR|\$)?\s?[0-9][0-9,.]*)?/i)||[])[0]||null;
const moq=(text.match(/(?:MOQ|minimum order|min\.? order)\s*[::-]?\s*[^|;,]{1,80}/i)||[])[0]||null;
results.push({title,url:href,price,moq,snippet:text.slice(0,500)});
}
return {url:location.href,results:results.slice(0,100)};
})()- On each loaded product-detail page, wait briefly for hydrated pricing content, then run this extractor without exploratory snapshots:
(() => {
const clean=s=>(s||'').replace(/\s+/g,' ').trim();
const uniq=a=>[...new Set(a.map(clean).filter(Boolean))];
const text=clean(document.body?.innerText);
const title=clean(document.querySelector('h1')?.innerText)||clean(document.title).replace(/\s*[|–-].*$/,'');
const priceNodes=[...document.querySelectorAll('[class*="price" i],[data-testid*="price" i],[class*="product-price" i]')];
const priceSnippets=uniq(priceNodes.map(e=>e.innerText)).slice(0,20);
const prices=uniq([...text.matchAll(/(?:US\$|USD|₹|INR|\$)\s?[0-9][0-9,.]*(?:\s*[-–]\s*(?:US\$|USD|₹|INR|\$)?\s?[0-9][0-9,.]*)?/gi)].map(m=>m[0])).slice(0,30);
const priceTiers=[...text.matchAll(/(?:US\$|USD|\$)\s*([0-9][0-9,.]*)\s+(\d+\s*[-–]\s*\d+|≥\s*\d+|\d+\+)\s*(pieces?|sets?|pairs?|pcs?)/gi)].slice(0,20).map(m=>({price:m[1],quantity:m[2],unit:m[3]}));
const find=re=>text.match(re)?.[0]||null;
const rating=find(/(?:rating|rated)\s*[::-]?\s*[0-5](?:\.[0-9])?\s*(?:\/\s*5|stars?)?/i);
const reviewCount=find(/(?:[0-9][0-9,.]*\s*(?:reviews?|ratings?)|reviews?\s*[::-]?\s*[0-9][0-9,.]*)/i);
const moq=find(/(?:minimum order|moq|min\.? order)\s*[::-]?\s*[^|;,]{1,100}/i);
const shipping=uniq([...document.querySelectorAll('[class*="shipping" i],[class*="delivery" i],[data-testid*="shipping" i],[data-testid*="delivery" i]')].map(e=>e.innerText)).slice(0,10);
const supplier=clean(document.querySelector('[class*="company-name" i],[class*="supplier-name" i],[data-testid*="company" i],a[href*="company_profile"]')?.innerText)||null;
const useCaseTerm1='{use-case-term-1}',useCaseTerm2='{use-case-term-2}';const signals=uniq(([title,text].join(' ').match(new RegExp('(?:custom|logo|OEM|ODM|warranty|personaliz|'+[useCaseTerm1,useCaseTerm2].filter(Boolean).map(w=>w.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')).join('|')+')[^.;|]{0,100}','gi'))||[])).slice(0,12);
return {url:location.href,title,prices,priceSnippets,priceTiers,rating,reviewCount,moq,supplier,shipping,suitabilitySignals:signals};
})()- Treat the lowest displayed unit-price range as the base-price candidate only after checking whether it is tied to the smallest quantity or a variant. Preserve currency, price range, MOQ, and all variant or quantity qualifiers.
- Compute or report
approximate landed cost in {destination-country}(for example India) outside page extraction as: converted unit price + per-unit international freight + customs duty, import taxes, and other import charges + domestic delivery. If those inputs are unavailable, label the result as an assumption-based estimate ornot determinable from the page; never present Alibaba's base price as landed cost. - Compare products using concrete suitability remarks derived from extracted features: personalization, perceived usefulness, durability, minimum-order feasibility, shipping risk, price tier, and appropriateness for
{use-case}(for example bulk Diwali distribution).
Possible Friction Points
- Alibaba product pages are keyed by opaque numeric IDs embedded after the title slug; never manufacture an ID.
- The all-results text-search state can be reached directly by appending
has4Tab=true&tab=allto the product-search URL, avoiding tab clicks. - Alibaba image-result pages use
/search/page?SearchScene=imageTextSearch; when present,imagePathis an encoded image URL andregionsis an encoded JSON list of detected image regions. Use these only when Alibaba supplied them. - Search navigation may trigger a slider or other bot-verification flow. Complete the challenge before extracting results; the challenge page itself contains no reliable product data.
- Alibaba's image-search entry point is exposed through
div[aria-label='Image search']; the upload control is typicallyinput.upload-file, withinput[type=file]as a fallback. - Image-search and text-search snippets are discovery data and may omit or misstate variant pricing. Always open the selected product-detail URL before reporting final price, MOQ, supplier, or shipping information.
- Prices may be ranges, variant-dependent, quantity-dependent, or displayed in multiple currencies. Keep the original text and identify the selected basis before calculating. Product pages may expose quantity tiers such as a price followed by a quantity range and unit.
- Product content can hydrate after
domcontentloaded; allow roughly 1–2 seconds before extraction. If price, rating, or MOQ is absent, wait briefly and rerun the same extractor rather than navigating through the homepage. - Search-card headings and class names are not fully stable. The text-search extractor walks upward from
h2elements and uses product-detail and company-profile hrefs; treat missing fields as unavailable rather than guessing. - CSS classes are not fully stable. The extractors combine semantic class fragments,
data-testidfragments, anchor URLs, and body-text fallbacks. - MOQ, supplier ratings, trade-assurance indicators, shipping quotes, duties, and
{destination-country}delivery charges may require a destination or logged-in quote and are not necessarily present on the public page. - Suitability signals are evidence for editorial remarks, not verified claims about quality, certification, warranty, or delivery.