Disclosure: I built the Apify Actor mentioned near the end of this post.

To bulk download images from a URL list in Excel, you do not need pandas or openpyxl: an .xlsx file is a ZIP of XML files, and Python's zipfile and xml.etree can read the URL column directly. Then download each URL, check the first bytes to confirm it really is an image (not an HTML error page), save it under the product's SKU, and write a manifest with a SHA-256 checksum per file. The script below does all of that with the standard library and packs the images into one ZIP.

The typical sheet: one column with an ID (SKU, product number, file name you want) and one column with image URLs, exported from a shop, a supplier feed or a PIM.

How does Python read an .xlsx file without pandas?

Rename any .xlsx to .zip and open it: the cells are in xl/worksheets/sheet1.xml (or whichever file xl/workbook.xml points to), and most text is not in the cell itself. Excel stores each distinct string once in xl/sharedStrings.xml, and a text cell holds only an index into that list (t="s"). So reading a URL column means:

  1. Load xl/sharedStrings.xml into a list.
  2. Find the first sheet's file through xl/workbook.xml and xl/_rels/workbook.xml.rels.
  3. For each <c> cell, take the column letters from its r attribute (B7 → B) and look up the text.

That is about 30 lines, and it means the script runs anywhere Python does, without installing anything.

Why check the file's first bytes instead of the URL?

Because the URL and even the Content-Type header can lie. A product image URL that has expired often returns a 200 HTML page ("image not found", a login page, a CDN error), and a loop that saves whatever comes back will give you .jpg files that do not open. The first bytes tell you what you actually received:

Type First bytes
JPEG FF D8 FF
PNG 89 50 4E 47 0D 0A 1A 0A
GIF GIF87a or GIF89a
WebP RIFF, 4 bytes, WEBP
SVG text starting with <svg, or <?xml followed by <svg

The extension of the saved file comes from this check, so a PNG served from a .jpg URL is saved as .png.

The script

Standard library only (tested with Python 3.9). Save it as xlsx_images.py:

