A few months ago, a friend who runs a sales team came to me with a problem. He wanted to time his outreach better. If a competitor just got hit with a big regulatory fine, or announced layoffs, or acquired a smaller company, that was his signal to reach out to their customers. But finding that signal manually meant checking dozens of websites every morning.
Since I'm the "tech guy" in my friend group, he asked if I could just scrape the data for him. Layoff announcements, regulatory fines, acquisition news — how hard could it be?
It turns out, it's a nightmare. And it's the exact reason we ended up building structured APIs for this stuff at ParheliaWeb.
The Scraper Reality Check
Here is what my first prototype looked like. It's the kind of script a lot of developers write when they just need data quickly:
import requests
from lxml import html
def scrape_layoffs(url):
response = requests.get(url, headers={"User-Agent": "Mozilla/5.0"})
tree = html.fromstring(response.content)
# These selectors work... until the site redesigns
companies = tree.xpath("//h3[@class='company-name']/text()")
counts = tree.xpath("//span[@class='layoff-count']/text()")
dates = tree.xpath("//time[@class='announcement-date']/@datetime")
return [{"company": c, "count": n, "date": d} for c, n, d in zip(companies, counts, dates)]
I handed it over, and it worked great for about a week. Then the real world hit:
- Cloudflare started blocking my IP. Sites that host high-value B2B data have aggressive anti-bot protections. Without rotating residential proxies and proper fingerprinting, you are done after 50 requests.
- The DOM shuffle. Government regulatory sites and local business registries update their HTML structure without warning. One Tuesday morning, your CSS selectors break, your pipeline returns
null, and your users get stale data. Maintaining these selectors is a full-time job. - The "noise" problem. News articles and press releases are unstructured. Extracting the exact number of layoffs, the specific regulatory body issuing a fine, or the financial terms of an acquisition is messy. You end up with "approximately 150 employees" and "a multi-million dollar settlement" — text that is useless for automated workflows.
- Deduplication hell. The same layoff gets posted on the company's blog, TechCrunch, LinkedIn, and three industry newsletters. My script counted it four times.
I ended up spending more time fighting Cloudflare, normalizing text, and handling rate limits than actually helping my friend. I was building an infrastructure project, not a data tool.
The API Approach (What I Use Now)
After realizing that scraping was a massive time sink, I stopped fighting the websites and started structuring the data properly. We built ParheliaWeb's layoffs, fines, and acquisitions APIs to be the pipeline I wished I had when my friend first asked for help.
Here is how you get the same data in 5 lines of clean Python:
import requests
API_KEY = "your_api_key_here" # Get one at parheliaweb.com
response = requests.get(
"https://parheliaweb.com/v1/layoffs",
headers={"x-api-key": API_KEY},
params={
"max_age_days": 30,
"max_records": 10
}
)
data = response.json()
for event in data["results"]:
print(f"{event['company_name']} laid off {event['layoff_count']} people "
f"on {event['announcement_date']}")
And instead of messy text strings, you get back clean, structured JSON that you can actually plug into an app or a dashboard:
{
"user_tier": "pro",
"count": 10,
"max_age_days": 30,
"last_crawled": "2026-07-31T10:30:00Z",
"results": [
{
"company_name": "TechCorp Inc.",
"layoff_count": 150,
"percentage": "15%",
"announcement_date": "2026-07-15",
"source_url": "https://example.com/...",
"source_status": "active",
"sector": "SaaS",
"country": "US"
}
]
}
No parsing. No deduplication. No 4 AM alerts when a government website changes its layout. It just works.
The Real Cost Comparison
If you are trying to decide whether to build your own data pipeline or use an API, here is what I learned from the trenches:
| Factor | Build Yourself | Use an API |
|---|---|---|
| Time to first result | 4-8 weeks | 5 minutes |
| Ongoing maintenance | 10+ hours/week | 0 |
| Data coverage | Limited to the 2-3 sites you can scrape | Funding, Acquisitions, IPOs, Layoffs, Fines |
| Data structure | Messy, requires constant normalization | Clean, standardized JSON |
| Compliance (GDPR, etc.) | Your risk | We handle source attribution and data minimization |
| Cost | Your time + proxy infrastructure | €29/month per API |
My rule of thumb: If your core business is data collection, build it. If your core business is using the data, use an API. Let someone else worry about the CSS selectors.
Getting Started
Try it free
100 free API calls per day, no credit card required. See if it works for your use case.
Pro tier: Full dataset access for €29/month per API.
Get your free API key →🚀 Want to see who is getting funded?
Layoffs and fines tell you who is struggling. Funding rounds tell you who is growing. Check out how we built our Startup Funding Signal API to deliver AI-verified funding data without the headache of brittle web scrapers.
Questions?
I'm Andy, the founder. I'm just an IT guy who likes solving problems for people. If you have questions about the data or the API, just drop me a line.