惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

M
MIT News - Artificial intelligence
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
博客园 - Franky
腾讯CDC
T
Tailwind CSS Blog
Recent Announcements
Recent Announcements
V
V2EX
N
Netflix TechBlog - Medium
量子位
Jina AI
Jina AI
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
爱范儿
爱范儿
博客园 - 叶小钗
D
Docker
MongoDB | Blog
MongoDB | Blog
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I Built a $29/Month API That Turns Any Website Into Struc...
Sergio Morales · 2026-06-05 · via DEV Community

Sergio Morales

I've written a lot of scrapers. The HTML parsing part is never the interesting part — it's the part that takes the longest. You know what data you want. You know where it lives on the page. Getting it out shouldn't require 40 lines of cheerio and a prayer.

So I built an API that takes CSS selectors and gives you JSON. That's it.

curl -s -X POST https://structapi.duckdns.org/extract   -H "X-API-Key: $KEY"   -H "Content-Type: application/json"   -d '{
    "url": "https://news.ycombinator.com",
    "fields": [
      {"name": "title", "selector": ".titleline > a"},
      {"name": "link", "selector": ".titleline > a", "attr": "href"}
    ]
  }'

Enter fullscreen mode Exit fullscreen mode

Returns:

{
  "success": true,
  "data": {
    "title": "Show HN: StructAPI — Turn websites into JSON",
    "link": "https://structapi.duckdns.org"
  }
}

Enter fullscreen mode Exit fullscreen mode

You define fields with CSS selectors. You get back an object matching your schema. No HTML in the middle.

Why I built this

Every scraping API I tried falls into one of two buckets:

  1. Proxy-first services (ScrapingBee, ScraperAPI, BrightData) — they do the unblocking, rotating IPs, captcha solving — and then dump raw HTML on you. You still have to parse it.

  2. AI extraction (Diffbot, $299/mo) — they extract structured data but you can't control the schema. The AI picks what it thinks is relevant. If it picks wrong, tough luck.

I wanted the middle ground: you control the extraction, I handle the HTTP. CSS selectors are the interface — they're precise, testable, and every developer already knows them.

What it does

/extract — You provide a URL and an array of field definitions (name + CSS selector). We fetch the page, run the selectors, return JSON. Single values, arrays, attribute extraction, nested selectors — all work.

/auto — Don't know the selectors? We auto-detect title, headings, links, images, and paragraphs from any URL. Good for quick looks, not for production.

/usage — Check your current month's request count and remaining quota.

What it costs

Tier Requests/mo Price
Free 100 $0
Starter 10,000 $29/mo
Pro 50,000 $99/mo
Scale 200,000 $299/mo

Free tier: no credit card needed. Run curl -X POST https://structapi.duckdns.org/keys -H "Content-Type: application/json" -d '{}' and you get a key back.

What it doesn't do (yet)

  • JS rendering (React, Vue SPAs) — static HTML extraction only for now
  • IP rotation / residential proxies — coming after first 5 paid customers
  • Captcha solving — not planning to support this
  • Screenshots or PDFs — text extraction only

How it's built

Node.js on Express with better-sqlite3 for usage tracking. Stripe for billing (checkout, webhooks, customer portal). Caddy reverse-proxies to provide HTTPS. Hosted on a $12/mo VPS.

Source code on GitHub: https://github.com/92SM/structapi

Try it

# Get a free key
curl -X POST https://structapi.duckdns.org/keys -H "Content-Type: application/json" -d '{}'

# Extract data
KEY="***"
curl -X POST https://structapi.duckdns.org/extract   -H "X-API-Key: $KEY"   -H "Content-Type: application/json"   -d '{"url":"https://example.com","fields":[{"name":"h1","selector":"h1"}]}'

Enter fullscreen mode Exit fullscreen mode

Docs: https://structapi.duckdns.org/docs