Skip to content

Repository files navigation

GratisAPI 🆓

A completely free, 100% static, open-data API.

Gratis means free — and GratisAPI is free in every sense. No API keys, no rate limits, no sign-up, no tracking, no cost. Ever. Every endpoint is a plain JSON file served at a clean URL straight from a global CDN.

10,000+ APIs · 1,000,000+ records · 100+ articles · $0 forever.

🌐 Live: https://gratisapi.com/ 📖 Docs (Swagger UI): https://gratisapi.com/docs/ 📝 Articles: https://gratisapi.com/articles/ 🆓 Philosophy: https://gratisapi.com/philosophy/ 🛠️ How it works (tech spec): https://gratisapi.com/about/ 📄 OpenAPI spec: https://gratisapi.com/openapi.json

Clean, key-free URLs · light & dark mode · served from gratisapi.com via a custom-domain CNAME.


How it works

There is no server. Every endpoint is a static file served at a clean, extension-less URL. You GET it with curl, fetch, or anything that speaks HTTP:

# List every available API
curl https://gratisapi.com/api/index

# Get one record
curl https://gratisapi.com/api/animals/lion

# Get a whole dataset
curl https://gratisapi.com/api/elements/index
// Random quote in the browser (CORS is enabled)
const { results } = await fetch(
  "https://gratisapi.com/api/quotes/index"
).then((r) => r.json());
const q = results[Math.floor(Math.random() * results.length)];
console.log(`"${q.quote}" — ${q.author}`);

Endpoint shape

Endpoint Returns
/api/index Directory of every dataset
/api/<name>/index Metadata + all records for one dataset
/api/<name>/<id> A single record

Each dataset index looks like:

{
  "api": "animals",
  "title": "Animals",
  "count": 20,
  "endpoints": { "list": ".../index", "item": ".../{id}" },
  "fields": ["class", "common_name", "..."],
  "results": [ { "id": "lion", "...": "..." } ]
}

Available APIs

There are 10,000+ APIs in total — from amino-acids to volcanoes. The live, always-current directory of every one is at /api/index. A selection is listed below.

API Records What's in it
🌍 countries 197 Capital, ISO codes, continent, currency, population, flag
🇺🇸 us-states 51 Capital, largest city, population, area, region
🗺️ continents 7 Area, population, country counts
🌊 oceans 5 Area, average/max depth, deepest point
⛰️ mountains 31 Elevation, range, first-ascent year
🏞️ rivers 31 Length, continent, outflow
🏞️ lakes 25 Area, depth, type
🏜️ deserts 21 Area, continent, type
💦 waterfalls 16 Height, river, location
💱 currencies 101 ISO 4217 code, symbol, minor unit
🗣️ languages 81 ISO 639-1 code, native name, direction
🦊 animals 71 Full taxonomy kingdom → species
🦖 dinosaurs 40 Period, diet, size, region
🐕 dog-breeds 51 Group, origin, size, temperament
🐈 cat-breeds 31 Origin, coat, temperament
🐦 birds 41 Family, habitat, diet, wingspan
🦈 sharks 25 Size, habitat, danger rating
🌳 trees 32 Leaf type, height, native region
🌷 flowers 30 Color, bloom season, meaning
🍎 fruits 40 Botanical type, origin, calories
🥕 vegetables 36 Type, color, calories
🌶️ spices 36 Plant part, origin, heat level
🧪 elements 118 All 118 chemical elements
🔬 physical-constants 25 Symbol, value, unit
math-constants 20 Symbol, value, description
🔢 si-prefixes 24 Symbol, power of ten
💊 vitamins 13 Function, solubility, sources
🩸 blood-types 8 Donor/recipient compatibility
💨 beaufort-scale 13 Wind force 0–12
🪐 planets 9 Planets & dwarf planets
🌙 moons 30 Parent planet, discovery
constellations 88 All 88 IAU constellations
stars 30 Magnitude, distance, spectral type
zodiac 12 Western zodiac signs
📡 http-status 63 Status codes & reason phrases
🔗 http-methods 9 Safety, idempotency, caching
📄 mime-types 61 Category & file extensions
🔌 tcp-ports 62 Well-known ports & services
💻 programming-languages 50 Year, paradigm, typing
🔤 ascii 95 Printable ASCII table
🇬🇷 greek-alphabet 24 Transliteration, numeric value
📶 nato-alphabet 26 Code words & pronunciation
·−· morse-code 54 Letters, digits, punctuation
roman-numerals 33 Arabic ↔ Roman
💬 quotes 122 Famous quotes with authors & tags
🏛️ us-presidents 46 Party, term, vice president
greek-gods 34 Domain, Roman equivalent
⚔️ norse-gods 22 Domain, type, symbol
𓂀 egyptian-gods 21 Domain, symbol, depiction
🗿 seven-wonders 14 Ancient + New wonders
🐉 chinese-zodiac 12 Element, yin-yang, traits
💎 birthstones 12 Monthly stones & meanings
🔮 tarot-major-arcana 22 Keywords, element
💠 gemstones 31 Color, Mohs hardness
🎨 colors 141 Hex, RGB, HSL
🎸 musical-instruments 42 Family, classification
🍸 cocktails 41 Base spirit, glass, IBA status
♟️ chess-pieces 6 Symbols, value, movement
🃏 playing-cards 52 A standard 52-card deck
📅 calendar 19 Months & days of the week

Articles & Philosophy

GratisAPI is more than data. The Articles section has 100+ articles across five categories — Tutorials, Philosophy, Science, Culture and Reference — covering how to use the APIs from any language, deep-dives into the datasets, and essays on free data. Even the articles are an API: they're served from /api/articles/index.

The Philosophy page explains the two meanings of "free" — gratis (free of charge) and libre (free as in freedom) — the free software movement, Richard Stallman and the FSF, and why GratisAPI is deliberately both.

Building locally

The JSON files under api/, plus openapi.json and sitemap.xml, are all generated from the dataset modules in scripts/data/.

python3 -m scripts.generate      # regenerates /api, openapi.json and sitemap.xml

To add a new API, drop a module in scripts/data/ that exposes a META dict and an ITEMS list (each item needs a unique id), then re-run the generator. The new dataset is auto-discovered — no other file needs editing.

# scripts/data/example.py
META = {"name": "example", "title": "Example", "description": "...", "emoji": "📦"}
ITEMS = [{"id": "one", "value": 1}, {"id": "two", "value": 2}]

Deployment & CI

Two GitHub Actions workflows keep the site honest and live:

  • .github/workflows/ci.yml — on every push/PR, regenerates the API and fails if the committed output is stale or any JSON is invalid.
  • .github/workflows/deploy.yml — on push to gh-pages, rebuilds and publishes to GitHub Pages. Requires Settings → Pages → Source = "GitHub Actions". (If you instead serve directly from the gh-pages branch, the committed files already work as-is and this workflow is optional.)

Contributing

Pull requests welcome — new datasets, corrections, more records. Keep data accurate and sourced from public/open information.

License

GratisAPI is licensed under the GNU General Public License v2.0 or later (GPL-2.0-or-later). See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages