今日已更新 84 条资讯 | 累计 37333 条内容
关于我们

标签:#API

找到 517 篇相关文章

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

2026-08-29 原文 →
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

2026-08-29 原文 →
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

2026-08-29 原文 →
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

2026-08-29 原文 →
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

2026-08-28 原文 →
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 │ └─────────────────────┬─────────────────────┘ │ ▼ ┌───────────────────────────────────────────┐

2026-08-28 原文 →
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

2026-08-28 原文 →
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

2026-08-28 原文 →
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

2026-08-28 原文 →
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.

2026-08-28 原文 →
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

2026-08-28 原文 →
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.

2026-08-27 原文 →
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 ) -

2026-08-27 原文 →
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

2026-08-27 原文 →
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

2026-08-27 原文 →
AI 资讯

Stop rewriting your API responses in Laravel (Use this Trait instead)

If you are building API-driven applications, nothing clutters up your controllers faster than manually typing out response()->json(...) arrays every single time you need to return data or throw an error. When you have inconsistent response structures, your frontend (and the developers consuming your API) will constantly have to guess whether the data is nested under ['data'] , ['payload'] , or just at the root of the object. The cleanest way I've found to standardize this across an entire application is by creating a dedicated ApiResponse trait. Instead of rewriting your JSON structure in every controller method, create this trait in your app/Traits directory: namespace App\Traits ; use Illuminate\Http\JsonResponse ; trait ApiResponse { protected function success ( mixed $data , ?string $message = null , int $code = 200 ): JsonResponse { return response () -> json ([ 'status' => 'success' , 'message' => $message , 'data' => $data ], $code ); } protected function error ( string $message , int $code = 400 , array | string $errors = []): JsonResponse { // Force errors into an array format for consistent frontend parsing $formattedErrors = is_string ( $errors ) ? [ $errors ] : $errors ; return response () -> json ([ 'status' => 'error' , 'message' => $message , 'errors' => $formattedErrors ], $code ); } } Next, simply use this trait inside your base Controller.php . Now, your actual endpoints become incredibly readable and strictly standardized: namespace App\Http\Controllers ; use App\Models\Task ; use Illuminate\Http\Request ; use Illuminate\Http\JsonResponse ; use Throwable ; class TaskController extends Controller { public function store ( Request $request ): JsonResponse { $validated = $request -> validate ([ 'title' => 'required|string|max:255' , 'description' => 'nullable|string' ]); try { $task = Task :: create ( $validated ); return $this -> success ( $task , 'Task successfully generated' , 201 ); } catch ( Throwable $e ) { // Note: Exposing raw exception messa

2026-08-27 原文 →
AI 资讯

From Termux to a Freestyle VM: My Osintgram and HikerAPI Experiment

From Termux to a Freestyle VM: My Osintgram and HikerAPI Experiment After experimenting with Osintgram directly in Termux, I wanted to see how the same project behaved inside a Linux environment running through a Freestyle VM. The idea was not simply to reproduce the installation. I wanted to understand whether moving the project into the VM would make the HikerAPI troubleshooting any clearer. Why use a VM? Termux is capable of running many command-line tools directly on Android, but a VM provides a more conventional Linux environment. I connected to the Freestyle VM from Termux and worked with Osintgram from there. The project could start, but the API side still required investigation. The dependency confusion One of the first things I noticed was that there were multiple API-related components involved. I initially looked at the installed "hikerapi" package and its "Client" class. That alone wasn't enough to explain what Osintgram was doing. So I switched from inspecting only the Python environment to inspecting the project's source code. The HikerAPI-related code pointed me toward: src/hikercli.py This was much more informative because it showed where the client was being configured and how the access token entered the application. Checking the installed library I also checked the installed HikerAPI package rather than assuming I had the expected version. For example: python3 -m pip show hikerapi This let me verify the package that was actually installed in the VM. The important point here is that checking a package version and understanding how the application uses that package are two different troubleshooting steps. Separating authentication from Osintgram I found it useful to test the API independently instead of using Osintgram as the only diagnostic tool. For example: import requests headers = { "x-access-key": "YOUR_KEY" } r = requests.get( " https://api.hikerapi.com/v2/user/by/username?username=natgeo ", headers=headers ) print(r.json()) Again, "YOUR_KEY"

2026-08-27 原文 →
AI 资讯

I Reviewed 12 Free-Tier Integrations. The Same Six Myths Kept Appearing.

I Reviewed 12 Free-Tier Integrations. The Same Six Myths Kept Appearing. Last month I reviewed twelve integrations that used free model servers. All twelve carried the same wrong assumptions. None of them tested those assumptions. That's the real problem. Not the free tier. The mental model. How many of these myths do you believe? I believed all of them. Here's what the code told me. Disclosure: This article was prepared as part of MonkeyCode's product outreach. I use their free server option in side projects. The probe below works with any OpenAI-compatible endpoint, including theirs. The Six Myths Myth 1: "Free tier is just a demo" Teams treat free servers like toy boxes. They build demos, then throw them away. Evidence: three of the twelve integrations were internal tools in daily use. The free tier was the production environment. Nobody planned for that. Corrected mental model: free tier is a constraint, not a demo. If the tool survives, the constraint becomes your architecture. Design for it from day one. Myth 2: "A 200 means it worked" The most dangerous assumption. A 200 only means the HTTP layer succeeded. It says nothing about the content. I found empty completions, truncated JSON, and repeated boilerplate. All returned 200. All broke the caller. Corrected mental model: validate the payload, not the status code. Check schema, length, and content markers. Myth 3: "Retries are free" When a request fails, developers retry immediately. Then again. Then again. That's a retry storm. It amplifies load exactly when the server struggles. I saw one integration fire eleven requests in four seconds. Corrected mental model: retries are a queue, not a hammer. Use exponential backoff with jitter. Add a circuit breaker. Myth 4: "The model is the same everywhere" Free and paid tiers often serve different models. Or the same name with different behavior. You cannot assume. Evidence: two integrations hard-coded model names that no longer existed. Responses came back, but from

2026-08-26 原文 →
开发者

Day 7 & 8: Python Full Stack Development

Day 7 & 8 of learning Python Full Stack Development, yesterday and today I have started taking an notes for my project ideas and studying about API. As I'm going to started my project, reading some SRS, architecture and features involving in my project and side by side I was learning fastAPI

2026-08-26 原文 →