Ollama Amazon Parser

First production LLM work: a local llama3.2 service that replaced regex scraping of Amazon product pages with structured extraction.

Year
2025
Role
Solo build — extraction service, schema, integration
Discipline
AI Tooling

The problem

Last Wrap Hero priced gift wrapping from the customer's Amazon link, which meant parsing product pages for title, price, size, quantity, and roll dimensions. Regex against Amazon's markup broke every few weeks, and each product type — paper, ribbon, boxes, tags, bows — needed its own brittle rules.

The approach

A small Express service accepts a URL, ASIN, or raw HTML and asks a locally hosted llama3.2 model, through Ollama, to return the product as a fixed JSON schema: type, title, price, brand, size, quantity, dimensions, roll length and width. The schema is enforced on the way out so the caller gets typed fields or an explicit error, never prose. It is deliberately a separate service, so the main application treats it as an optional dependency and falls back to the old regex parser when it is unreachable.

Outcome

Ran alongside Last Wrap Hero during the 2025 season, turning a maintenance chore into a schema definition. Small in scope, but it established two habits that carried into everything after: self-hosted inference for anything touching private data, and treating the model as a component behind a typed contract with a fallback.

Details

  • Local inference with Ollama and llama3.2 — no product data sent to a hosted model
  • Fixed JSON schema for five product types, enforced before the response is returned
  • Accepts a URL, an ASIN, or raw HTML so the caller controls fetching
  • Optional dependency: the main app falls back to regex parsing when the service is down

Built with

  • JavaScript
  • Node.js
  • Ollama
  • REST API

Links

Need something like this? AI Tooling & Developer Infrastructure is what I do.

Related work

Last updated .