Free Public APIs

A collection of 499 Free Public APIs for Students and Developers.

Tested every single day.

sponsored by

What Is an API?

An API (Application Programming Interface) is a way for one program to ask another program for data or actions.

Think of it like ordering food in a restaurant:

  • You are the app or website asking for something.
  • The waiter is the API request.
  • The kitchen is the server that does the work.
  • Your meal is the response data (usually JSON).

How APIs Work

  1. You send a request to an API endpoint (URL).
  2. You choose a method, usually GET.
  3. The server processes your request.
  4. The server sends back a response, often in JSON format.

FreePublicAPIs helps beginners by collecting free APIs in one place and testing them daily, so you can spend more time learning and less time debugging dead links.

Your First API Call with JavaScript

Goal: make your first real API request and print results in the console.

This example calls the FreePublicAPIs random endpoint: https://freepublicapis.com/api/random

async function getRandomApi() {
  const response = await fetch("https://freepublicapis.com/api/random");

  if (!response.ok) {
    throw new Error("Request failed");
  }

  const api = await response.json();
  console.log("Title:", api.title);
  console.log("Description:", api.description);
  console.log("Documentation:", api.documentation);
}

getRandomApi();

Beginner challenge: print only APIs that include a GET method in api.methods.

Build a Tiny API Explorer

Goal: fetch multiple APIs and show a simple ranked list.

This endpoint returns a list: https://freepublicapis.com/api/apis?sort=best&limit=5

async function listBestApis() {
  const response = await fetch(
    "https://freepublicapis.com/api/apis?sort=best&limit=5"
  );

  if (!response.ok) {
    throw new Error("Request failed");
  }

  const apis = await response.json();

  apis.forEach((api, index) => {
    console.log(`${index + 1}. ${api.title}`);
    console.log(`   Docs: ${api.documentation}`);
    console.log(`   Health: ${api.health}`);
  });
}

listBestApis();

Beginner challenge: render this list in HTML as clickable links.

Ready to practice? Start browsing the API collection on the main list.

Found a great free API? You can submit it here.