API Directory › 🚀 Science & Space › Numbers API
No auth

Numbers API

Fun and interesting facts about numbers, dates and math — no key.

Auth
No auth needed
HTTPS
No
CORS
Unknown
Open Numbers API docs ↗

What it does

Numbers API returns a short, human-written fact about a number: a trivia fact, a mathematical property, a fact about that day of the year, or a fact about a year. Responses are plain text by default, or JSON on request.

Base URL

http://numbersapi.com

Authentication

None. Paths: /{number} or /{number}/trivia, /{number}/math, /{year}/year, /{month}/{day}/date. Use random in place of a number, and add ?json for a JSON body.

Code examples

curl
curl -s http://numbersapi.com/42
curl -s "http://numbersapi.com/random/year?json"
curl -s http://numbersapi.com/2/28/date
JavaScript
const fact = await fetch("http://numbersapi.com/7/math?json").then(r => r.json());
console.log(fact.text);  // "7 is the ... number ..."

Rate limits & quotas

No rate limit documented; it is a lightweight fun API. HTTPS is not reliably supported, so call it from a backend if your page is served over HTTPS. You can batch with a range or comma list (/1..5, /1,2,3) which returns a JSON object keyed by number.

Key response fields

(text body)The fact, as a sentence (default)
textThe fact (JSON mode)
numberThe number the fact is about
foundBoolean — false means a generic fallback fact was returned
typetrivia, math, date or year

Common errors

(found: false)No curated fact for that number — you got a generated fallback.
404Malformed path (e.g. bad month/day for the date type).
Mixed-content blockedHTTP-only — proxy through your server for HTTPS pages.

When to use it (and alternatives)

A nice touch for ‘on this day’ banners, loading-screen trivia, number-of-the-day widgets and teaching kids about numbers. For dad jokes or advice in the same spirit see Useless Facts or the Advice Slip API.

FAQ

What does found:false mean?

The API has a large but finite set of curated facts. When it has nothing for a number it returns a templated fallback (“X is the number of…”) and sets found to false so you can choose to skip it.

Can I get facts for many numbers at once?

Yes — /1..10 (range) or /2,3,5,7 (list) with ?json returns an object mapping each number to its fact.

Is there an HTTPS endpoint?

Not a dependable one. Fetch server-side and cache, then serve the fact from your own HTTPS origin.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON Formatter

Related Science & Space APIs

← Back

More Science & Space APIs · All 196 APIs