HTML to JSON Smart Parser avatar

HTML to JSON Smart Parser

Pricing

from $2.50 / 1,000 results

Go to Apify Store
HTML to JSON Smart Parser

HTML to JSON Smart Parser

Converts HTML from URLs, pasted content, or uploaded files into structured JSON using OpenAI. Specify fields or let AI auto-detect important data. Returns one flat JSON object per input.

Pricing

from $2.50 / 1,000 results

Rating

5.0

(2)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

50

Total users

3

Monthly active users

9 days ago

Last modified

Share

ParseForge

HTML to JSON Smart Parser

Convert any HTML page or pasted HTML into clean, structured JSON with AI. Provide a URL, paste HTML, or upload a file, and get back a flat JSON object with the fields you need. No coding, no selectors, no brittle parsing.

Turning messy HTML into usable JSON usually means writing custom parsers, maintaining XPath or CSS selectors, and fixing them every time the site changes. This actor uses an OpenAI model to read the HTML and extract the fields you ask for, or auto-detects the important ones. It works on any page, from product listings to articles to dashboards, and returns one consistent JSON object per input.

Who uses itWhat they scrape HTML to JSON for
Data engineersTurn one-off HTML pages into JSON for pipelines without writing a custom scraper
Market researchersExtract structured data from competitor pages or industry reports
No-code buildersFeed HTML into automation tools that expect JSON
SEO analystsPull structured content from pages to audit metadata or on-page elements

What it does

This actor fetches HTML from URLs, pasted content, or uploaded files, and uses an OpenAI model to convert it into a flat JSON object with the fields you specify or auto-detected fields.

  • 🔗 URL input: paste one or more page URLs and the actor fetches the HTML for you
  • 📋 Paste HTML: drop raw HTML directly into the input and get JSON back
  • 📁 File upload: upload HTML files and provide their URLs for batch conversion
  • 🤖 AI extraction: specify fields like title, price, or description, or let the model auto-detect what matters
  • 🧠 Custom prompt: override the default system prompt to guide extraction for niche use cases

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with HTML to JSON data

🛒 Extract product data from e-commerce pages.

A dropshipper pastes a competitor product URL, asks for title, price, and images, and gets a clean JSON object to feed into their own store.

📰 Turn articles into structured records.

A content analyst uploads HTML files of news articles, specifies headline, author, and body, and receives one JSON row per article for their database.

📊 Pull data from dashboards or reports.

A business user pastes HTML from an internal report, asks for key metrics, and gets JSON they can load into a spreadsheet.

🔍 Audit on-page SEO elements.

An SEO specialist provides a list of URLs, requests title, meta description, and H1 tags, and receives a JSON dataset for a site-wide audit.

Why choose this scraper

What you get
No selectorsYou never write CSS or XPath. The AI reads the page and finds the data
Any HTMLWorks on product pages, articles, dashboards, and even malformed markup
Flexible fieldsAsk for specific fields or let the model decide what is important
Batch readyFeed multiple URLs or files in one run and get a dataset of JSON rows

How it compares

This actor uses AI to convert HTML to JSON without any selectors, while the competitors below require code or focus on article extraction.

FeatureParseForgeCheerio ScraperSmart Article Extractor
AI-based extraction without selectorsYesNot listedNot listed
Paste raw HTML directlyYesNot listedNot listed
Upload HTML filesYesNot listedNot listed
Custom system prompt for extractionYesNot listedNot listed
Recursive crawling of websitesNot listedYesYes
Automatic article detectionNot listedNot listedYes

Configure the run

Provide URLs, pasted HTML, or uploaded file URLs, and optionally list the fields you want extracted or a custom system prompt. The actor processes each input and returns one JSON object per page. The Input tab lists every parameter.

A first run with the defaults:

{
"url": [
{
"url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
}
],
"htmlFileUrl": [],
"model": "gpt-4o-mini"
}

Pricing

Pay-per-result: $0.0025 per result collected. You pay only for the results written to your dataset.

Results collectedApproximate cost
100 results$0.25
1,000 results$2.50
10,000 results$25.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect more results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the HTML to JSON Smart Parser.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to HTML to JSON through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

$claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/html-to-json-smart-parser"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting an error about the OpenAI API key?

Make sure you have entered a valid OpenAI API key in the input. The key must have access to the model you selected. If the key is missing or invalid, the actor logs an error and skips the run.

Why is the output JSON empty or missing fields?

The model may not have found the fields you requested. Check that the HTML contains the data, and try specifying the fields explicitly in 'Fields to Extract'. You can also use a custom system prompt to guide the model.

Why does the actor fail on some URLs?

The actor uses a simple HTTP GET request. Some sites block non-browser requests or require JavaScript. If a URL fails, try fetching the HTML with a browser-based scraper and then paste the HTML into this actor.

Why is the run slow?

Each page requires an OpenAI API call, which can take a few seconds. If you are processing many pages, consider using a faster model like gpt-4o-mini or reducing the number of inputs.

Can I process HTML files I have on my computer?

Yes, upload the HTML files to Apify using the file upload button in the input, then provide the file URLs in the 'HTML file URLs' field. The actor will fetch and process them.

FAQ

QuestionAnswer
Do I need an OpenAI API key?Yes, you must provide your own OpenAI API key in the input. The actor uses it to call the model for extraction. Without a key, the actor logs an error and skips processing.
What if I don't specify fields to extract?The actor uses a smart default prompt that tells the model to identify and extract all important fields from the HTML. You will get a JSON object with the fields the model found.
Can I process multiple pages in one run?Yes, you can provide multiple URLs or multiple HTML file URLs. Each input is processed separately and returned as one row in the dataset.
What models are supported?You can choose from gpt-4o, gpt-4o-mini, gpt-4-turbo, and gpt-3.5-turbo. The default is gpt-4o-mini for a good balance of cost and quality.
Can I customize how the AI extracts data?Yes, you can provide a custom system prompt in the input. This overrides the default prompt and lets you give specific instructions to the model.
Does this work with JavaScript-rendered pages?No, the actor makes a simple HTTP GET request and does not execute JavaScript. If the page requires JS to render content, you should use a browser-based scraper like Puppeteer Scraper first and then feed the HTML here.
What output formats are supported?The actor returns JSON objects in the dataset. You can export the dataset to CSV, JSON, Excel, or XML from the Apify platform.
Is there a limit on HTML size?The actor can handle typical web pages, but very large HTML files may exceed the model's context window. If you encounter errors, try extracting only the relevant portion of the HTML.
Can I use this for free?The actor itself runs on Apify, but you will incur OpenAI API costs based on the model and the amount of text processed. Apify platform usage may also apply.
What if the extraction returns wrong fields?Try specifying the exact fields you want in the 'Fields to Extract' input, or provide a custom system prompt with clearer instructions. You can also switch to a more capable model like gpt-4o.

Browse the full ParseForge collection for more scrapers.

🆘 Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by OpenAI. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.