01 — API

API Documentation

Integrate UnitFYI data into your applications. Access unit conversions, categories, glossary terms, blog posts, and tools through our JSON APIs, data feeds, and machine-readable endpoints.

Free No Auth JSON OpenAPI 3.1

Endpoint Reference

Endpoint Description Cache
GET /api/convert/Convert a value between two units5m
GET /api/convert/table/Generate a conversion table with multiple values5m
GET /api/categories/List all 20 measurement categories1h
GET /api/categories/{slug}/Category detail with units and popular conversions1h
GET /api/units/List all 220 units, optionally filtered by category1h
GET /api/unit/{slug}/Single unit detail with aliases1h
GET /api/glossary/List glossary terms with optional category/search filter1h
GET /api/glossary/{slug}/Glossary term with definition1h
GET /api/blog/posts/List published blog posts by category1h
GET /api/blog/posts/{slug}/Blog post with full content1h
GET /api/blog/categories/Blog categories with post counts1h
GET /api/tools/List all 5 interactive conversion tools1h
GET /api/search/?q=Search across units, categories, glossary, and blog5m
GET /api/openapi.jsonOpenAPI 3.1.0 specification (CORS enabled)none

Base URL

https://unitfyi.com/api/

OpenAPI spec: https://unitfyi.com/api/openapi.json

02 — Conversions
GET

Convert

Convert a value between two units.

/api/convert/?from={unit}&to={unit}&value={number}

Parameters

fromSource unit slug (e.g., centimeter)
toTarget unit slug (e.g., inch)
valueNumeric value to convert (default: 1)

Example

curl "https://unitfyi.com/api/convert/?from=centimeter&to=inch&value=100"
{
  "from": "centimeter",
  "to": "inch",
  "value": "100",
  "result": "39.37007874",
  "from_name": "Centimeter",
  "to_name": "Inch",
  "from_symbol": "cm",
  "to_symbol": "in",
  "category": "length",
  "formula": "value / 2.54"
}
GET

Conversion Table

Generate a conversion table between two units with multiple values.

/api/convert/table/?from={unit}&to={unit}&values={csv}

Parameters

fromSource unit slug (required)
toTarget unit slug (required)
valuesComma-separated values (default: 1,5,10,25,50,100,250,500,1000)

Example

curl "https://unitfyi.com/api/convert/table/?from=meter&to=foot"
{
  "from_unit": "meter",
  "from_symbol": "m",
  "from_name": "Meter",
  "to_unit": "foot",
  "to_symbol": "ft",
  "to_name": "Foot",
  "formula": "1 m = 3.2808 ft",
  "table": [
    {"value": "1", "result": "3.2808"},
    {"value": "5", "result": "16.4042"},
    {"value": "10", "result": "32.8084"},
    ...
  ]
}
03 — Categories & Units
GET

List Categories

List all 20 measurement categories.

/api/categories/

Example

curl https://unitfyi.com/api/categories/
{
  "categories": [
    {"slug": "length", "name": "Length", "icon": "📏", "unit_count": 15},
    {"slug": "weight", "name": "Weight", "icon": "⚖️", "unit_count": 14},
    {"slug": "temperature", "name": "Temperature", "icon": "🌡️", "unit_count": 4},
    ...
  ]
}
GET

Category Detail

Get a category with its units and popular conversions.

/api/categories/{slug}/

Parameters

slugCategory slug (e.g., length, weight, temperature)

Example

curl https://unitfyi.com/api/categories/length/
{
  "slug": "length",
  "name": "Length",
  "icon": "📏",
  "description": "Units for measuring distance and length",
  "base_unit": "meter",
  "units": [
    {"slug": "meter", "name": "Meter", "symbol": "m"},
    {"slug": "kilometer", "name": "Kilometer", "symbol": "km"},
    ...
  ],
  "popular_conversions": [
    {"from": "centimeter", "to": "inch"},
    {"from": "meter", "to": "foot"},
    ...
  ]
}
GET

