Antwa CodeAntwaCode Blog

Awesome Repo7 min read

public-apis: Free APIs Collection for Developers

public-apis is a collection of free APIs for developers.

Read in Bahasa Indonesia

public-apis

Image: GitHub

public-apis: Free APIs Collection for Developers

Hey there, developers! 👋

If you're on the hunt for free APIs for your next project, you've come to the right place. Today we're diving into public-apis — a GitHub repo that's become the go-to reference for anyone who needs access to public APIs without spending a dime.

This repo has been collected and maintained by the community for years, and the result? Over 1,400 free APIs spanning a wide range of categories, from weather data to pet information. Let's break it down!


What Is public-apis?

public-apis is a GitHub repository containing a comprehensive list of public APIs that can be accessed for free or with a free tier. The repo is manually maintained by a community of contributors — meaning every API in the list has been curated and verified by real people, not just scraped automatically.

Here are some key stats:

  • GitHub Stars: 456K+ (one of the most starred repos on GitHub!)
  • Forks: 50.3K+
  • Commits: 5,100+
  • Active Pull Requests: 1,600+
  • License: CC0-1.0 (Public Domain — use freely with no restrictions)
  • Language: Python
  • Total Categories: Over 50 API categories

This repo isn't just a list of links. Each API includes important information:

ColumnDescription
APIName and link to the API documentation
DescriptionA brief summary of what the API does
AuthWhether an API Key is required (apiKey, OAuth, or No)
HTTPSWhether HTTPS is supported (Yes/No)
CORSWhether Cross-Origin Resource Sharing is supported (Yes/No)

This information matters because it directly affects how you can use an API in the browser or on the backend.


Why Does public-apis Matter?

As developers, we often need data from various sources — weather, news, financial data, random photos, and so on. The problem is:

  1. We don't always have the budget for paid API subscriptions
  2. We need quick prototypes before committing to a paid solution
  3. We're not sure which APIs are reliable and easy to work with

That's where public-apis comes in. You can:

  • Browse APIs by category
  • See at a glance whether an API key is required
  • Check for HTTPS and CORS support
  • Compare multiple APIs within the same category

Plus, since it's an open-source repo licensed under CC0, you can contribute too — if you find a free API that's not listed, just open a pull request!


Available API Categories

public-apis has over 50 API categories. Here's a full overview:

Animals, Anime & Entertainment

  • Animals — Cat facts, dog photos, endangered species data, bird migration locations. Great for educational apps or fun Telegram bots.
  • Anime — Data from MyAnimeList and Jikan: anime info, manga, characters, release schedules.
  • Entertainment — Movie data (TMDb, OMDB), TV shows, podcasts, and other entertainment.
  • Games & Comics — Game data from Steam, RAWG, IGDB, and comics from Marvel, DC.

Design, Art & Visual

  • Art & Design — Image generation, color palettes, fonts. Includes Unsplash, Pexels, The Noun Project.
  • Photography — Photo editing, filters, and image compression.

Security & Authentication

  • Anti-Malware — Scan files and URLs for malware.
  • Authentication & Authorization — Auth0, Clerk, Firebase Auth.
  • Security — Breach checks, vulnerability scanners, threat intelligence.
  • Data Validation — Email, phone number, and address validation.

Finance & Business

  • Cryptocurrency — Real-time prices, market cap data (CoinGecko, CoinMarketCap).
  • Currency Exchange — Real-time and historical exchange rates.
  • Finance — Stock market data, financial news, investment analysis.
  • Business — Invoicing, CRM, and other business data.
  • Shopping — Product data from Amazon, eBay, and other marketplaces.

Development & DevOps

  • Development — GitHub API, Stack Overflow, and dev workflow tools.
  • Continuous Integration — Trigger and monitor CI/CD pipelines.
  • Programming — Code snippets, programming language documentation.
  • Open Source Projects — Info on the most popular open-source projects.

Communication & Social

  • Email — SendGrid, Mailgun, Postmark for transactional email.
  • Social — Twitter, Reddit, Mastodon, and other social platforms.
  • Phone — Phone number validation and lookup.
  • URL Shorteners — Bitly, TinyURL, and alternatives.

Data, Science & Environment

  • Science & Math — NASA, weather data, genetics, astronomy.
  • Environment — Air quality, carbon emissions, environmental data.
  • Health — Health data, drug information, medical research.
  • Open Data — Open datasets from governments and organizations.
  • Government — Census data, statistics, legislative data.

