Practical writing about consuming APIs. Every article is grounded in requests we actually made, with the dates we made them, rather than in a rewrite of someone else’s post.
No jargon and no prior knowledge assumed. What an API actually is, why they exist, the six words you need, and a first real request you can run in your browser in under a minute.
Spotting the ceiling before you hit it, the optimisations that buy another order of magnitude, and how to judge whether paying or self-hosting is cheaper.
How providers signal a breaking change before it lands, why validating at the boundary turns silent corruption into a loud error, and what to do when an API dies entirely.
How to pick a cache duration from how fast the data actually changes, why stale-while-revalidate is the setting that matters, and what to serve when the upstream fails.
Country data, flags and postal geography without a key, why you should not fetch a flag image at all, and the ISO codes worth storing instead of names.
Placeholder images, stock photography and image processing without a key, and the licensing distinction that decides whether you may host the file yourself.
Generating QR codes and barcodes without a key, why you should generate locally rather than hotlink, and the error-correction setting that decides whether a code scans.
Disposable-address detection and email verification without a key, what validation can and cannot actually prove, and the regex you should stop writing.
Public-sector APIs from the UK, US, Germany and Brazil that need no key, why government data is the most reliable free data available, and how to handle its formats.
Market data, macroeconomic series and financial utilities without a key, why free equity quotes are always delayed, and what exchange licensing actually forbids.
Live scores, fixtures and statistics without a key, why 'live' on a free tier usually means delayed, and how to poll a match feed without burning your rate limit.
Food, recipe and nutrition APIs that need no key, why Open Food Facts beats the commercial options for barcode lookup, and the data-quality problem in crowd-sourced nutrition.
Keyless APIs for jokes, quotes and quiz questions, the content-filtering step most projects skip, and why quote attribution is wrong more often than you would expect.
Music metadata and radio APIs that need no key, why lyrics are the hardest thing to get legally, and how MusicBrainz's rate limit differs from everyone else's.
Film and television APIs that need no key, why the big metadata providers all require registration, and which fictional-universe APIs are best for building something quickly.
News APIs that return headlines without a key, why most free news tiers forbid showing the results publicly, and the licensing question that decides which one you can actually use.
Which AI APIs actually let you build without a card on file, the metadata APIs that track model pricing and deprecation, and how to read a free tier before it bills you.
Price, market-cap and on-chain APIs that work without a key, how often free tiers actually refresh, and why the price you display will never match the price on an exchange.
APIs that generate fake users, fake products and deliberately broken responses, so you can build against realistic data and test the failure paths you normally cannot reach.
Turning addresses into coordinates without a key, why postcode lookups beat full-address geocoding for accuracy, and the licensing trap in most free geocoders.
Six IP geolocation APIs that need no key, what accuracy you can actually expect at city level, and why VPNs and mobile networks break the assumption your code is making.
Exchange rate APIs that work without a key, including three central banks publishing official reference rates, and what the difference between reference and market rates means for your code.
Eight APIs that need no key, return readable JSON and respond first try. Picked because they let you see a result in one command, not because they are famous.
Six weather APIs that return forecasts without a sign-up, an API key or a credit card, ranked by the response times and reliability we measured ourselves.
Documentation is written in a fixed order that rarely matches the order you need it in. Here is the reading path that gets you a working request fastest, and the five sections that actually matter.
Three places to put data in a request. Which one an API expects is not arbitrary, and getting it wrong produces confusing 404s and silently ignored filters.
A 5xx is the provider's bug, not yours. Here is how to confirm that, what to do while it lasts, and how to keep your own product usable when a dependency fails.
fetch has no default timeout, so a hung request waits forever. Here is how to set one properly, and which failures are safe to retry without duplicating work.
"Unexpected token < in JSON at position 0" means you parsed an error page as data. Here is how to find what the server actually sent, and why it sent it.
Your page is secure, the API is not, and the browser refuses to connect them. Why there is no client-side fix, and what to do when the API has no HTTPS endpoint.
Why the browser sends an OPTIONS request you never wrote, what turns a simple request into a preflighted one, and how to stop doubling your request count.
TypeError: Failed to fetch tells you almost nothing, because the browser deliberately withholds the detail. Here is how to work out which of the seven causes you actually have.
The key you have not touched in weeks started returning 401. Here are the causes, ordered by how often they turn out to be the real one, and how to confirm each in under a minute.
A 401 means the API does not know who you are. A 403 means it knows and is refusing anyway. Telling them apart points you at completely different fixes.
A 429 means you are sending faster than the API allows. Here is how to read Retry-After, implement backoff that does not stampede, and stop hitting the limit in the first place.
Your fetch works in curl but fails in the browser. Here is what the CORS error actually means, the four fixes that work, and the two pieces of advice that will waste your afternoon.
·6 min read
Follow along
New articles are published as we work through the catalogue. Subscribe with any feed reader.
We use cookies only to measure traffic and, in future, to show ads. Nothing is stored until you choose, and you can change your mind at any time. Read our privacy policy.