List Units

List all 220 units, optionally filtered by category.

/api/units/?category={slug}

Parameters

categoryFilter by category slug (optional)
GET

Unit Detail

Get detailed info about a single unit including aliases.

/api/unit/{slug}/

Parameters

slugUnit slug (e.g., meter, kilogram, celsius)

Example

curl https://unitfyi.com/api/unit/meter/
{
  "slug": "meter",
  "name": "Meter",
  "symbol": "m",
  "category": "length",
  "category_name": "Length",
  "description": "The SI base unit of length",
  "aliases": ["metre", "meters", "metres"]
}
04 — Glossary
GET

List Glossary Terms

List measurement glossary terms with optional filters.

/api/glossary/?category={slug}&search={query}

Parameters

categoryFilter by category (optional)
searchSearch term or definition (optional)
GET

Glossary Term Detail

Get a single glossary term with definition and explanation.

/api/glossary/{slug}/

Example

curl https://unitfyi.com/api/glossary/metric-system/
{
  "slug": "metric-system",
  "term": "Metric System",
  "definition": "An international decimal system of weights and measures...",
  "category": "Metric",
  "url": "/glossary/metric-system/"
}
05 — Blog
GET

List Blog Posts

List published blog posts, optionally filtered by category.

/api/blog/posts/?category={slug}

Parameters

categoryFilter by blog category slug (optional)
GET

Blog Post Detail

Get a single blog post with full content.

/api/blog/posts/{slug}/
GET

Blog Categories

List all blog categories with post counts.

/api/blog/categories/
GET

List Tools

List all interactive conversion tools.

/api/tools/

Example

curl https://unitfyi.com/api/tools/
{
  "tools": [
    {"slug": "converter", "name": "Universal Converter", "description": "Convert between any units", "url": "/tools/converter/"},
    {"slug": "quick-convert", "name": "Quick Convert", "description": "Popular conversions at a glance", "url": "/tools/quick-convert/"},
    ...
  ]
}
GET

Search

Search across units, categories, glossary terms, and blog posts.

/api/search/?q={query}

Parameters

qSearch query (min 2 characters)

Example

curl "https://unitfyi.com/api/search/?q=meter"
{
  "query": "meter",
  "total": 8,
  "units": [
    {"slug": "meter", "name": "Meter", "symbol": "m", "category": "length"},
    {"slug": "kilometer", "name": "Kilometer", "symbol": "km", "category": "length"},
    ...
  ],
  "categories": [...],
  "glossary": [...],
  "blog": [...]
}
07 — Data Feeds

RSS & Atom Feeds

Subscribe to our blog feeds to receive updates when new measurement guides and articles are published. We provide both RSS 2.0 and Atom 1.0 formats.

Subscribe via command line

# RSS
curl "https://unitfyi.com/blog/feed/"

# Atom
curl "https://unitfyi.com/blog/feed/atom/"
08 — AI / LLM

AI / LLM Integration

UnitFYI provides machine-readable content summaries following the llms.txt standard. These endpoints help AI models understand and reference our content.

/llms.txt text/plain

A concise summary of UnitFYI's content structure and key pages. Designed for AI models to quickly understand what the site offers and how it is organized.

/llms-full.txt text/plain

Extended version with complete URL patterns, i18n language codes, and page-level structure. Use this for deeper indexing and cross-referencing of UnitFYI content.

Markdown output: Append .md to any page URL to get a markdown representation optimized for AI agent consumption.

AI Crawler Policy: Our robots.txt explicitly allows GPTBot, ClaudeBot, and Google-Extended crawlers.

09 — SEO & Standards

SEO & Standards

Standard endpoints for search engines, crawlers, and security researchers.

Endpoint Standard Description
/sitemap.xml Sitemaps 0.9 Sitemap index with per-section sitemaps covering all content types
/robots.txt REP Crawler directives with explicit AI bot permissions
/.well-known/security.txt RFC 9116 Security vulnerability reporting contact information

