23 practical playbooks

Guides for the work between endpoints.

Selection, security, pagination, retries, verification, specifications, and change tracking.

Guide 01

How to choose a stock market data API

Turn a vague data wish list into a tested decision on coverage, adjustments, latency, rights, and total operating cost.

Guide 02

How to choose an LLM API

Select a model platform with a reproducible evaluation instead of chasing a leaderboard or a single token price.

Guide 03

How to handle API keys safely

Keep credentials out of source, clients, logs, and accidental blast radii with a practical key lifecycle.

Guide 04

How to implement REST pagination

Build one resilient iterator across page numbers, offsets, cursors, and next-link APIs without losing or duplicating records.

Guide 05

How to design API retries and backoff

Retry only recoverable failures, honor server signals, and prevent a transient outage from becoming a retry storm.

Guide 06

How to verify API rate limits

Record quota facts without turning a stale pricing table or old blog post into production truth.

Guide 07

How to consume an OpenAPI specification

Use an official API specification for discovery and validation without generating an unmaintainable wall of code or thin pages.

Guide 08

Gemini API thought_signature 400: preserve parallel function-call history

A reported Gemini 3 Flash Preview 400 came from splitting parallel function calls into separate model history entries. Keep the original response grouping and signature position.

Guide 09

Massive (Polygon) missing minute bars: check limit and trade conditions

Missing Massive minute bars can reflect a base-aggregate limit or no eligible trades. Finish pagination, then inspect trades and conditions for the exact minute.

Guide 10

EODHD missing dividend data: handle delayed updates and cache refreshes

A successful dividend request can still return an incomplete observation. Reusing that observation for seven days can hide a later update; scheduled collection needs a fresh observation and explicit coverage limits.

Guide 11

SEIBRO dividend API pagination: reconcile count and collected rows

Receiving the last nonempty page is not enough to prove a dividend window is complete. Pin the count, validate page coverage and duplicates, and refuse an unstable window before confirming financial facts.

Guide 12

ECOS exchange rate API: prevent selecting a non-USD currency

Valid ECOS JSON can still be interpreted as the wrong currency. Select and validate the USD item explicitly; never turn the first row into a compatibility fallback when the expected currency is absent.

Guide 12

yfinance missing Adj Close: check auto_adjust and MultiIndex columns

A missing Adj Close and unexpected tuple columns can both follow yf.download defaults. Set adjustment and column shape explicitly before reading a price series.

Guide 13

EODHD Korean dividend date gaps: route KR events to SEIBRO

EODHD support identified a Korean .KO date-field coverage limit: ex-date and amount are supplied, while declaration, record and payment dates are not. Route KR dividends to confirmed SEIBRO events; keep EODHD for the US dividend path and avoid cross-source field grafting.

Guide 13

LLM API retries and fallback: avoid applying timeout budgets twice

A fallback chain must spend one request budget. Giving every retry and provider a fresh timeout can multiply latency, especially when application retries are combined with SDK retries.

Guide 14

LLM structured output: preserve response_format through fallback

An adapter that accepts response_format but drops it can silently turn a structured request into free text. Fallback must preserve the same output contract or explicitly refuse the request.

Guide 15

Alpaca recent SIP error: delayed history and explicit IEX coverage

Alpaca Basic can reject recent SIP requests. Choose a historical SIP window outside the restricted interval, or explicitly accept IEX-only coverage before changing feeds.

Guide 18

OpenAI Responses commentary parsing: select final structured output

A completed response can contain commentary before valid final JSON. Older Python SDK parsing can reject the commentary or return it as the structured result; the phase-aware fix preserves commentary while selecting eligible final output.

Guide 19

Anthropic Claude mixed-tool results: avoid premature-turn 400 errors

A missing server result in a mixed Claude tool response can be deferred, not lost. Continue with every client result, preserve tool definitions and correlate later results by ID before treating the turn as complete.

Guide 20

yfinance repair price units: verify pence and pounds before FX

Repair can expose a quotation-unit mismatch before FX valuation. Separate the documented restoration fix from unmerged follow-up work, and normalize only with verified history currency.

Guide 21

OpenAI Responses lost instructions: resend policy on each turn

Chaining response context does not reapply the preceding top-level instructions. Put stable policy in every request and verify the actual payload before blaming the model or switching plans.

Guide 22

Alpaca get_all_assets TXSE validation error: check the SDK enum and release

An unfamiliar exchange value can reject an entire typed asset list. Preserve the raw catalog, expose unsupported values and verify the installed release instead of treating a closed issue as a shipped fix.

Guide 23

DeepSeek Search 401 with a chat proxy: separate tool credentials and endpoints

A working chat route does not validate the credential for a separate search service. Bind each tool to its intended origin and credential issuer before retrying or enabling automatic search.