Home

Metro Singapore

How to get Metro Singapore with the API

Search public Metro Singapore department-store products. metro.com.sg is one page of it. A run reads that public list and saves one row per result.

Set up the Apify actor

Apify is where this run is collected. An actor is the program that collects the rows. A task is that program saved with your settings, so the next section can ask for the latest rows. You need a free Apify account.

  1. 01
    Open Metro Singapore and click Try for free. Create an Apify account if you do not have one. The Free plan does not ask for a card.
  2. 02
    You are on the input form. Keep the sample for this first run.
    {
        "query": "serum",
        "maxItems": 5
    }
  3. 03
    Leave the proxy setting as it is. Click Start and wait until the run says Succeeded.
  4. 04
    Open Storage, then Dataset. You should see id, name, brand, price.
  5. 05
    When you want the real list, raise maxItems. The sample cap is only there so the first run stays small.
  6. 06
    Go back to the input and choose Save as a new task. Name it after this list.
  7. 07
    Open the task. Copy the task ID from the address bar. Excel, Sheets, Power BI, and the other guides ask for this ID.
  8. 08
    On the task, open Schedules and add a weekly run if you want fresh rows. Each run pays the start charge and the charge for the rows. The amounts are in the price list on this page.
  9. 09
    Open Settings, then API & Integrations, and copy an API token. Excel, Sheets, and the other guides put this token in a download link. Anyone with that link can download the rows, so treat it like a password.

How to set up with the API

  1. 01
    Use the API token from Set up the Apify actor, above.
  2. 02
    Send this request. Replace YOUR_TOKEN. It waits up to 120 seconds.
    curl -X POST "https://api.apify.com/v2/acts/bakos_bence~metro-sg-products/runs?token=YOUR_TOKEN&waitForFinish=120" \
      -H "Content-Type: application/json" \
      -d '{ "query": "serum", "maxItems": 5 }'
  3. 03
    From the response, copy defaultDatasetId.
  4. 04
    Fetch the rows. Replace DATASET_ID and YOUR_TOKEN.
    https://api.apify.com/v2/datasets/DATASET_ID/items?format=json&clean=true&token=YOUR_TOKEN
  5. 05
    To repeat it, use the task and the weekly schedule from Set up the Apify actor, above. A scheduled task's newest rows are this URL, with your task id and token:
    https://api.apify.com/v2/actor-tasks/TASK_ID/runs/last/dataset/items?format=json&clean=true&status=SUCCEEDED&token=YOUR_TOKEN
  6. 06
    Anyone with a URL that contains the token can read the rows.

Schema

Examples come from the actor sample, not a live result.

NameDescriptionExample
idid10001145889089
namenameLancome Génifique Ultimate Serum
brandbrandLOREAL LANCOME
priceprice123.25
currencycurrencySGD
listPricelistPrice145.00
priceTextpriceTextS$123.25
urlurlhttps://www.metro.com.sg/products/lancome-genifique-ultimate-serum?_pos=1&_psq=serum&_psid=fdf951f99&_ss=e
imageimagehttps://cdn.shopify.com/s/files/1/0925/4718/7009/files/lancome-genifique-ultimate-serum-2483245.jpg?v=1783338670
inStockinStocktrue
countrycountrySG
retailerretailerMetro
  • idid10001145889089
  • namenameLancome Génifique Ultimate Serum
  • brandbrandLOREAL LANCOME
  • priceprice123.25
  • currencycurrencySGD
  • listPricelistPrice145.00
  • priceTextpriceTextS$123.25
  • urlurlhttps://www.metro.com.sg/products/lancome-genifique-ultimate-serum?_pos=1&_psq=serum&_psid=fdf951f99&_ss=e
  • imageimagehttps://cdn.shopify.com/s/files/1/0925/4718/7009/files/lancome-genifique-ultimate-serum-2483245.jpg?v=1783338670
  • inStockinStocktrue
  • countrycountrySG
  • retailerretailerMetro

The same row as JSON

{
  "id": "10001145889089",
  "name": "Lancome Génifique Ultimate Serum",
  "brand": "LOREAL LANCOME",
  "price": "123.25",
  "currency": "SGD",
  "listPrice": "145.00",
  "priceText": "S$123.25",
  "url": "https://www.metro.com.sg/products/lancome-genifique-ultimate-serum?_pos=1&_psq=serum&_psid=fdf951f99&_ss=e",
  "image": "https://cdn.shopify.com/s/files/1/0925/4718/7009/files/lancome-genifique-ultimate-serum-2483245.jpg?v=1783338670",
  "inStock": "true",
  "country": "SG",
  "retailer": "Metro"
}