Looking for zero-cost, production-friendly APIs? Here’s a curated list—organized by use case—with copy-paste examples, caveats, and links to official docs.
⚠️ Always review each API’s terms, rate limits, and attribution rules before shipping.
What “free” usually means
- Open & no key: Public endpoints, no signup (e.g., Open-Meteo, PokeAPI, Wikidata).
- Keyed free tier: Requires a token but offers a free monthly quota (e.g., NASA, Unsplash).
- Fair use/open data: Public but rate-limited (e.g., OpenStreetMap/Nominatim, Overpass).
Quick picks by category
- Weather: Open-Meteo, MET Norway, Open-Meteo Geocoding
- Maps & geodata: OSM Nominatim, Overpass API, Geoapify
- Space & science: NASA Open APIs
- Knowledge & content: Wikipedia REST, Wikidata, Open Library
- Code & dev: GitHub REST/GraphQL, Stack Exchange
- Fun & demo: PokeAPI, The Cat API, The Dog API, Deck of Cards, Numbers API
- Media: Unsplash API, Lorem Picsum
- Finance (public/EDU): Frankfurter, exchangerate.host
- News & civic data: GOV.UK APIs, GNews
- Testing/backends: JSONPlaceholder, ReqRes, HTTPBin
The list (what you get + why it’s useful)
Weather & Climate
- Open-Meteo – Free forecasts & historical weather; no API key. Docs: https://open-meteo.com/en/docs
- MET Norway (Locationforecast) – High-quality European forecasts; include attribution & a valid
User-Agent
. Docs: https://api.met.no/doc/ - Open-Meteo Geocoding – Forward/reverse geocoding to pair with weather queries. Docs: https://open-meteo.com/en/docs/geocoding-api
Mapping & Geospatial
- OpenStreetMap Nominatim – Geocoding from OSM; follow usage policy. Docs: https://nominatim.org/release-docs/latest/api/Overview/
- Overpass API (OSM) – Query OSM features (cafés, EV chargers, paths). Docs: https://overpass-api.de/
- Geoapify (free tier) – Geocoding, routing, isochrones. Docs: https://www.geoapify.com/developers
Space & Science
- NASA APIs (APOD, NeoWs, EPIC, etc.) – Free key; perfect for content apps. Portal: https://api.nasa.gov/
- USGS Earthquake API – Real-time quakes in GeoJSON. Docs: https://earthquake.usgs.gov/fdsnws/event/1/
Knowledge & Open Data
- Wikipedia REST – Summaries, page content, and media metadata. Docs: https://www.mediawiki.org/wiki/REST_API
- Wikidata – Query structured knowledge via SPARQL. Query Service: https://query.wikidata.org/
- Open Library – Books, covers, authors. Docs: https://openlibrary.org/developers/api
- OpenAlex – Scholarly works and authors. Docs: https://docs.openalex.org/
Developer & Community
- GitHub REST/GraphQL – Repos, issues, actions. Docs: https://docs.github.com/en/rest
- Stack Exchange – Q&A data across the network. Docs: https://api.stackexchange.com/
Media & Placeholders
- Unsplash API – High-quality images; attribution requirements apply. Docs: https://unsplash.com/developers
- Lorem Picsum – Simple placeholder images via URL params. Docs: https://picsum.photos/
Finance & Numbers
- Frankfurter – Historical FX (ECB), no key. Docs: https://www.frankfurter.app/
- exchangerate.host – Live/historical rates, no key. Docs: https://exchangerate.host/#/
News & Public Sector
- GOV.UK APIs – Services & registers (UK). Index: https://www.api.gov.uk/
- GNews (free tier) – News search JSON; simple, limits apply. Docs: https://gnews.io/
Fun, Learning & Demos
- PokeAPI – Pokémon data; great for teaching pagination. Docs: https://pokeapi.co/
- The Cat API – Random images & breeds. Docs: https://thecatapi.com/
- The Dog API – Similar to Cat API, for dogs. Docs: https://thedogapi.com/
- Deck of Cards API – Card shuffling/drawing. Docs: https://deckofcardsapi.com/
- Numbers API – Facts about numbers, dates, math. Docs: http://numbersapi.com/
- JSONPlaceholder – Fake REST endpoints for front-end devs. Docs: https://jsonplaceholder.typicode.com/
- ReqRes – Mock user endpoints & auth flows. Docs: https://reqres.in/
- HTTPBin – Inspect requests, headers, auth, etc. Docs: https://httpbin.org/
Copy-paste starters (curl, JS & Python)
1) Weather (Open-Meteo; no key)
curl "https://api.open-meteo.com/v1/forecast?latitude=21.03&longitude=105.85&hourly=temperature_2m"
// Browser/Node (fetch)
const url = 'https://api.open-meteo.com/v1/forecast?latitude=21.03&longitude=105.85&hourly=temperature_2m';
const data = await fetch(url).then(r => r.json());
console.log(data.hourly.temperature_2m.slice(0, 5));
2) Space image of the day (NASA APOD; free key)
curl "https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY"
const url = 'https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY';
const apod = await fetch(url).then(r => r.json());
document.body.innerHTML = `<h1>${apod.title}</h1><img src="${apod.url}" alt="">`;
3) Geocoding (Nominatim; add a real User-Agent)
curl -H "User-Agent: yourapp/1.0 (contact@example.com)" "https://nominatim.openstreetmap.org/search?q=Hanoi&format=json&limit=3"
4) Wikipedia summary (no key)
curl "https://en.wikipedia.org/api/rest_v1/page/summary/Blockchain"
5) GitHub repository info (token optional but recommended)
curl -H "Authorization: Bearer YOUR_GH_TOKEN" "https://api.github.com/repos/vercel/next.js"
6) Placeholder backend (JSONPlaceholder)
curl "https://jsonplaceholder.typicode.com/posts/1"
Patterns & best practices
1) Cache aggressively — Use ETag
, Cache-Control
, and client caches to respect free-tier rate limits.
2) Exponential backoff — Handle 429 Too Many Requests
gracefully.
3) Identify your app — Fair-use APIs (Nominatim/Overpass) require a helpful User-Agent
.
4) Secure your keys — Keep secrets server-side; proxy from your backend or edge functions.
5) Pagination helpers — Abstract page
, per_page
, next
early to keep UIs smooth.
6) Respect licenses — Many open data/media APIs require attribution; add it in your footer.
7) Localize & fail gracefully — Provide empty states and fallback copy.
A minimal proxy (Node/Express) for hiding API keys
import express from "express";
import fetch from "node-fetch";
const app = express();
app.get("/api/apod", async (req, res) => {
const r = await fetch(`https://api.nasa.gov/planetary/apod?api_key=${process.env.NASA_KEY}`);
if (!r.ok) return res.status(r.status).json({ error: await r.text() });
res.json(await r.json());
});
app.listen(3000, () => console.log("Proxy running on :3000"));
Testing checklist before launch
- Rate-limit & error handling (4xx/5xx, 429 backoff)
- Caching via
ETag
/Cache-Control
- Timeouts & circuit breakers
- Input validation & geofencing
- Keys in env vars (no client secrets)
- Attribution & licenses covered
- Observability: logs, request IDs, metrics
Where to discover more
- National/city open-data portals, academic consortia, OSS projects.
- Search: “
{domain} open API documentation rate limits
”. - GitHub Discussions/Issues often surface real-world gotchas.