Structured Data (JSON-LD)

Every page includes JSON-LD structured data for rich search results:

  • - WebSite with SearchAction for sitelinks search box
  • - CollectionPage for category and index pages
  • - FAQPage on N-squared compare pages (unit-a vs unit-b)
  • - Article for blog posts with author and dates
  • - DefinedTerm for glossary term definitions
  • - WebApplication for interactive tools
  • - BreadcrumbList navigation breadcrumbs on all pages

Internationalization

All content pages include hreflang alternate links for 15 languages: English (default), Korean, Japanese, Chinese (Simplified), Spanish, French, German, Portuguese, Russian, Arabic, Hindi, Thai, Vietnamese, Indonesian, and Turkish.

10 — Usage

Rate Limits & Usage

Our APIs are free to use with no authentication required. To ensure fair access for everyone, please follow these guidelines:

  • + Free to use for any purpose
  • + No API key or authentication required
  • + CORS enabled for browser requests
  • + All responses are JSON with UTF-8 encoding
  • + OpenAPI 3.1 spec at /api/openapi.json
  • ~ Rate limit: 60 requests per minute per IP. Responses include X-RateLimit-Limit and X-RateLimit-Remaining headers
  • ~ Include a descriptive User-Agent header identifying your application
  • ~ Cache responses locally when possible — our API responses include Cache-Control headers
11 — Developer Tools

Python Package

Use UnitFYI offline with the Python package. Pure Python, zero dependencies.

Install
pip install unitfyi
Example
from decimal import Decimal
from unitfyi import convert

result = convert(Decimal("100"), "celsius", "fahrenheit")
print(result)  # Decimal("212")

result = convert(Decimal("1"), "kilometer", "mile")
print(result)  # Decimal("0.6213711922...")

PyPI · GitHub

Command-Line Interface

Unit conversion tools in your terminal.

Install & Use
pip install "unitfyi[cli]"

unitfyi convert 100 celsius fahrenheit    # 212
unitfyi categories                        # List all 20 categories
unitfyi units length                      # List units in a category
UnitFYI CLI demo

MCP Server

Add unit conversion tools to any AI assistant that supports Model Context Protocol.

Install
pip install "unitfyi[mcp]"
claude_desktop_config.json
{
  "mcpServers": {
    "unitfyi": {
      "command": "python",
      "args": ["-m", "unitfyi.mcp_server"]
    }
  }
}

Available tools

convert_unit conversion_table list_categories list_units

npm Package

TypeScript/JavaScript unit conversion engine with zero dependencies. Works in Node.js, Deno, Bun, and browsers.

Install
npm install unitfyi
Example
import { convert } from "unitfyi";

const fahrenheit = convert(100, "celsius", "fahrenheit");
console.log(fahrenheit); // 212

const miles = convert(1, "kilometer", "mile");
console.log(miles); // 0.6213711922...
unitfyi npm demo — Node.js REPL with unit conversion

npm · GitHub

12 — OpenAPI

OpenAPI Specification

A machine-readable OpenAPI 3.1 specification is available for all JSON API endpoints. Use it with tools like Swagger UI, Postman, or code generators.

Fetch via command line

curl -s "https://unitfyi.com/api/openapi.json" | python -m json.tool
Quick Reference

Quick Reference

Convert /api/convert/
Conversion Table /api/convert/table/
Categories /api/categories/
Category Detail /api/categories/{slug}/
Units /api/units/
Unit Detail /api/unit/{slug}/
Glossary /api/glossary/
Glossary Term /api/glossary/{slug}/
Blog Posts /api/blog/posts/
Search /api/search/?q=...
Tools /api/tools/
OpenAPI Spec /api/openapi.json
RSS Feed /blog/feed/
Atom Feed /blog/feed/atom/
llms.txt /llms.txt
Sitemap /sitemap.xml