typescriptapify

Apify Vinted actor returns irrelevant results when using searchText via API (but works in UI)


I'm using the bebity/vinted-premium-actor from Apify to programmatically scrape Vinted listings via API. The goal is to pass a keyword (e.g. shoes) and retrieve matching products.

When I run the actor manually via the Apify web interface and provide shoes as the searchText, it works perfectly — returning 10 relevant products, several of which contain "shoes" in the title.

However, when I call the actor programmatically using run-sync-get-dataset-items, and send the same input like this:

{
  "searchText": "shoes",
  "maxCrawlPages": 10
}

longer code extract:

 }
    const actorId = "bebity~vinted-premium-actor";
    const actorUrl = `https://api.apify.com/v2/acts/${actorId}/run-sync-get-dataset-items?token=${apiKey}`;
    const apifyInput = {
      searchText: query,
      maxCrawlPages: 10
    };
    console.log("🎬 Running Apify actor with input:", apifyInput);
    // ✅ Fixed: do NOT wrap input inside an `input` key
    const apifyResponse = await fetch(actorUrl, {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(apifyInput)
    });
    if (!apifyResponse.ok) {
      const text = await apifyResponse.text();
      console.error("❌ Apify API error:", text);
      return new Response(JSON.stringify({
        error: text
      }), {
        status: apifyResponse.status,
        headers: {
          ...corsHeaders,
          "Content-Type": "application/json"
        }
      });
    }
    const items = await apifyResponse.json();
    console.log("✅ Apify returned", items.length, "items");
    // 🧾 Diagnostic log of first 5 raw titles
    console.log("🔎 First 5 raw titles:", items.slice(0, 5).map((i)=>i.title));
    const transformed = items.map((item, i)=>({
        id: `vinted-${i}`,
        platform: "vinted",
        title: item.title,
        price: item.price,
        image_url: item.imageUrl,
        product_url: item.url,
        platform_id: item.id,
        created_at: new Date().toISOString(),
        updated_at: new Date().toISOString()
      }));
    return new Response(JSON.stringify({
      items: transformed
    }), {
      headers: {
        ...corsHeaders,
        "Content-Type": "application/json"
      }
    });

…it returns 100 items that are completely unrelated — book titles, lamps, soft toys, etc. None of the returned items contain the word shoes at all.

Here’s a sample of what I'm getting in the response:

  • The Monologues by Eve Ensler
  • Exposed Bulb Lamp (brand: IKEA)
  • Stuffed Fireplace (brand: Bum Bumz)

These results suggest that the actor is defaulting to scraping a generic trending or category page rather than executing the keyword-based search.

I have also tested it on Postman:

POST https:///functions/v1/call-apify?query=nike Content Type: application/json

but again, the results are not filtered on nike products.

Questions:

Any guidance would be much appreciated. If there’s a better actor for Vinted keyword scraping, I’d love recommendations.

Thanks!

What I’ve tried:


Solution

  • You can using "ApifyClient" library in node.js (or javascript) by input query with search keyword.

    const input = {
        action: "get-items",
        maxRows: 5,
        search: "shoes",
        extension: "com"
    };
    

    In the Vinted Scraper actor web page. I can get the example and input code by node.js

    https://apify.com/bebity/vinted-premium-actor/api/javascript
    

    enter image description here

    Vinted Scraper's item id is 9L9xQ5kiZeol7VgO6

    https://console.apify.com/actors/9L9xQ5kiZeol7VgO6/input
    
    Action : Get Items
    Max rows : 10
    Action : Get Items
    

    enter image description here

    Then press Start button you can get the result and input query data

    enter image description here

    enter image description here

    Demo

    package.json

    {
      "type": "module",
      "dependencies": {
        "apify-client": "^2.12.5"
      }
    }
    

    install dependency

    npm install apify-client
    

    Get shoes code

    Save as demo.js

    Note: replace your token at <YOUR_API_TOKEN>

    import { ApifyClient } from 'apify-client';
    
    // Initialize the ApifyClient with your Apify API token
    const client = new ApifyClient({
        token: '<YOUR_API_TOKEN>',
    });
    
    // Prepare Actor input
    const input = {
        action: "get-items",
        maxRows: 5,
        search: "shoes",
        extension: "com"
    };
    
    // Run the Actor and wait for it to finish
    const run = await client.actor("bebity/vinted-premium-actor").call(input);
    
    // Fetch items from the dataset
    const { items } = await client.dataset(run.defaultDatasetId).listItems();
    
    // Map items to desired JSON structure
    const transformed = items.map((item, i) => ({
        id: `vinted-${i}`,
        platform: "vinted",
        title: item.title,
        price: item.price,
        image_url: item.photo?.url || null,
        product_url: item.url,
        platform_id: item.id,
        created_at: new Date().toISOString(),
        updated_at: new Date().toISOString()
    }));
    
    // Output transformed JSON
    console.log(JSON.stringify({ items: transformed }, null, 2));
    

    run it

    node demo.js
    

    Result

    {
      "items": [
        {
          "id": "vinted-0",
          "platform": "vinted",
          "title": "High top blowfish sneakers",
          "price": {
            "amount": "5.0",
            "currency_code": "USD"
          },
          "image_url": "https://images1.vinted.net/t/03_02387_7gZYiMzfNtgxDSR8GHCFtCtP/f800/1748371535.jpeg?s=98c62e9a3d0fd0369b6c22b7d3c982ded927fff3",
          "product_url": "https://www.vinted.com/items/6407522018-high-top-blowfish-sneakers",
          "platform_id": 6407522018,
          "created_at": "2025-05-28T10:25:58.478Z",
          "updated_at": "2025-05-28T10:25:58.478Z"
        },
        {
          "id": "vinted-1",
          "platform": "vinted",
          "title": "Green strappy sandals",
          "price": {
            "amount": "5.0",
            "currency_code": "USD"
          },
          "image_url": "https://images1.vinted.net/t/03_015be_CmHgyT9sDqpvyqVLisBh67z4/f800/1748361689.jpeg?s=adab8145a98f683f585b3c5b8473ab66bc40d066",
          "product_url": "https://www.vinted.com/items/6406336648-green-strappy-sandals",
          "platform_id": 6406336648,
          "created_at": "2025-05-28T10:25:58.478Z",
          "updated_at": "2025-05-28T10:25:58.478Z"
        },
        {
          "id": "vinted-2",
          "platform": "vinted",
          "title": "Black dress boots women’s",
          "price": {
            "amount": "4.0",
            "currency_code": "USD"
          },
          "image_url": "https://images1.vinted.net/t/04_00f77_du2wB5bpzMrB1AkFViJJn8AP/f800/1748393808.jpeg?s=df6b92f0c449800d5484553302adc601be579b2c",
          "product_url": "https://www.vinted.com/items/6408577419-black-dress-boots-womens",
          "platform_id": 6408577419,
          "created_at": "2025-05-28T10:25:58.478Z",
          "updated_at": "2025-05-28T10:25:58.478Z"
        },
        {
          "id": "vinted-3",
          "platform": "vinted",
          "title": "Hush Puppies, Ivory White Leather, Thong Sand Sandals with Detailed Stitching, Size 8/8.5",
          "price": {
            "amount": "3.0",
            "currency_code": "USD"
          },
          "image_url": "https://images1.vinted.net/t/04_013fe_ZusY14XcUC4ZrZJ1krMpmqsK/f800/1748394774.jpeg?s=00d1dc5e5edb81f85275ce8597cf56f5f394902a",
          "product_url": "https://www.vinted.com/items/6408580911-hush-puppies-ivory-white-leather-thong-sand-sandals-with-detailed-stitching-size-885",
          "platform_id": 6408580911,
          "created_at": "2025-05-28T10:25:58.478Z",
          "updated_at": "2025-05-28T10:25:58.478Z"
        },
        {
          "id": "vinted-4",
          "platform": "vinted",
          "title": "Boots ugg",
          "price": {
            "amount": "3.0",
            "currency_code": "USD"
          },
          "image_url": "https://images1.vinted.net/t/02_00831_XhDfqXvbZtPwvBSbbZ17Yyzx/f800/1748314851.jpeg?s=dfd6c5b5c628fb64fdbda909f86c175bbedd4410",
          "product_url": "https://www.vinted.com/items/6402673235-boots-ugg",
          "platform_id": 6402673235,
          "created_at": "2025-05-28T10:25:58.478Z",
          "updated_at": "2025-05-28T10:25:58.478Z"
        }
      ]
    }