Education & Information

  • Books — Google Books, Open Library, Goodreads.
  • Dictionaries — Oxford, Merriam-Webster, Google Translate.
  • Text Analysis — Sentiment analysis, summarization, keyword extraction.
  • Machine Learning — Ready-to-use ML models, NLP, computer vision.

Productivity & Documents

  • Documents & Productivity — PDF generation, OCR, document automation.
  • Calendar — Google Calendar, Calendly, and alternatives.
  • Jobs — Job listing data from various sources.

Location & Transportation

  • Geocoding — Convert addresses to GPS coordinates and vice versa.
  • Transportation — Flights, trains, buses, ride-sharing.
  • Vehicle — Car specifications, recall information.
  • Tracking — Package tracking, domain lookups, and IP tracking.

Music, Video & Weather

  • Music — Spotify, Last.fm, Genius (lyrics).
  • Video — YouTube, Vimeo, and streaming platforms.
  • Weather — Real-time weather: OpenWeatherMap, Weatherstack.

Other

  • Blockchain — On-chain data, Web3 wallet info.
  • Cloud Storage — Dropbox, Google Drive, Box.
  • Events — Eventbrite, Ticketmaster.
  • Food & Drink — Recipes, nutrition data, restaurant info.
  • Personality — Personality analysis based on data.
  • Test Data — Generators for dummy names, addresses, and phone numbers.

How to Use public-apis

1. Clone or Browse Directly

# Clone the repo for offline browsing
git clone https://github.com/public-apis/public-apis.git
 
# Or open it directly in your browser
# https://github.com/public-apis/public-apis

2. Find the Right API

After cloning, open README.md and use the table of contents to navigate to the category you need.

3. Understand Each API's Columns

  • Auth: If it says No, you can call it directly. If it says apiKey, you'll need to register with the provider first.
  • HTTPS: If Yes, it's safe for production. If No, proceed with caution.
  • CORS: If Yes, it can be called from the browser (frontend). If No, you'll need to route it through a backend/proxy.

4. Read the Docs & Start Building!

Click the link in the API column to read the documentation, then integrate it into your project.


Weather — OpenWeatherMap

import requests
 
API_KEY = "YOUR_API_KEY"
city = "Jakarta"
 
url = f"https://api.openweathermap.org/data/2.5/weather?q={city}&appid={API_KEY}&units=metric"
response = requests.get(url)
data = response.json()
 
print(f"Weather in {city}: {data['weather'][0]['description']}")
print(f"Temperature: {data['main']['temp']}°C")
print(f"Humidity: {data['main']['humidity']}%")

Crypto Prices — CoinGecko

import requests
 
url = "https://api.coingecko.com/api/v3/simple/price"
params = {"ids": "bitcoin,ethereum,solana", "vs_currencies": "usd,idr"}
 
response = requests.get(url, params=params)
data = response.json()
 
for coin, prices in data.items():
    print(f"{coin.upper()}:")
    print(f"  USD: ${prices['usd']:,.2f}")
    print(f"  IDR: Rp{prices['idr']:,.0f}")

Random Photos — Unsplash

// Can be called directly from the browser since CORS: Yes
async function getRandomPhoto() {
    const accessKey = 'YOUR_ACCESS_KEY';
    const url = `https://api.unsplash.com/photos/random?client_id=${accessKey}`;
    
    const response = await fetch(url);
    const data = await response.json();
    
    console.log(`Title: ${data.alt_description}`);
    console.log(`URL: ${data.urls.regular}`);
    console.log(`By: ${data.user.name}`);
}
 
getRandomPhoto();

Cat Facts — Cat Facts

import requests
 
url = "https://catfact.ninja/fact"
response = requests.get(url)
data = response.json()
 
print(f"Cat Fact: {data['fact']}")

Currency Exchange Rates

import requests
 
url = "https://open.er-api.com/v6/latest/IDR"
response = requests.get(url)
rates = response.json()['rates']
 
idr_amount = 1_000_000
currencies = ['USD', 'EUR', 'GBP', 'JPY', 'SGD']
 
print(f"Rp{idr_amount:,.0f} is equivalent to:")
for currency in currencies:
    converted = idr_amount * rates[currency]
    print(f"  {currency}: {converted:,.2f}")

Use Cases for Developers

