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

推荐订阅源

GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
Cisco Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
IT之家
IT之家
博客园 - 【当耐特】
V
V2EX
博客园_首页
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 司徒正美
N
Netflix TechBlog - Medium
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
S
Schneier on Security
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
Vercel News
Vercel News
量子位
G
GRAHAM CLULEY
T
Threatpost
D
Darknet – Hacking Tools, Hacker News & Cyber Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cybersecurity and Infrastructure Security Agency CISA
S
Security @ Cisco Blogs
B
Blog
Stack Overflow Blog
Stack Overflow Blog
T
Tor Project blog
A
About on SuperTechFans
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
S
Securelist
博客园 - 聂微东
Cloudbric
Cloudbric
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
N
News | PayPal Newsroom
P
Privacy & Cybersecurity Law Blog
Schneier on Security
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
W
WeLiveSecurity
Martin Fowler
Martin Fowler
K
Kaspersky official blog
S
Security Affairs
TaoSecurity Blog
TaoSecurity Blog

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 Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I Built a Live Monitor for 77 Free Public APIs in a Weekend (Architecture + Bugs)
Yassine Adis · 2026-05-19 · via DEV Community

I got annoyed last month using the public-apis GitHub list. I clicked through ten "free weather APIs" and four were either dead, had silently moved to paid, or required a credit card their docs didn't mention. So I built a thing that watches them.

FreeAPI.watch pings 77 free public APIs every hour, records uptime and response time, and rebuilds a static site daily with the results. The bill is $0/month. Stack is Astro + Cloudflare Workers + D1 + Pages, daily auto-rebuild via GitHub Actions.

This post covers the architecture and the two bugs that ate the most time — including a Cloudflare Workers gotcha I haven't seen documented clearly anywhere.

The architecture

Three components. Each independently deployable, each does one thing.

                ┌────────────────────────────────────┐
                │            Cloudflare              │
                │                                    │
   ┌─────────┐  │  ┌──────────┐  ┌──────────────┐    │
   │ 77 APIs │◀─┼──│  Pinger  │─▶│   D1 (SQL)   │    │
   │ (HTTP)  │  │  │  Worker  │  │              │    │
   └─────────┘  │  │ cron 1h  │  │ apis         │    │
                │  └──────────┘  │ checks       │    │
                │                │ rollups      │    │
                │  ┌──────────┐  │ events       │    │
                │  │ Builder  │◀─┤              │    │
                │  │  Worker  │  └──────┬───────┘    │
                │  │ cron 1d  │         │            │
                │  └──────────┘         │ snapshot   │
                │       │               │ .json      │
                │       │       ┌───────▼─────────┐  │
                │       │       │  Astro static   │  │
                │       └──────▶│  (Pages)        │  │
                │  Pages deploy │  142 HTML pages │  │
                │     hook      └─────────────────┘  │
                │                                    │
                └────────────────────────────────────┘
                              │
                              ▼
                         GitHub Actions
                         daily 02:15 UTC

Enter fullscreen mode Exit fullscreen mode

Pinger is a Cloudflare Worker on an hourly cron. Reads the active API list from D1, sends one HTTP request to each documented health endpoint, records (api_id, ts, status_code, response_ms, alive). On state changes (alive → dead or vice versa), it inserts an event row.

