ParseForge Scrapers

HTML to JSON Smart Parser

parseforge/html-to-json-smart-parser

AIDeveloper toolsAutomation

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.

Run this scraper See the API call
Total users
50
Monthly active
3
Total runs
362
Bookmarked
0
Rating
5.0 (2)
Last modified
12 days ago

Overview

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 it What they scrape HTML to JSON for
Data engineers Turn one-off HTML pages into JSON for pipelines without writing a custom scraper
Market researchers Extract structured data from competitor pages or industry reports
No-code builders Feed HTML into automation tools that expect JSON
SEO analysts Pull 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 selectors You never write CSS or XPath. The AI reads the page and finds the data
Any HTML Works on product pages, articles, dashboards, and even malformed markup
Flexible fields Ask for specific fields or let the model decide what is important
Batch ready Feed 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.

Feature ParseForge Cheerio Scraper Smart Article Extractor
AI-based extraction without selectors Yes Not listed Not listed
Paste raw HTML directly Yes Not listed Not listed
Upload HTML files Yes Not listed Not listed
Custom system prompt for extraction Yes Not listed Not listed
Recursive crawling of websites Not listed Yes Yes
Automatic article detection Not listed Not listed Yes

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 collected Approximate 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

Question Answer
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.

Related actors

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.

Input

FieldTypeWhat it doesDefault
url array URL(s) to fetch HTML content from. This will make a simple HTTP GET request to fetch the HTML. You can provide multiple URLs. Leave empty if pasting HTML or uploading files. [{"url":"https://books.toscrape.com/cata
htmlContent string Paste your HTML content here to convert to JSON, if not provided, the AI will automatically extract all important fields it identifies. not set
htmlFileUrl array Upload HTML file(s) and paste their URL(s) here. You can provide multiple file URLs. Leave empty if using URLs or pasting HTML content. You can upload files using the file upload button in Apify Console. []
openAIApiKey string Your OpenAI API key (if not provided it would return an error). You can get one from https://platform.openai.com/api-keys. If not provided, the actor will log an error and skip processing. not set
model string (5 options) The OpenAI model to use for conversion. Options: gpt-5, gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo gpt-4o-mini
fieldsToExtract string Specify which fields you want extracted from the HTML (e.g., ['title', 'price', 'description', 'images', 'specifications']). You can provide multiple field names. If not provided, the AI will automatically extract all important fields it identifies. not set
systemPrompt string Optional custom system prompt to guide the AI extraction. If not provided, a smart default prompt will be used that extracts meaningful information. not set

Pricing

from $2.50 per 1,000 results

Charged forWhat it isPrice each
Actor Start Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). $0.0025
Result Single result in the default dataset. $0.0025

Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.

API

One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.

POST ยท run and get results
curl -X POST "https://api.apify.com/v2/acts/parseforge~html-to-json-smart-parser/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "helloWorld": 123
  }'

Examples

Input that runs as-is.

input.json
{
  "helloWorld": 123
}

Reviews

Rated 5.0 out of 5 across 2 reviews. Read them on Apify.

Issues

We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.

Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.

Related scrapers

Run HTML to JSON Smart Parser on Apify All scrapers