import csv import hashlib import posixpath import re import sys import time import urllib.error import urllib.request import xml.etree.ElementTree as ET import zipfile from pathlib import Path NS = {"m": "http://schemas.openxmlformats.org/spreadsheetml/2006/main", "r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "pr": "http://schemas.openxmlformats.org/package/2006/relationships"} USER_AGENT = "xlsx-image-downloader/1.0 (personal script; python urllib)" PAUSE = 1.0 # seconds between downloads MAX_BYTES = 20 * 1024 * 1024 def read_first_sheet(path): """Return the first worksheet of an .xlsx file as a list of {column letter: text} dicts.""" with zipfile.ZipFile(path) as z: shared = [] if "xl/sharedStrings.xml" in z.namelist(): for si in ET.fromstring(z.read("xl/sharedStrings.xml")).findall("m:si", NS): shared.append("".join(t.text or "" for t in si.iter("{%s}t" % NS["m"]))) wb = ET.fromstring(z.read("xl/workbook.xml")) rid = wb.find("m:sheets/m:sheet", NS).get("{%s}id" % NS["r"]) rels = ET.fromstring(z.read("xl/_rels/workbook.xml.rels")) target = next(r.get("Target") for r in rels.findall("pr:Relationship", NS) if r.get("Id") == rid) sheet_path = target.lstrip("/") if target.startswith("/") else posixpath.join("xl", target) rows = [] for row in ET.fromstring(z.read(sheet_path)).iter("{%s}row" % NS["m"]): values = {} for c in row.findall("m:c", NS): col = re.match(r"[A-Z]+", c.get("r")).group() kind, v = c.get("t"), c.find("m:v", NS) if kind == "s": values[col] = shared[int(v.text)] elif kind == "inlineStr": values[col] = "".join(t.text or "" for t in c.iter("{%s}t" % NS["m"])) elif v is not None: values[col] = v.text or "" rows.append(values) return rows def sniff(data): """Decide the image type from the first bytes, not from the URL or Content-Type.""" if data[:3] == b"\xff\xd8\xff": return "jpg" if data[:8] == b"\x89PNG\r\n\x1a\n": return "png" if data[:6] in (b"GIF87a", b"GIF89a"): return "gif" if data[:4] == b"RIFF" and data[8:12] == b"WEBP": return "webp" head = data[:1024].lstrip().lower() if head.startswith(b"<svg") or (head.startswith(b"<?xml") and b"<svg" in head): return "svg" # an HTML page that merely contains <svg> does not start this way return None def fetch(url): req = urllib.request.Request(url, headers={"User-Agent": USER_AGENT}) for attempt in range(3): try: with urllib.request.urlopen(req, timeout=30) as resp: return resp.status, resp.headers.get_content_type(), resp.read(MAX_BYTES + 1) except urllib.error.HTTPError as e: if e.code in (429, 500, 502, 503, 504) and attempt < 2: time.sleep(int(e.headers.get("Retry-After", "0") or 0) or 2 ** (attempt + 1)) continue return e.code, e.headers.get_content_type(), b"" except (urllib.error.URLError, TimeoutError) as e: if attempt == 2: return None, None, str(e).encode() time.sleep(2 ** (attempt + 1)) def main(xlsx, name_col, url_col, out_dir): out = Path(out_dir) out.mkdir(exist_ok=True) rows = read_first_sheet(xlsx) header = {v.strip().lower(): k for k, v in rows[0].items()} name_key, url_key = header[name_col], header[url_col] seen, manifest, saved = {}, [], [] for n, row in enumerate(rows[1:], start=2): # spreadsheet row number url = row.get(url_key, "").strip() name = re.sub(r"[^A-Za-z0-9._-]", "-", row.get(name_key, "").strip()) or f"row{n}" rec = {"row": n, "name": name, "url": url, "status": "skipped", "reason": "", "file": "", "bytes": "", "sha256": ""} if not url.startswith("https://"): rec["reason"] = "not an https URL" elif url in seen: rec["reason"] = f"same URL as row {seen[url]}" else: seen[url] = n status, ctype, data = fetch(url) time.sleep(PAUSE) kind = sniff(data) if status == 200 else None if status != 200: rec["reason"] = f"HTTP {status}" if status else "network error" elif len(data) > MAX_BYTES: rec["reason"] = "larger than MAX_BYTES" elif kind is None: rec["reason"] = f"not an image ({ctype})" else: fname = f"{name}.{kind}" (out / fname).write_bytes(data) saved.append(fname) rec.update(status="saved", file=fname, bytes=len(data), sha256=hashlib.sha256(data).hexdigest()) manifest.append(rec) with zipfile.ZipFile(out / "images.zip", "w", zipfile.ZIP_STORED) as z: for fname in saved: z.write(out / fname, fname) with open(out / "manifest.csv", "w", newline="") as f: w = csv.DictWriter(f, fieldnames=list(manifest[0])) w.writeheader() w.writerows(manifest) print(f"{len(saved)} saved, {len(manifest) - len(saved)} skipped -> {out}/images.zip") if __name__ == "__main__": main(*sys.argv[1:5]) 

Run it with the workbook, the header of the name column, the header of the URL column and an output folder:

python3 xlsx_images.py products.xlsx sku image_url images 

My test workbook had one sheet, Products, with a header row (sku, image_url) and eight rows: four public-domain example images from Wikimedia Commons (JPEG, PNG, GIF, SVG), one repeated URL, a PDF form from irs.gov, a Commons file description page (HTML) and a Commons image URL that does not exist.

Output from my runs on 2026-12-02. I ran it twice, 20 seconds apart; the console output, manifest.csv and the file names were identical both times:

4 saved, 4 skipped -> images/images.zip 

images/manifest.csv:

row,name,url,status,reason,file,bytes,sha256 2,A001,https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg,saved,,A001.jpg,9022,99bd915a3819b1fee3722328ae904dde5459e9b15d56abd98b903c770a2f582c 3,A002,https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png,saved,,A002.png,2335,69da5df214d45b808be7d5322ab4ad8eb00c032670af3006e2069e3478d4de53 4,A003,https://upload.wikimedia.org/wikipedia/commons/8/8f/Example.gif,saved,,A003.gif,2925,e2d2f72b7cafe48280700439051ea930a3f3fbc2aa530ec70b67bd8d1586efe4 5,A004,https://upload.wikimedia.org/wikipedia/commons/8/84/Example.svg,saved,,A004.svg,10009,e1b9b9f45649d704fda479b8f240ae30115c4b1343aad112ea97d39deb57092f 6,A005,https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg,skipped,same URL as row 2,,, 7,A006,https://www.irs.gov/pub/irs-pdf/fw9.pdf,skipped,not an image (application/pdf),,, 8,A007,https://commons.wikimedia.org/wiki/File:Example.jpg,skipped,not an image (text/html),,, 9,A008,https://upload.wikimedia.org/wikipedia/commons/a/a9/Example_missing_file.jpg,skipped,HTTP 404,,, 

The folder then holds A001.jpg, A002.png, A003.gif, A004.svg, images.zip and manifest.csv.

How to read it:

  • row is the spreadsheet row number, so you can go back to the sheet and fix a broken link.
  • A005: the same URL as row 2, downloaded once. If two SKUs share a photo and you need a copy under each name, copy the file instead of downloading it again.
  • A006: a PDF, rejected because the first bytes are not an image. To keep PDFs too, add a %PDF check to sniff().
  • A007: the Commons description page returned 200 with text/html, a web page, not the image. This is the case a plain "save whatever comes back" loop gets wrong.
  • A008: Wikimedia answered 404, recorded and skipped.
  • sha256 lets you check later that a file was not changed or truncated, and spot two different URLs that return the same image.

The ZIP itself is not byte-identical between runs, because ZIP entries store the file time; the files inside are the same.

What I did not test: the 429/5xx retry and network-error paths (none happened), WebP, files over MAX_BYTES, and cells stored as inline strings. My test workbook was generated by a small script using the same shared-strings layout Excel writes; I did not test a file saved by Excel itself, a cell with a =HYPERLINK() formula (the script reads the displayed text, not the link), or workbooks where the URLs are not on the first sheet.

How do I make it faster or politer?

  • Keep the pause per website, not global: a sheet with images on three CDNs can download from all three at once with concurrent.futures.ThreadPoolExecutor, as long as each host still gets one request at a time.
  • Send a real User-Agent. Wikimedia asks for one and may block generic ones.
  • For thousands of rows, write manifest.csv as you go, so a crash halfway does not lose the record of what was already saved.

Only download images you have the right to use: your own product photos, supplier images you are licensed for, or public-domain and openly licensed files.

What if I do not want to run a script?

I built an Apify Actor, Bulk Image Downloader from URL List – Files & ZIP, that does the download part in the cloud. The Actor does not open the Excel file: you copy the URL column from Excel or Google Sheets and paste it into URLs, one per line. There is a ready-made example, bulk download images from a URL list into one ZIP.

Input (field names from the README):

{ "urls": [ "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg", "https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png" ], "fileTypes": ["images"], "fileNameFrom": "sequence", "createZip": true } 

From the README:

  • Every file goes to the run's key-value store, plus all-files.zip with all of them, plus one dataset row per URL with status (downloaded, skipped or failed), reason, fileName, contentType, sizeBytes, sha256 and a direct fileUrl.
  • File type is judged by the Content-Type the server sends, and by the first bytes when the server only says application/octet-stream. Web pages are skipped and links on them are not followed; it downloads exactly the URLs you give.
  • File names are the original name or a sequence (00001.jpg, 00002.jpg…) in URL order. It does not name files from a second column, so if you need SKU names, keep the script or rename afterwards in URL order.
  • US$0.002 per file + US$0.0002 per MB (every started MB counts) plus US$0.0005 per run start; skipped and failed URLs are free. 1,000 product images of about 300 KB cost about US$2.20. Apify's free plan includes US$5 of usage a month, about 2,200 images under 1 MB.
  • Files up to 50 MB, at most 2 requests per second per website, runs of up to about 55 minutes. It also reads URLs from another Actor run's dataset field, up to 50,000 per run.

It is not affiliated with or endorsed by Microsoft, Wikimedia, the IRS or any website you download from.

FAQ

Can I bulk download images from a URL list in Excel without a macro?

Yes. Either read the .xlsx with a script like the one above, or copy the URL column into a downloader that takes one URL per line. A VBA macro works too, but it only runs in desktop Excel on Windows or Mac.

Do I need pandas or openpyxl to read an Excel file in Python?

Not for reading text values. An .xlsx file is a ZIP archive of XML files, and the standard library's zipfile and xml.etree.ElementTree can read the shared strings and the cells. For formulas, dates, formatting or writing workbooks, a library such as openpyxl saves a lot of work.

How do I name the downloaded images after a column in the sheet?

Read the ID column alongside the URL column and use it as the file name, cleaned of characters that are not safe in file names. The script above takes the extension from the file's first bytes, so a SKU like A002 becomes A002.png when the server sent a PNG.

Why are some downloaded images not opening?

Usually the server returned an HTML page (an error, a login or "not found" page) with status 200, and the script saved it with an image extension. Check the first bytes of the response before saving; the script above records those rows as not an image (text/html) instead.

What about Google Sheets?

Download the sheet as .xlsx (File → Download → Microsoft Excel) and run the same script, or download it as CSV and read it with the csv module.

Where do your image URLs come from: a shop export, a supplier feed, or a scraper?

Disclosure: I built the Apify Actor mentioned in this post.