Skip to content

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:

  1. You send an HTTP request (usually GET) to an endpoint, a URL like https://catfact.ninja/fact.
  2. You optionally add parameters (?city=London) and headers (like an API key).
  3. The server replies with a status code (200 means OK) and a body, almost always JSON.

Here's the whole thing in one line of terminal:

Bash
curl https://catfact.ninja/fact
JSON
{"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:

JavaScript
const res = await fetch("https://catfact.ninja/fact");
const { fact } = await res.json();
console.log(fact);
Python
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

Cat Facts

A random cat fact

https://catfact.ninja/fact

Dogs

A random dog photo URL

https://dog.ceo/api/breeds/image/random

PokéAPI

Pokémon data

https://pokeapi.co/api/v2/pokemon/pikachu

Open-Meteo

Weather forecasts

https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.13&current=temperature_2m

wttr.in

Weather as JSON or text

https://wttr.in/London?format=j1

Frankfurter

Currency exchange rates

https://api.frankfurter.dev/v1/latest?base=USD&symbols=EUR,GBP

CoinGecko

Crypto prices

https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd

Coinpaprika

Crypto market data

https://api.coinpaprika.com/v1/tickers/btc-bitcoin

JSONPlaceholder

Fake posts, users and todos

https://jsonplaceholder.typicode.com/todos/1

DummyJSON

Fake products, carts and users

https://dummyjson.com/products/1

RandomUser

Random user profiles

https://randomuser.me/api/

FakeStoreAPI

E-commerce sample data

https://fakestoreapi.com/products/1

Open Trivia

Trivia questions

https://opentdb.com/api.php?amount=5

JokeAPI

Jokes, with safe mode

https://v2.jokeapi.dev/joke/Programming?safe-mode

Advice Slip

A random piece of advice

https://api.adviceslip.com/advice

Agify.io

Predicted age from a first name

https://api.agify.io/?name=michael

Open Library

Book search

https://openlibrary.org/search.json?q=dune

Zippopotam.us

Postal code lookup

https://api.zippopotam.us/us/90210

Spaceflight News

Space news articles

https://api.spaceflightnewsapi.net/v4/articles/?limit=5

Httpbin

Echoes your request back

https://httpbin.org/get

#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:

  1. Start from the category. Weather, finance, maps, games: browse by category.
  2. Filter by access. No key for prototypes, CORS for front-end calls, HTTPS for anything real.
  3. Check reliability. Our best API rankings put APIs with strong uptime and fast responses first.
  4. 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.