1. 📱 Local Weather App

Build a real-time weather app for cities worldwide. Use OpenWeatherMap (free tier: 1,000 calls/day). Tech stack: React Native/Flutter + Node.js/Python FastAPI.

2. 🤖 Telegram Chatbot with Real-time Data

A Telegram bot that provides weather info, breaking news, or crypto prices. Here's a concept:

from telegram import Update
from telegram.ext import Application, CommandHandler, ContextTypes
import requests
 
async def weather(update: Update, context: ContextTypes.DEFAULT_TYPE):
    city = context.args[0] if context.args else "Jakarta"
    url = f"https://api.openweathermap.org/data/2.5/weather?q={city}&appid=API_KEY&units=metric"
    data = requests.get(url).json()
    
    message = f"🌤 Weather in {city}:\n"
    message += f"📐 Temperature: {data['main']['temp']}°C\n"
    message += f"💧 Humidity: {data['main']['humidity']}%"
    
    await update.message.reply_text(message)

3. 📊 Financial Dashboard

A dashboard displaying real-time stock market (Marketstack) and cryptocurrency (CoinGecko) data.

4. 🎓 Education Platform

A learning platform with dictionary APIs, book recommendations, and science data for students.

5. 🛒 E-commerce Prototype

Rapid e-commerce prototyping using product data from the Shopping category — no manual data entry required.

6. 📸 Automatic Portfolio Generator

Use the Unsplash/Pexels API to automatically generate a portfolio page with high-quality photos.


Tips for Using Free APIs

1. Always Check Rate Limits

APIFree Tier Limit
OpenWeatherMap1,000 calls/day
CoinGecko10-30 calls/minute
NewsAPI100 requests/day

Tip: Cache data that doesn't change often so you don't burn through API calls.

2. Use Environment Variables

# ❌ DON'T do this
API_KEY = "«redacted:sk_live_…»"  # Hardcoded in your code!
 
# ✅ Use environment variables
import os
API_KEY = os.environ.get("OPENWEATHER_API_KEY")

Never commit API keys to Git!

3. Handle Errors Properly

import requests
from requests.exceptions import RequestException
 
def fetch_data(url):
    try:
        response = requests.get(url, timeout=10)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.Timeout:
        print("⏰ Request timed out — try again later")
    except requests.exceptions.HTTPError as e:
        print(f"❌ HTTP Error: {e.response.status_code}")
    except RequestException as e:
        print(f"❌ Error: {e}")
    return None

4. Read the Docs Before You Code

Pay attention to: which endpoints to call, required parameters, response format, and limitations (rate limits, quotas).

5. Check API Status Periodically

Some free APIs occasionally go down or switch to a paid model. Keep an eye on the public-apis repo for updates.


How to Contribute

Want to help grow this list? It's easy:

  1. Fork the public-apis repo
  2. Add a new API that's not already listed
  3. Make sure the format matches:
    | [API Name](https://link.com) | Description | `apiKey` | Yes | Yes |
  4. Submit a Pull Request with a clear title
  5. Wait for a maintainer review

Contribution tips:

  • Make sure the API is truly free or has a free tier
  • Include a link to the full documentation
  • Fill in the Auth, HTTPS, and CORS columns accurately
  • Check that the API isn't already listed (avoid duplicates)

Alternatives & Complementary Resources

ResourceDescription
Public APIsWebsite with a more user-friendly UI
API ListAlternative API directory with similar categories
RapidAPI MarketplaceAPI platform with a free tier
Postman Public API NetworkAPIs you can try directly in Postman
APIs.guruOpenAPI/Swagger-based API directory

Conclusion

public-apis is an essential resource every developer should have bookmarked. With over 1,400 well-curated free APIs, you'll never have to stress about finding data for your projects.

What makes this repo stand out:

  • All free — specifically APIs you can use at no cost or with a free tier
  • Community-curated — every API verified by real humans
  • Complete info — auth, HTTPS, and CORS details at a glance
  • Actively maintained — 5,100+ commits and active community PRs
  • Open Source — CC0 licensed, free to use and contribute to

So the next time you're brainstorming a new project and need data, start with public-apis. The free API you need might already be on the list!

Bookmark the repo now: github.com/public-apis/public-apis

Happy coding, and may your projects run smoothly! 🚀


This article is based on the public-apis/public-apis repository, licensed under CC0-1.0.

More posts