Builder is a second Worker on a daily cron. Rolls up the past 24 hours of checks per API into a rollups table (uptime percentage, average response time), prunes old check rows, and exposes /snapshot.json and /api/v1/* endpoints for the static site to consume.

Astro is a 142-page static site. At build time, it fetches the snapshot from the Builder, generates all pages, and Cloudflare Pages serves them globally. There's no server-side rendering — every page is pure HTML.

The data flow goes one way: pinger writes → D1 → builder rolls up → Astro reads snapshot at build time. The site never queries D1 at request time. This is intentional — static HTML can't fail at runtime, has perfect Core Web Vitals, and Google indexes it cleanly.

The bug that ate an afternoon

When I deployed the first version, the pinger reported every API as offline. Every. Single. One. status_code: 0, response_ms: 0.

My first instinct: network problem. Cloudflare can't reach external HTTPS endpoints. So I wrote a debug endpoint that just did a plain fetch to a known-good URL:

async fetch(req: Request, env: Env): Promise<Response> {
  const r = await fetch("https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41&current=temperature_2m");
  return Response.json({ status: r.status, ms: 80 });
}

Enter fullscreen mode Exit fullscreen mode

That returned { status: 200, ms: 80 }. Fetch works fine.

Next instinct: my code structure is breaking it. So I tried the actual ping() function with the same URL:

const result = await ping(
  { id: 999, health_url: target, health_method: "GET", expected_status: 200 },
  { fetcher: fetch, now: () => new Date() }
);
return Response.json(result);

Enter fullscreen mode Exit fullscreen mode

Returned status_code: 0, response_ms: 0. The function fails when I pass fetch through dependency injection.

I added error logging to the catch block:

TypeError: Illegal invocation: function called with incorrect `this` reference.
See https://developers.cloudflare.com/workers/observability/errors/#illegal-invocation-errors

Enter fullscreen mode Exit fullscreen mode

In V8 isolates, fetch is implemented with a brand check on this. When you store it as an object property:

const deps = { fetcher: fetch };
await deps.fetcher(url);  // ← `this` is now `deps`, not `globalThis`

Enter fullscreen mode Exit fullscreen mode

The brand check fails synchronously, before any network call is attempted. That's why response_ms was 0 — there was no network roundtrip, just an immediate throw.

The fix is one line:

const deps = { fetcher: fetch.bind(globalThis) };

Enter fullscreen mode Exit fullscreen mode

Or you can call fetch directly without storing it. The whole point of the DI pattern was unit testability — I wanted to inject a mocked fetcher in vitest. Binding to globalThis keeps the same interface and unblocks the tests.

I don't have a great mental model for why this isn't documented more prominently. The Cloudflare error page is good but it's not the first thing you find when you search "cloudflare workers fetch returns 0". I lost an afternoon to it. If you write DI-style Workers, bind your built-ins.

The second bug: the 50-subrequest cliff

Cloudflare Workers on the free tier cap subrequests at 50 per invocation. With 77 APIs to ping, I hit the limit on every cron from day one.

The first thing I tried was filtering to status === "active" (skipping the 6 entries in our "graveyard" of dead/paid APIs). That dropped us to 71. Still over the limit.

The honest disclosure: as of writing this, I'm still over the limit. Each cron run pings the first 50 APIs successfully and silently fails on the remaining 21. The dashboard says the worker "completed" because the loop didn't throw — the fetch() calls just hit the per-invocation cap and resolve as failures.

The fix I haven't shipped yet: split the pinger across two cron schedules. Run one at 0 * * * * covering APIs 1-40, another at 5 * * * * covering APIs 41-77. That stays under the 50 limit per invocation with 10 to spare for D1 writes. It also spreads load across the hour rather than hammering 77 endpoints at the top of the minute.

The other option is paying $5/month for the paid Workers plan, which lifts the limit to 1,000 subrequests. Will probably do that once AdSense approves.

The third bug: Cloudflare Pages deploy hooks don't work for direct upload

I wanted the static site to rebuild daily with fresh data. Cloudflare Pages has deploy hooks which are documented as a way to trigger rebuilds programmatically.

What the docs don't make clear: deploy hooks only work for git-connected Pages projects. My project was deployed via wrangler pages deploy dist/ (direct upload), which means there's no associated git repo, which means no deploy hook URL.

I figured this out after deploying the builder Worker with a triggerPagesDeploy() call that returned 404 every night.

The fix: GitHub Actions. The site repo lives on GitHub. A workflow runs at 15 2 * * * UTC (15 min after the builder rolls up daily data) and does:

- run: pnpm install
- run: pnpm redeploy
  env:
    CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    CLOUDFLARE_ACCOUNT_ID: 04200558cec0ac55884f5319f5ea0e17

Enter fullscreen mode Exit fullscreen mode

pnpm redeploy runs the Astro build (which fetches snapshot.json from the Builder Worker) then calls wrangler pages deploy. Direct upload, no git connection needed.

The other gotcha here: wrangler tries to enumerate accounts via /memberships if you don't set CLOUDFLARE_ACCOUNT_ID. That requires User:Read scope on the API token, which my deploy token didn't have (and shouldn't, for least-privilege reasons). Setting CLOUDFLARE_ACCOUNT_ID skips the lookup.

The $0 bill, in actual numbers

Service Used Free tier Headroom
Workers requests ~1,700/day 100,000/day 98%
D1 storage ~80 KB 5 GB 99.99%
D1 row reads ~10k/day 25M/day 99.96%
D1 row writes ~1,700/day 50,000/day 96%
Pages bandwidth minimal unlimited
GitHub Actions ~90 min/month 2,000 min/month 95%

The only resource I'm anywhere close to capping is the subrequest count per Worker invocation, which is a per-call limit, not a quota. The infrastructure can run at this scale indefinitely without paying anything.

I'd pay $5/month for Workers Paid once the site monetizes via AdSense (pending) or affiliate links (active). Until then, free tier is genuinely enough.

What I'd do differently if starting now

Open-source the repo from day one. I went private during AdSense review (their docs are paranoid about site changes during review). In retrospect this hurts community contribution — devs who'd suggest API additions can't see the seed file. Will flip public after approval.

Connect to GitHub before first deploy. Saves the direct-upload deploy-hook detour. If your Pages project starts git-connected, your daily rebuild can use a simple deploy hook URL instead of a GitHub Actions workflow.

Split the pinger from day one. Don't try to fit 77 subrequests into 50. Two cron triggers offset by 5 minutes is cleaner code and stays within free tier.

Validate response bodies, not just status codes. Right now I check status === 200. But some APIs return 200 with {"error": "key invalid"} in the body — they look alive but they aren't. Adding a JSONPath check per API would catch silent failures.

Where it stands

The site is a week old. Search Console is starting to index. AdSense is in review. The data is real — hourly checks, 30-day rollups, side-by-side comparisons, a graveyard of APIs that have died (Twitter v1.1, Dark Sky, Reddit's free tier, Yahoo Finance, MetaWeather, Weather Underground) with replacement suggestions for each.

If you build on free APIs, take a look: https://freeapi.watch. The data is also exposed as a public JSON API — no auth, CORS open, 5-minute edge cache. Embed status badges in your project READMEs if you want.

What I'd genuinely like feedback on:

  1. APIs I'm missing. The seed covers weather, news, finance, geocoding, and crypto. If your category isn't there and there are good free APIs in it, drop a comment with the docs URL.
  2. Edge cases in the monitoring. Have you seen APIs that return 200 with errors in the body? That's the silent-failure pattern I want to catch next.
  3. The pinger architecture. Splitting across two crons is the obvious next step but if you've solved 50+ subrequests differently I'd love to hear it.

If this was useful, let me know. If you spot something stupid in the architecture, also let me know — I'll fix it.