AI 资讯
When HTTP Retries Become Dangerous: Idempotency in Symfony Without the Fairy Tales
Retries are one of those things that look harmless until the first time they duplicate a real business operation. A request times out, so the client retries it. Reasonable. But what if the first request actually reached the server? What if the application already created the order, reserved the stock, sent the message, or called a payment provider — and only the response was lost? From the client's point of view, the request failed. From the application's point of view, it may already be finished. Send the same request again and you can get the worst kind of bug: one that is technically understandable, difficult to reproduce, and very expensive in production. This is the problem that pushed me to build HttpIdempotencyBundle , a small Symfony bundle for explicit HTTP request idempotency. But the interesting part is not the bundle itself. The interesting part is everything that has to be true before we can safely say: "This request is a retry of the same operation, so we should not execute it again." And just as importantly, what we cannot guarantee. A timeout does not mean the operation failed Consider a simple endpoint: #[Route('/orders', methods: ['POST'])] public function createOrder (): JsonResponse { $order = $this -> orderService -> create (); return new JsonResponse ([ 'id' => $order -> getId (), ], 201 ); } Now imagine this sequence: Client -> POST /orders Server -> creates order #742 Server -> sends 201 response Network -> connection dies Client -> sees timeout Client -> retries POST /orders Nothing unusual happened. The client did exactly what clients often do after a timeout. The server did exactly what it was asked to do. And yet, unless we have another mechanism in place, we may now create order #743 as well. The key idea is simple: transport failure and business-operation failure are not the same thing. HTTP cannot always tell the client whether the operation happened. Give the operation an identity A common solution is an Idempotency-Key . The client g
AI 资讯
Live API specs for coding agents
Live API specs for coding agents An agent writing frontend code has to know the backend's API. It has three options. It can read the backend source and work out from scratch what the service already publishes. It can ask you, which promotes you to API documentation. Or it can swallow the entire OpenAPI document in order to use one route out of it. Then it does the same thing again tomorrow, against a stale swagger.json you exported last week. docs-mcpserver takes the spec straight from the running service, caches it, and serves it one operation at a time. The config { "cacheDir" : "./cache" , "libraries" : [ { "name" : "orders-api" , "description" : "Order handling service" , "sources" : [ { "type" : "url" , "origin" : "https://localhost:5001/openapi/v1.json" , "kind" : "schema" , "name" : "orders" } ] } ] } npm install -g docs-mcpserver claude mcp add docs -- docs-mcpserver --config /path/to/dev-docs.json That is the whole setup. One operation, not the whole spec The agent lists the definitions in orders , picks the one it needs, and fetches that. For an OpenAPI document the path operations are exposed as definitions named GET /orders/{id} , so it can also search by keyword. A few hundred tokens for the operation it is writing against, instead of the entire document. That keeps working as the service grows, which a pasted spec does not. The backend does not have to be running Every call is answered from the cached spec, never from the network. The fetch happens on startup and then in the background while you work, so an endpoint you added 20 seconds ago is already visible. Start the backend once, shut it down, and keep building the frontend. The agent still has real routes and real payload shapes. If the service is down, or answers with something that is not a spec, the last known-good copy keeps being served. Code and issues: github.com/jgauffin/dev-docs-mcp . On npm as docs-mcpserver .
AI 资讯
Building a Vedic Astrology API: thread-local bugs, 1,500-year-old test fixtures, and a 429 disguised as CORS
Astrology apps are one of India's quietest huge markets — panchang widgets, kundli generators, matrimonial matching, muhurta pickers. Under every one of them sits the same unforgiving requirement: the astronomy has to be exactly right , because your user's grandmother has a printed panchang on her wall and she will check. I spent the last few months building GrahaAPI — 237 REST endpoints across 23 modules of Vedic astrology, Hindi + English in every response. This post isn't a feature tour. It's the four engineering problems I didn't expect, because I think they're interesting even if you never touch astrology. First, 60 seconds of domain: what the computer actually calculates Strip away the mysticism and Vedic astrology is a coordinate system plus 1,500 years of lookup tables: Tithi (the "lunar date"): the Moon-Sun angular separation, divided into 12° slices. 30 per lunar month. Nakshatra : which of 27 equal 13°20′ segments of the ecliptic the Moon occupies. Dasha : a 120-year planetary period cycle, seeded entirely by the Moon's exact position at birth — a birth-time error of minutes shifts period boundaries by months . The whole thing runs on the sidereal zodiac, offset from the tropical zodiac by ~24° (the ayanamsa — we use Lahiri, the Indian government standard). So: an ephemeris gives you planetary longitudes, and everything else is careful classical bookkeeping. Which brings me to the first bug. Bug #1: the thread-local zodiac Our ephemeris core is a C library with Python bindings, and it holds "which zodiac mode are you in" as global state — per thread . FastAPI runs sync endpoints on a threadpool. First request warms up thread A: sidereal mode set, positions correct. Then a request lands on freshly-spawned thread B: mode silently defaults to tropical , every longitude comes back ~24° off, and — because 24° is almost exactly one nakshatra-and-a-bit — the Moon lands in a plausible but wrong nakshatra. Which seeds the dasha. Which means the API happily returne
AI 资讯
A versão de API que vence sem avisar
Um script meu que publicava conteúdo via API do LinkedIn parou de funcionar do nada. Nenhuma linha mudou. O erro voltou assim: { "status" : 426 , "code" : "NONEXISTENT_VERSION" , "message" : "Requested version 20250601 is not active" } Não tinha bug de código nenhum. A versão da API que eu tinha fixado no script simplesmente saiu da janela de suporte. Como uma API versionada por data quebra sozinha A API REST do LinkedIn exige um cabeçalho LinkedIn-Version no formato ano-mês, tipo 202506 . Isso não é um número de versão semântica que você escolhe uma vez e esquece. É uma janela de tempo. Passado um certo período, aquela versão sai de circulação e a API recusa a chamada, mesmo que o resto do payload esteja perfeito. O código nunca mudou entre o dia em que funcionava e o dia em que parou. O relógio do calendário é que mudou. Por que isso engana quem debuga O reflexo natural ao ver um erro de API é revisar o código: campo errado, token expirado, permissão faltando. Nenhuma dessas hipóteses batia. O token era válido, os escopos estavam certos, o payload era idêntico ao de uma chamada que tinha funcionado antes. A mensagem de erro ajudou bastante aqui, porque nomeou exatamente o campo problemático ( Requested version 20250601 ) e o motivo ( is not active ). Sem prestar atenção nela e ir direto pro código, essa causa levaria muito mais tempo pra aparecer. A correção Trocar o valor fixo do cabeçalho pela versão atual, no mesmo formato ano-mês. Nada mais no código precisou mudar. O detalhe que fica de lição: esse valor não é constante de verdade, é uma data disfarçada de configuração. Documentei isso direto no comentário ao lado da constante, pra próxima vez que o mesmo erro aparecer a causa já estar escrita ali, em vez de descoberta de novo do zero. A lição Nem todo bug tem código culpado. Uma integração que depende de versão de API, certificado, ou qualquer coisa com data de validade pode quebrar sem que uma única linha do seu sistema tenha mudado. Antes de caçar bug no p
AI 资讯
Find the cheapest day to fly with a Google Flights price tracker (Python + n8n)
Google Flights has a date grid with a fare for every departure day, and a "track prices" toggle that emails you when its pick of dates moves. Both are fine for one trip. Neither gives you the table: every day, the fare, the airline and stops behind it, in rows you can sort, keep and put a threshold on. If your dates are flexible and you want the cheapest day to fly as data — or airfare price tracking that runs every morning — you need rows. This is how to get one row per departure day from Google Flights as JSON, with no API key (there is no public Google Flights API), and how to turn it into a flight price alert. 1. One request, one row per day The Flight Price Tracker on Apify takes routes, a first departure day and a window length. For each day it searches Google Flights, keeps that day's cheapest itinerary and ranks the days. A 30-day window on one route is at most 30 fare rows plus a free status row. curl -X POST "https://api.apify.com/v2/acts/kestrel~flight-price-tracker/run-sync-get-dataset-items?token= $APIFY_TOKEN " \ -H "Content-Type: application/json" \ -d '{"routes": ["LIS-LHR"], "departDate": "2026-10-05", "days": 30, "adults": 1, "currency": "USD", "market": "us"}' A fare row: { "type" : "fare" , "route" : "LIS-LHR" , "trip" : "one_way" , "depart_date" : "2026-10-05" , "return_date" : null , "seat" : "economy" , "adults" : 1 , "currency" : "USD" , "price" : 127 , "price_display" : "127 US dollars" , "airline" : "Tap Air Portugal" , "stops" : 0 , "depart_time" : "8:00 PM" , "arrive_time" : "10:55 PM" , "duration" : "2 hr 55 min" , "duration_minutes" : 175 , "layovers" : null , "co2_kg" : 123 , "itineraries_seen" : 12 , "cheapest_in_window" : true , "rank_in_window" : 1 , "google_url" : "https://www.google.com/travel/flights?tfs=..." , "fetched_at" : "2026-08-29T06:25:14+00:00" } cheapest_in_window is true on exactly one day per route; rank_in_window orders the rest. The free status row repeats the headline as cheapest and cheapest_date , with days_searc
AI 资讯
Hotel price tracking with Google Hotels data: an API in 10 minutes (Python + n8n)
Google Hotels already compares every booking site for a hotel and a stay — Booking.com, Expedia, Agoda, Hotels.com and the hotel's own site. It has a "track prices" button too, but it emails you on its own terms, picks the sources, and keeps the history. If you want the numbers — for a trip, a rate parity check, or a price history chart — you need them as rows. This is how to get Google Hotels prices for exact dates as JSON, without a Google API key (there is no public Google Hotels API for reading prices; the official Hotel APIs are feeds for hotels sending prices to Google), and how to turn that into daily hotel price tracking. 1. One request, every booking site's rate The Google Hotels Prices Scraper on Apify takes a place search or a list of hotels, a stay, occupancy and currency, and returns three row types: hotel (lowest nightly rate + stay total), offer (each source's rate, free‑cancellation flag, deep link) and status . You pay per priced row; sold‑out hotels and empty searches are free. curl -X POST "https://api.apify.com/v2/acts/kestrel~google-hotels-prices/run-sync-get-dataset-items?token= $APIFY_TOKEN " \ -H "Content-Type: application/json" \ -d '{"queries": ["hotels in Lisbon"], "checkIn": "2026-10-03", "checkOut": "2026-10-06", "adults": 2, "currency": "USD", "maxHotels": 20}' A hotel row looks like this: { "type" : "hotel" , "name" : "The Central House Lisbon Baixa" , "check_in" : "2026-10-03" , "check_out" : "2026-10-06" , "nights" : 3 , "nightly" : 81.81 , "nightly_display" : "$82" , "total" : 245 , "stars" : 2 , "rating" : 4.3 , "reviews" : 727 , "deal" : "19% less than usual" , "entity_id" : "ChkIg-b2ismUj7M1Gg0vZy8xMWg3MThreGg1EAE" , "google_url" : "https://www.google.com/travel/hotels/entity/ChkI…" } and an offer row (with "includeOffers": true ): { "type" : "offer" , "name" : "Hyatt Regency Lisbon" , "source" : "Booking.com" , "official" : false , "nightly" : 569.35 , "total" : 1708.05 , "free_cancel" : true , "free_cancel_until" : "Oct 1" , "p
AI 资讯
Mapping API Path, Query, Header, and Body Parameters to MCP Tool Schemas
An API operation can receive input from several places. Path parameters identify the record. Query parameters filter or paginate the result. Headers carry metadata or authentication. The request body contains structured data for create and update operations. An MCP tool should give the AI client one clear input schema. That is the mapping problem: HTTP API inputs path + query + headers + body become MCP tool input one structured schema the AI client can understand This tutorial walks through that mapping with practical examples. The goal is to make the tool easy for an AI client to call without hiding the real API contract. Example API operation Imagine a project-management API with this endpoint: PATCH /workspaces/{workspace_id}/projects/{project_id}/tasks/{task_id} It updates one task. The API accepts: path parameters for workspace_id , project_id , and task_id ; query parameters such as notify_assignee ; a request body with the fields to update; authentication through a Bearer token header; an optional request header such as Idempotency-Key . A shortened OpenAPI-style version might look like this: paths : /workspaces/{workspace_id}/projects/{project_id}/tasks/{task_id} : patch : operationId : updateTask summary : Update a task description : " Update the title, status, assignee, or due date for one task." parameters : - name : workspace_id in : path required : true schema : type : string - name : project_id in : path required : true schema : type : string - name : task_id in : path required : true schema : type : string - name : notify_assignee in : query required : false schema : type : boolean default : false - name : Idempotency-Key in : header required : false schema : type : string requestBody : required : true content : application/json : schema : type : object properties : title : " " type : string status : type : string enum : [ todo , in_progress , blocked , done ] assignee_id : type : string due_date : type : string format : date minProperties : 1 securi
AI 资讯
I Built an API Because My Government’s Website Got the Date Wrong (and Just… Deleted It)
There’s a funny (and slightly sad) story behind why I built mabims.dev . It started with a date. More specifically, a Hijri date . Once Upon a Time, the Government Website Had the Date For a long time, Indonesia’s Ministry of Religious Affairs (Kemenag) website displayed the current Hijri date. It was convenient. You opened the website, looked at the corner of the page, and there it was: Today: 30 Sha'ban Simple enough. A lot of people, including me, got used to relying on it. Then one day, something weird happened. A post went viral. Someone noticed that the official calendar published by Kemenag said one date , while the date displayed on Kemenag’s own website said the next day . They were off by one day. People started asking: How can the official website and the official calendar disagree with each other? The post spread. People discussed it. And then… The Solution? Just Delete It. I didn't know what exactly happened behind the scenes. Maybe it was a bug. Maybe it was a calculation issue. Maybe the website was using a different data source. I don't know. But I do remember what happened eventually. The Hijri date disappeared from the website. Problem solved. Technically. If you can't display the wrong date, you can't display a wrong date. Elegant. 😂 At the time, I just thought it was funny. A few years later, I became a developer. And suddenly, the story made a lot more sense. Years Later, I Became a Junior Developer Once I started working as a developer, I learned how easy it is to add a Hijri date to a website. You don't need to calculate the lunar calendar yourself. You just install a library. Or call an API. There are plenty of them. The problem is that most of the libraries and APIs you'll find use Umm al-Qura by default. And that's perfectly reasonable. Umm al-Qura is the official calendar of Saudi Arabia. It's well documented, widely supported, and easy to integrate. For a developer who just wants: Gregorian date → Hijri date it works great. But there's a
AI 资讯
[AI in Practice] Gemini 3.5 Transcribe: Real-time Transcription and Speaker Diarization in a macOS Meeting Translation App
Previously I have a macOS App I use myself, gemini-live-translate-macos . It uses ScreenCaptureKit to directly capture audio from a specified App, eliminating the need for virtual sound cards like BlackHole. It then sends the audio to the Gemini Live API for real-time translation, outputting Traditional Chinese subtitles while playing Chinese audio. I've written two posts about the development process: the first one was about building it from scratch using AGY CLI, and the second one was about using Claude Code to take it from "functional" to "user-friendly." The starting point for this new addition was simple: I saw a document for "Real-time Transcription" added to the Live API. Since I was already connected to the Live API, I thought adding a pure transcription mode would just be a matter of changing a few parameters. However, after checking the documentation, I realized that Google released two models with very similar names but very different capabilities at once. The specific feature I actually wanted (speaker diarization) wasn't available at all on the model I originally thought it was. Two Models with Names Differing by Only Two Words Let's lay out the differences first; this is the part I spent the most time figuring out: gemini-3.5-transcribe-live gemini-3.5-transcribe API Used Live API (WebSocket streaming) Interactions API (Standard HTTP request) Usage Scenario Transcribe while speaking Upload the whole file after recording Speaker Diarization Not supported Up to 8 speakers Word-level Timestamps Not supported Supported Audio Length 10 minutes per session 1 hour (30 mins with diarization) Smart Mode SMART available smart is mutually exclusive with diarization Interim Subtitles Has interimInputTranscription Not applicable The official documentation on the Live page's limitations section is very blunt: Speaker diarization is not supported in live streaming sessions. For speaker diarization, use the non-streaming Audio transcription endpoint. So, "seeing who
AI 资讯
Building an Enterprise Football Data Pipeline: Decoding Flashscore's Protocol for xG & Referee Analytics
Most football data scrapers on the market only extract high-level final scores (e.g. 2-1 ). But quantitative sports analysts, data scientists, and predictive betting modelers need granular data: Expected Goals (xG) , Official Referee Assignments , Goal Scorers paired with Assist Providers , and Half-Time vs Full-Time (1H/2H) statistical breakdowns . When I set out to build a professional-grade Flashscore scraper on Apify, I ran into two major engineering challenges: The Memory Problem : Keeping Puppeteer running to scrape hundreds of historical matches consumes over 1.5GB of RAM per run. The Protocol Problem : Flashscore serves its deep statistical feeds using a proprietary pipe-delimited data format ( ~ , ¬ , ÷ ) over CDN endpoints, rather than standard REST APIs. In this tutorial, I'll explain how I engineered the Flashscore Elite Statistics Extractor , how the hybrid Browser + HTTP/2 streaming pipeline drops RAM footprint from 1.5GB to 70MB , how to parse Flashscore's custom feed protocol, and how to pipe the resulting datasets directly into Python and Pandas. 🏛️ The Hybrid Pipeline Architecture To achieve zero proxy reliance for standard runs and ultra-low compute costs, the Actor splits execution into a 2-Phase Hybrid Pipeline : [ League & Season Selection ] │ ▼ ┌───────────────────────────────────────────┐ │ Phase 1: Browser Handshake (Puppeteer) │ │ - Captures x-fsign security tokens │ │ - Extracts countryId & tourId │ └─────────────────────┬─────────────────────┘ │ [ Immediate Browser Shutdown ] (RAM drops from 1.2GB -> 70MB) │ ▼ ┌───────────────────────────────────────────┐ │ Phase 2: Parallel HTTP/2 Feed Workers │ │ - got-scraping with JA3 TLS matching │ │ - Decodes df_st_1_ (Stats) & df_sui_1_ │ └─────────────────────┬─────────────────────┘ │ ▼ ┌───────────────────────────────────────────┐ │ Self-Healing Recovery Pass │ │ - Auto-retries skipped/failed matches │ └─────────────────────┬─────────────────────┘ │ ▼ ┌───────────────────────────────────────────┐
AI 资讯
Chinese LLM API Pricing Comparison 2026: The Definitive Buyer's Guide
If you're shopping for LLM APIs in 2026, Chinese vendors are impossible to ignore. As of August 21, 2026 (always check official pricing pages for the final word), flagship Chinese models charge between ¥4.00 and ¥12.00 per million input tokens — with ERNIE 5.1 at ¥4.00, GLM-5.1 at ¥6.00, Kimi K2.6 at ¥6.50, DeepSeek V4 Pro at ¥9.00, and Qwen3.7 Max at ¥12.00. Budget-tier input can be as low as ¥0.20 (Qwen3.5 Flash), and value models like DeepSeek V4 are 80–98% cheaper than GPT-5.5-class peers. But don't pick a model on sticker price alone. Cache hit rates, endpoint access, and tool-calling fit often matter more than nominal list prices. The data below was verified against official pricing pages by llmabacus on 2026-08-21. Chinese vendors have turned quarterly price cuts into a structural competitive weapon: DeepSeek V4 Flash, for example, offers cached input at ¥0.10 per million tokens — just 1/30th of its standard input price. 2026 Chinese LLM API Pricing Landscape: An Overview The 2026 Chinese LLM market is shaped by three forces: Hardware cost deflation — cheaper compute keeps pushing prices down. Escalating domestic price wars — vendors undercut each other every quarter. Aggregator endpoints — services that arbitrage price gaps and unify access. As of Aug 2026, tracking firm pricepertoken lists 610+ models globally, 43 of them free. Paid input prices range from roughly $0 to $150 per million tokens. Chinese vendors sit in the lowest price band, and many update prices quarterly — as Morph noted in its 2026-06-28 analysis: "LLM prices change every quarter." Final prices are subject to each vendor's official pricing page: DeepSeek Alibaba Cloud Bailian/Qwen Moonshot/Kimi Zhipu GLM Baidu ERNIE Tencent Hunyuan The main camps remain unchanged: DeepSeek and Alibaba's Qwen dominate the extreme value tier. Kimi (Moonshot) differentiates on ultra-long context. GLM (Zhipu) , Doubao , and Tencent Hunyuan serve the domestic enterprise market. OpenAI , Claude , and Gemini hol
AI 资讯
Polymarket TWAP60 vs Kalshi: Why Settlement Design Decides Your Bot (Series 1/4)
GitHub: https://github.com/abrownfox0/abrownfox001-twap60-prediction-trigger-system YouTube walkthrough: https://www.youtube.com/watch?v=XzhugRL6BV4 This is a new 4-part series comparing the two venues that actually matter for short-horizon BTC direction: Part 1 — Settlement design: Polymarket TWAP60 vs Kalshi 60s average (this post) Part 2 — Product shape: 5-minute specialist vs 15-minute regulated stack Part 3 — What a directional bot must change when crossing venues Part 4 — Where edge survives, and where it dies Live profile: @abrownfox001 The Real Split Is Not “On-Chain vs Regulated” People compare Polymarket and Kalshi as if the important difference is KYC, geography, or chain vs centralized matching. For a short-horizon BTC bot, those matter later. The first difference is simpler: What exact number decides Up vs Down? If you get that wrong, every signal, backtest, and scratch rule is solving the wrong problem. Two Venues, Two Official Averages Both platforms moved away from “whatever the last print was.” Both now settle short BTC contracts on a one-minute average . They do not use the same average. Polymarket crypto Up/Down Kalshi BTC short contracts Shortest liquid product 5-minute Up/Down 15-minute Up/Down ( KXBTC15M ) Settlement idea Time-weighted average 60-second simple average Official source Chainlink TWAP CF Benchmarks Real-Time Index (BRTI family) Window 60 seconds for current 5m / 15m / 4h crypto Final 60 seconds before close , sampled ~1s Open reference Matching TWAP at slot start Strike / floor set by the contract Feed path for bots Polymarket RTDS or Chainlink Data Streams Kalshi market fields + CF Benchmarks index Market structure On-chain CLOB Centralized CFTC-regulated exchange Same word — “60-second average.” Different index. Different sampling. Different product clock. Why Both Platforms Converged on 60 Seconds Snapshot settlement created the same failure mode everywhere: A brief push into one venue’s book A wick at the exact close Retail on
AI 资讯
Implementing SMS Delivery Status Polling for Restaurant Waitlist Outage Alerts
Short answer: Choose an SMS API for critical outage alerts only if your backend can poll delivery status and own retry, escalation, cancellation, and timing logic; for restaurant waitlist updates, treat the provider as a delivery transport rather than as the incident workflow itself. The deciding constraint is delivery reliability. Sending a message is the easy part; deciding whether an unresolved alert should be polled again, resent, escalated through another channel, or canceled after recovery is where the application earns its reliability. An API that can send, expose status and events, resend, and cancel covers those transport mechanics. Without webhook pushes, however, the backend must run polling frequently enough for its actual alert deadline. This is a conditional yes, not a blanket recommendation. Timing dominates. How should you choose an SMS API for critical outage alerts? Start with an explicit service-level objective for the restaurant workflow. A waitlist delay notice might tolerate a polling interval that a critical app outage alert cannot. Write down the maximum time from initial send to the next decision, the point at which another attempt becomes stale, and the moment when recovery must suppress queued or repeat messages. If those values are missing, comparing provider feature lists produces a confident-looking choice with no reliability argument behind it. Four invariants matter here. Every accepted send needs an application-owned identifier; every retry must be bounded and idempotent; every delivery state must lead to a defined next action; and incident recovery must stop obsolete alerts. SMS cancel support helps with the last invariant, but cancellation is not permission to ignore timing: the application still has to notice recovery and issue the decision promptly. There is a hard boundary. No webhook event push means that delivery updates arrive only when the application asks for them, so a ten-second polling job cannot support a five-second es
AI 资讯
I built an open-source directory of 50+ free public APIs with daily automated health-checks
Hey everyone! 👋 Finding reliable, free public APIs for side projects or learning is always a hassle because many listed APIs eventually go down or become paid. To solve this, I created Awesome Free APIs Live — an open-source, curated collection of 50+ free public APIs across AI, developer tools, security, and open data. ⚙️ How It Works Daily Health Checks: Powered by GitHub Actions , an automated script tests endpoints daily and updates live status badges. Zero Dead Links: Broken endpoints are flagged automatically so developers don't waste time debugging dead services. Categorized & Searchable: Clean, categorized UI hosted on GitHub Pages. ### 🔗 Links 🌐 Live Directory: shilpshakti.github.io/awesome-free-apis-live ⭐ GitHub Repository: github.com/ShilpShakti/awesome-free-apis-live Contributions are very welcome! If you know of any great free APIs, feel free to open a PR or check out the open issues on GitHub.
AI 资讯
Webhooks vs Polling: Why Real-Time Integrations Matter in 2026
Webhooks vs Polling: Why Real-Time Integrations Matter in 2026 In modern software, knowing that something happened is often just as important as knowing what happened. A customer completes a payment. An order changes from pending to shipped. A user creates an account. A GitHub pull request is opened. A subscription is renewed. An AI workflow needs to start processing a new request. The question is simple: How does your application know that something changed? For years, developers have relied on two common approaches: polling and webhooks. Both solve the same fundamental problem—keeping systems synchronized—but they do it in completely different ways. Polling repeatedly asks an API whether something has changed. Webhooks allow the external system to notify your application when something actually happens. That difference can have a major impact on performance, scalability, API usage, responsiveness, reliability, and overall system architecture. And as applications become increasingly connected in 2026, understanding when to use each approach is more important than ever. What Is Polling? Polling is the traditional approach to checking for changes. Your application periodically sends a request to another system: “Has anything changed?” For example, imagine an e-commerce application that needs to know when an order has been paid. It might call an API every 30 seconds: GET /orders/12345 The response might say: status: pending Thirty seconds later, the application asks again. Then again. And again. Eventually: status: paid The application finally discovers that the payment has been completed. The basic workflow looks like this: Application → API → “Anything new?” API → Application → “No.” Thirty seconds later: Application → API → “Anything new?” API → Application → “No.” Eventually: Application → API → “Anything new?” API → Application → “Yes, the order has been paid.” The approach is straightforward and easy to understand. But there is a problem. Most of those requests
AI 资讯
A Self-Correcting Solar System Baseline From Sunrise/Sunset Data
A fixed-schedule solar baseline drifts out of sync with the sun throughout the year. In Phoenix the sun is up for 13 hours 10 minutes in late August and 10 hours 2 minutes at the December solstice. A flat daily kWh target flags that entire winter as a fault, then stays quiet on the July afternoon when one string dies at 2pm under full sun. The fix is to anchor the baseline to the actual sun instead of the clock, and most of what you need for that does not require an irradiance forecast. One thing before any code: sun geometry tells you when a system should be producing and when it should peak. It does not tell you how much light actually reached the panels. That is irradiance, and cloud cover swamps it. If you want modeled output in kWh, reach for Forecast.Solar or Solcast, which fold in weather and your array's tilt and azimuth. What follows is the free, dependency-light layer underneath that: the daylight window, the solar-noon peak, and the day-length trend. TL;DR Sun geometry (sunrise, sunset, solar noon, day length) catches a specific class of solar underperformance with no irradiance data. Gate alerts to the real daylight window so your monitor stops crying "underperformance" before sunrise. Track the daily production peak relative to solar noon. A persistent shift across comparable days can reveal shading, orientation, or system changes that a total-kWh check misses. Normalize a flat kWh target by day length so winter stops tripping false alarms. First-order fix, not a physics model. One call to an astronomy endpoint returns all of it. Code below in curl, Python, and Node. For real production forecasting, use an irradiance API. Sun times are the sanity layer, not the forecaster. Sun times will not predict your kWh, but they eliminate common timing-based false alarms and can surface useful production-shape anomalies early. Pull sunrise, sunset, solar noon, and day length once a day, gate your alerts to daylight, watch the peak, and scale the target for season.
AI 资讯
Build a caption QA harness in Python: WER, missed entities, timing and reading rate
TL;DR We're building a caption evaluation harness that scores a WebVTT file on four axes instead of one: word error rate under a fixed normalizer, missed entity rate on domain terms, median cue timing offset, and reading rate in characters per second. Python 3.12, jiwer , whisper_normalizer , webvtt-py . Run it on every model or vendor change. A caption file can score 96% accurate and still be unusable. WER counts substitutions, insertions and deletions and weighs each one the same, so "fifteen milligrams" becoming "fifty milligrams" costs exactly as much as "the" becoming "a". It also throws away every timestamp before it starts, which means synchronization and readability are invisible to it. Let's measure the other three things. 0. Setup 🛠️ python3 -m venv .venv && source .venv/bin/activate pip install jiwer whisper_normalizer webvtt-py $ pip list | grep -Ei 'jiwer|whisper|webvtt' jiwer <your version> webvtt-py <your version> whisper-normalizer <your version> Pin whatever you install, and pin it in CI. The APIs below move between majors, which is exactly why the next tip exists. 💡 Tip: jiwer.compute_measures() is gone in recent versions. It is jiwer.process_words() now, and it returns a WordOutput dataclass. Most blog posts you will find still use the old name. 1. Parse the VTT into text plus timings # captions.py from dataclasses import dataclass import webvtt @dataclass class Cue : start : float end : float text : str @property def duration ( self ) -> float : return self . end - self . start @property def lines ( self ) -> list [ str ]: return self . text . split ( " \n " ) @property def flat ( self ) -> str : return " " . join ( l . strip () for l in self . lines ) @property def chars_per_second ( self ) -> float : return len ( self . flat ) / self . duration if self . duration > 0 else float ( " inf " ) def _to_seconds ( ts : str ) -> float : h , m , s = ts . split ( " : " ) return int ( h ) * 3600 + int ( m ) * 60 + float ( s ) def load_vtt ( path : str ) -
AI 资讯
I Built a GTM Research Workflow with One Vaaya API Key
I wanted to see how far I could take a simple idea: Give an agent one API key and let it handle the different pieces of company research. So I built GTM Radar . You paste a company URL, and it turns that into a structured GTM brief instead of making you jump between different research and data tools. What GTM Radar does The workflow currently generates five main sections: Overview — company description, industry, size, location and website Structure — departments and key people Market — signals, competitors and positioning People — who might be relevant to reach and why Outreach — why now and a possible angle The goal is simple: go from company URL → useful GTM context as quickly as possible. Why Vaaya? The interesting part for me was being able to connect several providers through Vaaya rather than integrating each one separately. The workflow currently uses: Firecrawl · Exa · Akta · OpenFunnel · OneFind through a single Vaaya key. Vaaya's API provides a common interface for its catalog, so the workflow can call different services using the same API authentication and request pattern. It also supports cost limits and only charges successful calls. That made experimenting with different providers much easier. The workflow At a high level: Company URL ↓ Company discovery / extraction ↓ Company + market research ↓ People & GTM signals ↓ Structured GTM brief ↓ Share / copy / reuse The interesting part isn't any individual API call. It's combining several data sources into something that is actually useful to a person doing GTM research. Handling failures Real-world data workflows don't always return clean results. For extraction, I added a fallback path so that if the first provider doesn't work, the workflow can try another route instead of immediately failing. The current flow is roughly: CRW ↓ Firecrawl scrape ↓ CRW fallback I also added cost-capped runs and a 12-hour cache to avoid unnecessary repeated work. Sharing the research The latest thing I added was Share I
AI 资讯
A Practical Pattern for Giving AI Agents Access to External APIs with MCP
Connecting an AI agent to one API is straightforward. Connecting it to many changing APIs—without filling the model context with hundreds of tool definitions—is a different problem. Disclosure: This article was prepared for QVeris and uses QVeris as the implementation example. This tutorial presents a practical pattern for developers building agents that need current external data: discover → inspect → probe → call . Instead of exposing every possible operation up front, the agent discovers the capabilities relevant to the current task, verifies the selected tool, validates its inputs, and only then executes it. TL;DR: Keep the agent's initial tool surface small. Let it discover a capability by intent, inspect the exact schema, probe the request without execution, and make a real call only after the parameters and expected cost are understood. Contents Why a large static tool list becomes difficult The four-step capability workflow Connecting a hosted MCP server A concrete example Production checklist Why a large static tool list becomes difficult An agent connected directly to several providers may need to understand different authentication schemes, parameter conventions, response formats, and error behaviors. Loading every operation into context can also make tool selection less reliable. Model Context Protocol (MCP) provides a standard way for clients to connect to tools and data sources. The protocol solves the connection boundary, but developers still need a strategy for controlling how many capabilities the model sees and when execution is allowed. A compact routing layer is useful when: the agent needs data from multiple API providers; the appropriate provider depends on the user's request; schemas or available operations may change; calls can consume credits or trigger rate limits; you want to validate inputs before executing a paid operation. The four-step capability workflow 1. Discover The agent starts with a natural-language description of the capabilit
AI 资讯
The agent posted successfully. To the wrong account.
Back in July I wrote about what it takes to wire an AI agent into social platforms: six OAuth flows,...