Favor Onuoha
Posted on · 5 min read
What Is a Public API? A Plain-English Guide With 20 Examples You Can Call Today
A public API is an interface that any developer can use, over the internet, to get data or functionality from someone else's service. You send an HTTP request to a URL, and you get structured data back, usually JSON. Weather forecasts, exchange rates, Pokémon stats and random cat facts are all a single request away.
The word "public" is about who can access it, not about price. Some public APIs are completely open, with no sign-up at all. Others ask you to register for a free API key, and many have paid tiers for heavier use. What they share is that they're published for outside developers, with documentation, instead of being locked inside one company.
This guide explains how public APIs work, the jargon you'll meet (API keys, rate limits, CORS), and finishes with 20 real APIs you can call right now. The examples come from the public-apis list, which our directory tracks and health-checks every day.
#How does a public API work?
Almost every public API you'll use is a REST API over HTTPS. The pattern is always the same:
- You send an HTTP request (usually
GET) to an endpoint, a URL likehttps://catfact.ninja/fact. - You optionally add parameters (
?city=London) and headers (like an API key). - The server replies with a status code (
200means OK) and a body, almost always JSON.
Here's the whole thing in one line of terminal:
curl https://catfact.ninja/fact{"fact":"An adult lion's roar can be heard up to five miles (eight kilometers) away.","length":75}That's a public API call. No account, no SDK, no setup.
The same request from JavaScript and Python:
const res = await fetch("https://catfact.ninja/fact");
const { fact } = await res.json();
console.log(fact);import requests
data = requests.get("https://catfact.ninja/fact", timeout=10).json()
print(data["fact"])#Public vs private vs partner APIs
Type | Who can use it | Example |
|---|---|---|
Public (open) API | Any developer, sometimes after free sign-up | Open-Meteo, PokéAPI, CoinGecko |
Partner API | Approved businesses under a contract | Airline booking or banking integrations |
Private (internal) API | Only the company's own apps | The API behind a company's mobile app |
When people say "public API", they almost always mean the first row: documented, self-serve, and free to start with.
#Do public APIs need an API key?
Many don't. Of the 2,166 APIs in our directory, 1,038 need no API key at all. The rest use one of a few schemes:
- API key: a long string you get after signing up, sent as a query parameter (
?apikey=...) or a header (X-API-Key: ...). This is the most common. - OAuth: used when the API acts on behalf of a user, like posting to their account (GitHub, Spotify, Discord).
- User-Agent or contact header: some open services, like OpenStreetMap's Nominatim, ask you to identify your app instead of registering.
Keys exist so providers can count your usage, enforce rate limits and contact you. They're not a sign that an API costs money; most keyed APIs on the list have a free tier. If you're just starting out, browse free APIs with no API key first.
#What are rate limits?
A rate limit caps how many requests you can make in a period: per second, minute, day or month. Go over it and you'll get an HTTP 429 Too Many Requests response. Free tiers are where limits matter most. For example, as of October 2026:
- Open-Meteo's free, non-commercial API allows 10,000 calls per day.
- Alpha Vantage's free key allows 25 requests per day.
- ipstack's free plan includes 100 requests per month.
The practical rules: cache responses, don't call an API on every page view, and back off when you see a 429.
#What is CORS, and why does it matter?
CORS (Cross-Origin Resource Sharing) decides whether JavaScript running in a browser can call an API on another domain. If the API sends an Access-Control-Allow-Origin header, your front end can call it directly. If not, the browser blocks the response and you'll need to call the API from a server instead.
In our directory, 878 APIs are listed as CORS-enabled. If you're building a front-end-only project, start with free APIs for frontend projects.
#Are public APIs safe to use in production?
They can be, with a few precautions:
- Prefer HTTPS. 2,078 of the 2,166 APIs we track support it.
- Check uptime. Free services come and go. Our daily health check found 1,923 of the 2,166 listed APIs online on October 24, 2026, which means roughly one in nine was unreachable that day.
- Read the terms. Several free tiers are "non-commercial only" (Open-Meteo's free endpoint and ip-api.com's free endpoint, for example).
- Have a fallback. For anything critical, know which alternative you'd switch to. Every API page in our directory links to its alternatives.
#20 public APIs you can call right now
Every URL below returned data in our checks this week, and none of them needs an API key.
API | What it returns | Try it |
|---|---|---|
A random cat fact | | |
A random dog photo URL | | |
Pokémon data | | |
Weather forecasts | | |
Weather as JSON or text | | |
Currency exchange rates | | |
Crypto prices | | |
Crypto market data | | |
Fake posts, users and todos | | |
Fake products, carts and users | | |
Random user profiles | | |
E-commerce sample data | | |
Trivia questions | | |
Jokes, with safe mode | | |
A random piece of advice | | |
Predicted age from a first name | | |
Book search | | |
Postal code lookup | | |
Space news articles | | |
Echoes your request back | |
#How to find the right public API
A list of 2,000+ APIs is only useful if you can narrow it down. A quick checklist:
- Start from the category. Weather, finance, maps, games: browse by category.
- Filter by access. No key for prototypes, CORS for front-end calls, HTTPS for anything real.
- Check reliability. Our best API rankings put APIs with strong uptime and fast responses first.
- Read the docs and terms before you build on it.
#FAQ
#Is a public API the same as a free API?
Not always. "Public" means anyone can access it; many public APIs are free or have a free tier, but some charge from the first request. Every API in the public-apis list is free or has a free tier.
#What's the difference between an API and an endpoint?
An API is the whole interface a service offers. An endpoint is one URL within it, like /v1/forecast in the Open-Meteo API.
#Can I use public APIs in a commercial product?
Often yes, but check the terms. Some free tiers are non-commercial only, and you'll need a paid plan for a commercial product.
#Where can I find more public APIs?
Our directory tracks every API in the public-apis GitHub list, the most-starred API list on GitHub, with daily health checks, rankings and developer reviews. Start with the best free APIs by category.