AI product spec extraction is the process of fetching a live product page, converting it to clean text, and asking a language model to return named fields as structured JSON. Imagine you need to track processor speed, battery life, and weight across 500 laptop listings from a dozen retailers. Writing CSS selectors for each site takes days, and they break the moment a site redesigns. Sending raw HTML to an LLM wastes tokens on navigation menus and cookie banners. The approach that works in 2026 is: fetch the page, strip it to clean Markdown, then extract. By the end of this guide you will have a working Python pipeline, a cost table, and a clear decision on when this approach beats the alternatives.
The Problem with Scraping Product Pages Directly
A product page that looks simple in a browser is a mess underneath. A typical e-commerce page contains navigation, footer links, ad scripts, cookie consent markup, and recommendation carousels, all mixed in with the two paragraphs of spec text you actually want. Sending that raw HTML to an LLM has two costs: you burn tokens on noise, and the model's attention is diluted across irrelevant content, which reduces extraction accuracy.
There is a second problem: JavaScript rendering. Most modern product pages load their price, stock status, and spec table via JavaScript after the initial HTML response. A plain HTTP fetch returns a skeleton. You need a headless browser to get the real content, and running one at scale means managing browser pools, proxies, and anti-bot handling yourself.
The third problem is blocking. Retailers actively detect and block scrapers. A request from a data-center IP without the right headers returns a bot-check page, not a product page. Manual specification analysis by technicians is time-consuming, error-prone, and difficult to scale, and the same is true of brittle scraper maintenance.
The pipeline in this guide solves all three at once.
Why Clean Markdown Is Better LLM Input Than Raw HTML
Markdown strips a page to its semantic content: headings, paragraphs, lists, and tables, in reading order, with no tag soup. For a language model, that means fewer tokens per page and a cleaner signal. A product page that weighs 120 KB of HTML often compresses to under 10 KB of Markdown, which means lower LLM API costs and faster responses.
The query parameter on the Markdown API goes further. Pass a short description of what you want, such as "product specifications, price, and availability", and the API filters the Markdown to the sections most relevant to that query before returning it. Navigation, footer, and sidebar content are dropped. What arrives at your LLM prompt is almost entirely spec content.
For a deeper look at why this matters for LLM pipelines, see our post on converting web pages to Markdown for LLMs.
The practical rule: if your LLM extraction accuracy is lower than you expect, the input text quality is usually the first thing to fix, before you touch the prompt.
Does AI recommend your brand?
Free check: how often ChatGPT, Gemini and Google AI Overviews name your brand next to your top competitor, and whether AI crawlers can read your site. Instant for brands in the Index.
Which AI Tool Is Best for Product Data Extraction?
The honest answer is that no single AI tool does everything. The pipeline has two distinct jobs, and different tools are best for each.
Fetching and cleaning the page is an infrastructure problem. You need rotating proxies, JavaScript rendering, and anti-bot handling. ChatGPT and other LLMs cannot browse live URLs reliably at scale, and they have no proxy layer. A scraping API handles this part.
Extracting structured fields from clean text is where LLMs shine. Given a short Markdown excerpt and a prompt like "return the processor, RAM, storage, and price as JSON", a capable model returns accurate structured data without any CSS selectors or XPath.
For LLM web data extraction at scale, the combination that works is:
- Markdown API to fetch, render, and clean the page into LLM-ready text
- Any LLM (OpenAI, Anthropic, Google) to extract named fields from that text
ChatGPT (via the OpenAI API) is a common choice for the extraction step because its JSON mode returns reliably parseable output. The Ujeebu ChatGPT API wraps the same model if you want a single-vendor setup. For the scraping step, the Markdown API handles JavaScript rendering, proxy rotation, and CAPTCHA solving automatically.
The Pipeline: Scrape, Convert to Markdown, Extract with an LLM
The pipeline has three steps:
- Fetch and render the product page with a headless browser and rotating proxies, so you get the real DOM including JavaScript-rendered content.
- Convert to filtered Markdown using the
queryparameter to keep only spec-relevant content. - Extract fields by sending the Markdown to an LLM with a structured prompt and parsing the JSON response.
Step 1 and 2 happen in a single API call to /markdown. Step 3 is a call to your LLM of choice. The result is a JSON object with the fields you defined, ready to write to a database or spreadsheet.
This is also how you can scrape hidden web data with ChatGPT: the LLM never touches the live page directly. The Markdown API handles the fetch and rendering, and the LLM sees only clean, relevant text. That separation is what makes the pipeline reliable at scale.
Working Python Code: Extract Product Specs at Scale
The example below fetches a product page, converts it to filtered Markdown, then asks OpenAI to extract a spec object. It uses requests for both API calls and the openai library for the extraction step. Swap the OpenAI call for any LLM you prefer.
curl -X POST https://api.ujeebu.com/markdown \
-H "ApiKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://scrape.li/quotes/",
"query": "product specifications, price, availability",
"citations": true,
"js": true
}'
import requests
import json
from openai import OpenAI
UJEEBU_KEY = "YOUR_API_KEY"
OPENAI_KEY = "YOUR_OPENAI_KEY"
FIELDS = ["name", "price", "processor", "ram", "storage", "battery_life", "weight", "availability"]
SYSTEM_PROMPT = """You are a product data extraction assistant.
Given Markdown text from a product page, return ONLY a JSON object
with these fields: name, price, processor, ram, storage, battery_life,
weight, availability. Use null for any field not found."""
def fetch_markdown(url: str) -> str:
"""Fetch a product page and return clean, filtered Markdown."""
resp = requests.post(
"https://api.ujeebu.com/markdown",
headers={"ApiKey": UJEEBU_KEY, "Content-Type": "application/json"},
json={
"url": url,
"query": "product specifications, price, availability",
"citations": True,
"js": True,
},
timeout=90,
)
resp.raise_for_status()
credits_used = resp.headers.get("Ujb-Credits", "unknown")
print(f" Markdown fetched. Credits used: {credits_used}")
# The API returns the markdown in the response body as plain text
return resp.text
def extract_specs(markdown: str) -> dict:
"""Send Markdown to an LLM and return structured spec fields."""
client = OpenAI(api_key=OPENAI_KEY)
completion = client.chat.completions.create(
model="gpt-4o-mini",
response_format={"type": "json_object"},
messages=[
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": markdown[:8000]}, # stay within context
],
)
return json.loads(completion.choices[0].message.content)
def extract_product(url: str) -> dict:
print(f"Processing: {url}")
markdown = fetch_markdown(url)
specs = extract_specs(markdown)
specs["source_url"] = url
return specs
# --- Run on a list of product URLs ---
product_urls = [
"https://scrape.li/quotes/",
# add more URLs here
]
results = [extract_product(url) for url in product_urls]
print(json.dumps(results, indent=2))
A few things worth noting in this code. The Ujb-Credits header tells you exactly how many credits each Markdown call consumed, which makes cost tracking straightforward. The js=True parameter ensures JavaScript-rendered content is included. The query parameter focuses the returned Markdown on spec content, so the LLM receives a shorter, cleaner prompt. Truncating to 8,000 characters is a safe default for most product pages; adjust upward for pages with long spec tables.
For Amazon product pages specifically, the Scrape API's recipe=amazon/detail parameter returns structured JSON directly without an LLM step. See the step-by-step Amazon scraping guide for that approach.
Can AI Do Data Extraction? Approaches Compared
Yes, but the right approach depends on the site, the data, and how much maintenance you can afford. There are three main patterns:
| Approach | Accuracy | Maintenance effort | Cost per 1,000 pages | Best use case |
|---|---|---|---|---|
| Rule-based parsing (CSS selectors, XPath) | High when selectors are correct | High: breaks on every site redesign | Low (scrape credits only) | Single site, stable layout, high volume |
| Structured data APIs (recipe= endpoints) | Very high for supported sites | None: Ujeebu maintains the recipes | Low (same as a page call) | Supported sites: Amazon, Zillow, LinkedIn, and 40+ others |
| LLM extraction via Markdown | High across arbitrary sites | Low: prompt rarely needs updating | Medium (Markdown + LLM tokens) | Many sites, varied layouts, spec-heavy pages |
Rule-based parsing is the cheapest per page but requires a selector set per site. A rotating proxy pool works like a call center rotating its outgoing lines: it keeps requests flowing, but someone still has to write the script for each destination. Structured data APIs (the recipe= approach) are the best choice when your target site is supported, because Ujeebu maintains the extraction logic. LLM extraction via Markdown is the right tool when you need to cover dozens of sites with varied layouts and cannot afford to maintain a selector per site.
Natural language processing and LLMs can automate specification document analysis end to end, handling unstructured text that would defeat any CSS selector. The trade-off is token cost and latency per page.
Cost Breakdown: What This Pipeline Costs per 1,000 Products
The Markdown API costs 10 credits per page. LLM token costs are a separate line item billed directly by your LLM provider and depend on the model and the length of the Markdown you send.
| Plan | Monthly price | Credits included | Markdown cost per 1,000 pages | Notes |
|---|---|---|---|---|
| Starter | $49 | 300,000 | $1.63 | Good for up to ~30,000 pages/month on Markdown alone |
| Growth | $119 | 1,000,000 | $1.19 | Scales to ~100,000 pages/month |
| Pro | $299 | 3,000,000 | $1.00 | ~300,000 pages/month |
| Business | $999 | 15,000,000 | $0.67 | ~1,500,000 pages/month |
The per-page cost falls as you move up plans because each credit costs less. At the Starter tier, 1,000 product pages costs $1.63 in Markdown API credits. Add your LLM token costs on top: a short product spec in Markdown typically uses a few hundred tokens per page for input and a small JSON object for output, so the LLM cost is usually comparable to or less than the scraping cost at moderate volumes.
Failed requests (bot-check pages, timeouts, network errors) are not billed, so your effective cost per successful extraction is what the table shows.
You can try the pipeline on the free trial: 5,000 credits, no credit card required, which covers 500 Markdown pages to test your extraction prompts before committing to a plan.
The chart below compares the Markdown API cost per 1,000 pages across plans.
How ChatGPT Assists in Product Information Extraction
Beyond the extraction step in the pipeline above, ChatGPT is useful for two other tasks in an AI product spec extraction project.
Writing and refining extraction prompts
The quality of the JSON you get back depends heavily on the system prompt. ChatGPT can help you iterate on prompt wording, add field descriptions, and handle edge cases like products that list weight in different units across sites. Treat it as a prompt engineering assistant.
Planning the data model
Before you write any code, you need to decide which fields to extract and how to normalize them. ChatGPT can help you think through a product taxonomy: which attributes are universal (name, price, availability) versus category-specific (battery life for laptops, thread count for textiles). This planning step is where ChatGPT adds the most value, before a single HTTP request is made.
ChatGPT's limits in this pipeline
ChatGPT cannot fetch live URLs reliably at scale, cannot rotate proxies, and cannot handle JavaScript rendering or CAPTCHA challenges. It also cannot test the code it generates. The Markdown API handles the fetch and clean step; ChatGPT handles the extraction and planning steps. Keep the responsibilities separate and the pipeline is robust.
ChatGPT's Limitations in Automating Product Data Extraction
ChatGPT has notable limitations when it comes to automating the entire large-scale web scraping process:
Execution and Testing
ChatGPT cannot execute or test the scripts it generates. After receiving a code snippet from ChatGPT, users must manually test and validate the code in their development environment to ensure it works as expected. Moreover, while ChatGPT can generate basic scraping code, it lacks the depth required for large-scale data extraction projects.
Handling Complexities of Large-Scale Projects
For simple websites or for learning projects, ChatGPT's generated code may suffice. But for large-scale projects or dynamic websites, you'll need additional tools and write custom code such as:
- Advanced selectors: Hand-coding specific CSS or XPath selectors to accurately target the data points.
- Rotating proxies: Implementing rotating IP addresses to avoid detection and prevent getting blocked.
- Anti-ban measures: Adding features like user-agent rotation and session management to bypass anti-bot mechanisms on target websites.
- Javascript Rendering: add headless browser tool to extract data hidden in javascripts.
Legal and Ethical Considerations
ChatGPT can provide general guidance on the legal aspects of web scraping, but it is not equipped to offer legal advice tailored to your project. Users must ensure that their scraping activities comply with laws such as copyright, privacy policies, and the terms of service of the websites they scrape.
Enhancing ChatGPT-Generated Scripts with Ujeebu
For larger-scale data extraction projects, ChatGPT's output can be combined with more advanced tools like Ujeebu, which provides built-in solutions for handling IP bans, CAPTCHAs, and dynamic content rendering using headless browsers.
Ujeebu's Scrape API offers robust solutions that complement ChatGPT's script generation capabilities to perform the following:
- Anti-ban strategies: automatic rotating proxies and user-agent to avoid IP blocking and ensure uninterrupted access during scraping.
- Handling dynamic content: Leverage in-built headless browsers techniques to extract data from JavaScript-heavy websites. Ujeebu's JavaScript injection capabilities allow you to automate actions on any webpage, render the results, and verify the presence of specific elements.
- Data extraction versatility: Easily extract a wide range of data, including leads, reviews, real estate listings, stock information, flight details, contact information, and more, with minimal coding required.
- Integrated machine learning: Ujeebu Scrape API's rule-based parameters efficiently target specific content on any website. Use the extracted data to train machine learning models for tasks like classification, recognition, or computer vision applications.
Best Practices for Using This Pipeline
- Start with the
queryparameter: A focused query reduces Markdown length and improves LLM accuracy. Be specific: "processor speed, RAM, storage capacity, price in USD" beats "product details". - Use JSON mode on your LLM: OpenAI's
response_format: json_objectand equivalent settings on other models eliminate parsing errors from prose responses. - Track credits per request: The
Ujb-Creditsresponse header lets you log actual cost per URL, which is useful for budget forecasting at scale. - Use recipes for supported sites: If your target is Amazon, Zillow, or another of the 40+ supported sites,
recipe=returns structured JSON directly and skips the LLM step entirely, cutting cost and latency. - Verify and test: Always test extraction prompts on a sample of real pages before running at scale. Edge cases (missing fields, unusual units, multi-currency prices) surface quickly on a 20-page sample.
- Stay legal and ethical: Ensure your scraping activities comply with the terms of service of the websites you scrape. Consult legal professionals when in doubt.
Conclusion
The fastest path to reliable AI product spec extraction in 2026 is a two-step pipeline: the Markdown API to fetch, render, and filter the page, then an LLM to extract named fields from clean text. This approach handles JavaScript-rendered content, rotating proxies, and anti-bot measures without any infrastructure on your side. The per-page cost is predictable, failed requests are free, and the extraction prompt rarely needs updating when a site redesigns.
For sites with a supported recipe, skip the LLM step entirely and use recipe= for structured JSON at lower cost. For everything else, the Markdown-plus-LLM pipeline is the most maintainable approach available.
Start with the free trial (5,000 credits, no credit card) to test your extraction prompts before committing to a plan.
FAQ
Which AI tool is best for data extraction?
No single tool covers the full pipeline. For fetching and cleaning live web pages, a scraping API with JavaScript rendering and proxy rotation (such as the Markdown API) is the right tool. For extracting structured fields from that clean text, a large language model with JSON mode (OpenAI GPT-4o, Anthropic Claude, or Google Gemini) works well. The combination of a scraping API for the fetch step and an LLM for the extraction step outperforms either tool used alone.
Can AI do data extraction?
Yes. LLMs can extract named fields from unstructured text with high accuracy, without CSS selectors or XPath. The key constraint is input quality: an LLM given raw HTML with navigation, ads, and scripts performs worse than one given clean, filtered Markdown of the same page. AI-based extraction also handles variation across sites naturally, because the model reads the text semantically rather than matching a fixed pattern.
What is AI feature extraction?
AI feature extraction (also called AI product attribute extraction) is the process of identifying and pulling specific attributes from unstructured text or images. For product data, this means reading a page or document and returning fields like processor speed, weight, price, or material as structured values. LLMs perform this via a prompt that names the fields; vision models can do the same from product images.
How do I extract product specifications from a live web page?
Fetch the page with a headless browser to get JavaScript-rendered content, convert the HTML to clean Markdown (the query parameter filters to spec-relevant sections), then send the Markdown to an LLM with a prompt naming the fields you want. The LLM returns a JSON object. The Markdown API handles the fetch, render, and conversion step in a single call; the LLM handles the extraction step.
How much does it cost to extract product data with an LLM at scale?
The Markdown API costs 10 credits per page. On the Starter plan ($49/month for 300,000 credits), that works out to $1.63 per 1,000 pages. On the Business plan ($999/month for 15,000,000 credits), the cost falls to $0.67 per 1,000 pages. LLM token costs are a separate line item billed by your LLM provider and depend on the model and the length of the Markdown sent. Failed requests are not billed.
What is the difference between web scraping and LLM-based data extraction?
Web scraping uses code (CSS selectors, XPath, or a scraping API) to fetch and parse a page according to rules you define. It is fast and cheap per page but requires a rule set per site and breaks when layouts change. LLM-based data extraction sends the page content to a language model and asks it to identify fields by meaning. It works across varied layouts without site-specific rules but adds token cost and latency. In practice, the two approaches are complementary: a scraping API fetches and cleans the page, and an LLM extracts the fields.
Try it yourself
Run this on your own pages
Get a free API key and make your first call in minutes. 5,000 free credits for 21 days, no card.