How to turn EAN codes into Allegro product content with Python and pandas
DEV Community

How to turn EAN codes into Allegro product content with Python and pandas

You have a supplier file with a column of barcodes and a shop that needs titles, descriptions, specs and photos for each of them. Allegro.pl, the largest marketplace in Poland, already has that content for many products sold in the region.

This tutorial shows how to pull it by EAN using the Allegro Product Data actor on Apify, either from the browser or from Python. I tested it with six barcodes on 9 November 2026. Everything below comes from that run, including the part where three of the six results were wrong, which is the most useful thing in this post if you plan to import the data anywhere.

What data you get

One dataset row per EAN. These are the fields I used most, out of 55 in the output:

Field Example from my run Notes
ean 5702017584072 The code you sent
found false Only present on rows with no match
title LEGO TECHNIC 42173 SZARY HIPERSAMOCHΓ“D Offer title, in Polish
brand LEGO Can be empty
price, currency 186.65, PLN Price of the chosen offer
categoryPath Dziecko > Zabawki > Klocki > LEGO > Zestawy > Technic Full breadcrumb
parameters {"Liczba elementΓ³w": "801", ...} Object of spec name and value
description plain text 1,212 characters for the LEGO set
descriptionHtml <p>...</p> Same content with markup
images list of URLs Capped by maxImages
descriptionImages list of URLs 13 for the LEGO set
productRating, productRatingsCount 4.97, 1693 Product level, across offers
manufacturerCode MTP63PX/A Filled on the iPhone row

The number of parameters varies a lot by category. The iPhone 15 row had 44, the LEGO set 15.

Parameter names are in Polish (Waga produktu z opakowaniem jednostkowym is packaged weight), so plan a mapping step if your catalog is in another language.

Main input options

  • eans: the list of barcodes. This is the required field.
  • startUrls: Allegro links, if you already know the offer or product page.
  • marketplace: pl, cz or sk. Applies to EAN lookups; URLs are detected automatically.
  • productSelection: relevance (default) or popularity, for when one barcode has several offers.
  • maxImages: 1 to 50 photos per offer, default 10.
  • descriptionFormat: html (default), text or both.
  • fetchDescription and fetchParameters: switch these off if you need only one of the two.
  • downloadImages: stores the photo files in the run's key-value store and returns links in imageFiles. Off by default, and charged per image.

Option 1: no code

  • Open the actor page and click Try for free.
  • Paste your barcodes into EAN / GTIN codes, one per line.
  • Set Description format to HTML + text if you want both versions.
  • Press Start. My six barcodes took 328 seconds and 21 page requests, so a batch of a few hundred is a job to leave running.
  • Open the run's results and export as Excel, CSV or JSON. The parameters object arrives flattened into columns in the spreadsheet formats, one per spec name.

Option 2: Python

Install the two libraries:

pip install apify-client pandas

The script below runs the actor and then applies the check that matters, which is comparing the returned brand against the brand you expected.

import pandas as pd
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

expected = {
    "5702017584072": "LEGO",
    "195949036842": "Apple",
    "5449000000996": "Coca-Cola",
    "4006381333931": "STABILO",
    "5901234123457": "Example",
    "3017620422003": "Ferrero",
}

run = client.actor("flarewow/allegro-description-photo-parameters").call(
    run_input={
        "eans": list(expected),
        "descriptionFormat": "both",
        "maxImages": 5,
        "marketplace": "pl",
    }
)

items = client.dataset(run["defaultDatasetId"]).list_items().items
df = pd.DataFrame(items)

hits = df[df["found"] != False].copy()
hits["expected_brand"] = hits["ean"].map(expected)
hits["brand_ok"] = (
    hits["brand"].fillna("").str.lower() == hits["expected_brand"].str.lower()
)

clean = hits[hits["brand_ok"]]
review = hits[~hits["brand_ok"]]

columns = ["ean", "title", "brand", "price", "categoryPath", "productRating"]
print(clean[columns])
print(f"Kept {len(clean)} of {len(df)}, {len(review)} to review")
clean.to_csv("allegro_products.csv", index=False)

On my data it printed Kept 2 of 6, 3 to review. The sixth row was the barcode with no match at all.

What the six barcodes returned

EAN Product I meant What came back
5702017584072 LEGO Technic 42173 Correct. 186.65 PLN, 15 parameters, rating 4.97 from 1,693 ratings
195949036842 iPhone 15 256 GB Correct. 3,667.10 PLN, 44 parameters, rating 4.79 from 107 ratings
5449000000996 Coca-Cola Wrong product: 5 L PET bottles for pickling
4006381333931 STABILO point 88 Mixed: STABILO title, but brand ATS and a sliding door category
5901234123457 GS1 sample barcode A fishing rod spare part
3017620422003 Nutella jar found: false, with the note "No Allegro product with this EAN"

The likely reason is mundane. Sellers enter barcodes into their listings themselves, so a lookup can land on a listing that merely claims that EAN.

Food and cheap stationery did badly in my small sample, while a branded toy and a phone came back clean. Six barcodes are too few to generalize from, so treat that as a hint and measure your own catalog.

Checking that parameters["EAN (GTIN)"] equals your input does not help. The STABILO row and the fishing part both passed that test. Brand comparison caught all three bad rows here. If your file has no brand column, compare categoryPath against the category you sell in, or send anything suspicious to a person.

Scheduling and integrations

Product content changes slowly, so a weekly or monthly refresh is plenty. In Apify Console, go to Schedules, add the actor with your saved input and pick a cron expression. A weekly Monday run is 0 6 * * 1.

For moving the results elsewhere, the actor page lists Make, Zapier, n8n, Google Sheets, Slack, Airbyte and webhooks. A webhook on ACTOR.RUN.SUCCEEDED pointing at your import script is enough for a simple PIM feed.

You can also call it from an AI agent through the Apify MCP server, which suits the common next step of rewriting scraped descriptions in your own words.

Pricing per 1,000 results

Pay per event, current as of this run:

Event, per 1,000 Free Starter Scale Business and up
Product content resolved $10.00 $9.00 $8.00 $7.00
Extra image URL, beyond the first 3 $4.00 $0.10 $0.10 $0.10
Image file downloaded, beyond the first 3 $2.00 $1.80 $1.60 $1.50
EAN searched, no match $1.00 $0.95 $0.90 $0.85

There is also $0.00005 per actor start and $0.01 per 1,000 dataset rows. A resolved product includes the description, parameters and first 3 photos. My run logged 5 resolved products, so about $0.05 on the Free tier.

Note that a wrong match counts as resolved, which is another reason to send clean, deduplicated barcodes.

Responsible use

The actor reads public product pages. Rows also carry sellerLogin, sellerUrl and review text in latestReviews, and on Allegro a login can belong to a private individual. If you only need product content, drop those columns before storing anything, because under GDPR you need a legal basis to keep personal data.

Descriptions and photos also belong to whoever wrote and shot them, so check the rights before republishing them in your shop, and rewrite the text rather than copying it.

This tutorial was written with AI assistance and checked by the author. All numbers come from a real run of the scraper.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.