API Almanac
API REFERENCE · v0.1.0 · 49 OPERATIONS

API Almanac

Small, deterministic lookups and calculations — time zones, holidays, sunrise, units, country and currency facts, validators — behind one key. Every response is JSON. Static lookups are cacheable for a day; anything that depends on *now* is not cached.

Rate limits and plan ceilings are reported on every response in the X-Gw-* headers (X-Gw-Remaining, X-Gw-Reset), so clients and agents can pace themselves.

GETTING STARTED
Every request goes to https://api.apialmanac.com/ with your key in the X-API-Key header. What's left of your allowance rides back on every response in X-Gw-Remaining.
Get a key → · Sign in →
curl "https://api.apialmanac.com/v1/time/now" \
  -H "X-API-Key: YOUR_KEY"
FROM AN AI AGENT
This API is also an MCP server. Add https://mcp.apialmanac.com/ to Claude Code, Cursor or any MCP client with your key as a bearer token and every operation below becomes a tool — same key, same metering, same allowance. In a connector that only takes a URL, use the connector URL instead. Prompting a model by hand? Every operation has a Markdown version.
claude mcp add --transport http almanac https://mcp.apialmanac.com/ \
  --header "Authorization: Bearer YOUR_KEY"
ERRORS
Every operation can also answer with these, so they are listed once here rather than on each card.
400A parameter is missing, malformed or out of range
{
  "error": "string",
  "message": "string",
  "param": "string"
}
401Missing or invalid API key (from the gateway)
429Plan ceiling or rate limit reached; see X-Gw-Reset (from the gateway)

Time

GET/v1/time/now

The current time in a time zone, with offset, DST flag and ISO week

Pass at to describe a specific instant instead of now — handy for tests and for "what time is it in Tokyo when it's 9am in New York" when combined with /v1/time/convert.

PARAMETERS
tzquery · string
IANA zone, e.g. America/New_York
e.g. Europe/Paris
atquery · string
ISO-8601 instant to describe instead of now
e.g. 2026-07-01T12:00:00Z
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/time/now" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "zone": "Europe/Paris",
  "iso": "2026-07-01T14:00:00+02:00",
  "date": "2026-07-01",
  "time": "14:00:00",
  "weekday": "Wednesday",
  "utc": "2026-07-01T12:00:00Z",
  "unix": 1782907200,
  "offset": "+02:00",
  "offset_minutes": 120,
  "abbreviation": "GMT+2",
  "dst": true,
  "dst_observed": true,
  "iso_week": 27,
  "iso_week_year": 2026,
  "day_of_year": 182
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/time/convert

Convert a time from one zone to another

at is a wall-clock time in from (e.g. 2026-03-08T02:30) or an explicit instant with Z or offset. Wall times that fall in a DST gap are moved forward like most calendar apps do.

PARAMETERS
atquery · stringREQUIRED
Wall time in `from`, or an ISO-8601 instant
e.g. 2026-10-08T09:00
toquery · stringREQUIRED
Zone to convert to
e.g. Asia/Tokyo
fromquery · string
Zone `at` is expressed in
e.g. America/New_York
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/time/convert?at=2026-10-08T09%3A00&to=Asia%2FTokyo" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "input": "2026-10-08T09:00",
  "from": {
    "zone": "America/New_York",
    "iso": "2026-10-08T09:00:00-04:00",
    "offset": "-04:00"
  },
  "to": {
    "zone": "Asia/Tokyo",
    "iso": "2026-10-08T22:00:00+09:00",
    "offset": "+09:00"
  },
  "utc": "2026-10-08T13:00:00Z",
  "unix": 1791464400,
  "difference_minutes": 780,
  "difference": "+13:00"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/time/zones

Every IANA time zone with its current UTC offset and abbreviation

PARAMETERS
qquery · string
Filter: substring of the zone name, case-insensitive
e.g. america/
atquery · string
Instant to evaluate offsets at (default now)
e.g. string
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/time/zones" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "at": "2026-10-08T13:00:00Z",
  "count": 2,
  "zones": [
    {
      "zone": "America/New_York",
      "offset": "-04:00",
      "offset_minutes": -240,
      "abbreviation": "EDT"
    },
    {
      "zone": "America/Sao_Paulo",
      "offset": "-03:00",
      "offset_minutes": -180,
      "abbreviation": "GMT-3"
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Countries

GET/v1/countries/{code}/timezones

The IANA time zones a country uses, with current offsets

PARAMETERS
codepath · stringREQUIRED
ISO 3166-1 alpha-2
e.g. CA
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/countries/CA/timezones" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "country": "CA",
  "count": 2,
  "timezones": [
    {
      "zone": "America/Toronto",
      "comment": "Eastern - ON & QC (most areas)",
      "offset": "-04:00",
      "abbreviation": "EDT"
    },
    {
      "zone": "America/Vancouver",
      "comment": "Pacific - BC (most areas)",
      "offset": "-07:00",
      "abbreviation": "PDT"
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Date

GET/v1/date/diff

Days, weeks, months and business days between two dates

Business days count both ends when they are working days (like Excel's NETWORKDAYS). With country, public holidays are excluded too; without it, only the weekend is.

PARAMETERS
fromquery · stringREQUIRED
Start date
e.g. 2026-12-18
toquery · stringREQUIRED
End date
e.g. 2027-01-05
countryquery · string
Country for holidays and weekend definition
e.g. US
subdivisionquery · string
State / province for regional holidays
e.g. string
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/date/diff?from=2026-12-18&to=2027-01-05" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "from": "2026-12-18",
  "to": "2027-01-05",
  "days": 18,
  "weeks": 2.57,
  "calendar": {
    "years": 0,
    "months": 0,
    "days": 18
  },
  "business_days": 11,
  "weekend_days": 6,
  "holiday_days": 2,
  "calendar_used": "United States",
  "holidays": [
    {
      "date": "2026-12-25",
      "name": "Christmas Day"
    },
    {
      "date": "2027-01-01",
      "name": "New Year's Day"
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/date/add

Add calendar or business days to a date

Negative days go backwards. With business=true weekends (and holidays, if country is given) are skipped.

PARAMETERS
startquery · stringREQUIRED
Start date
e.g. 2026-12-23
daysquery · integerREQUIRED
Days to add (negative to subtract)
e.g. 5
businessquery · boolean
Count business days instead of calendar days
e.g. false
countryquery · string
Country for holidays and weekend definition
e.g. US
subdivisionquery · string
State / province for regional holidays
e.g. string
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/date/add?start=2026-12-23&days=5" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "start": "2026-12-23",
  "days": 5,
  "business": true,
  "result": "2026-12-31",
  "weekday": "Thursday",
  "calendar_days_elapsed": 8,
  "calendar_used": "United States",
  "skipped": [
    {
      "date": "2026-12-25",
      "reason": "Christmas Day"
    },
    {
      "date": "2026-12-26",
      "reason": "weekend"
    },
    {
      "date": "2026-12-27",
      "reason": "weekend"
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/date/parse

Turn natural language like "next Tuesday at 3pm" or "in 3 weeks" into ISO dates

Relative phrases are resolved against ref (default: now) in tz. Several dates in one text come back as separate results. certain says which parts were stated explicitly versus assumed.

PARAMETERS
textquery · stringREQUIRED
Text containing one or more dates
e.g. Let's meet next Tuesday at 3pm for an hour
refquery · string
Reference instant for relative phrases (ISO-8601, default now)
e.g. 2026-10-08T12:00:00Z
tzquery · string
Zone the text is spoken in
e.g. America/New_York
forwardquery · boolean
Prefer future dates for ambiguous phrases like "Friday"
e.g. true
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/date/parse?text=Let%27s+meet+next+Tuesday+at+3pm+for+an+hour" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "text": "Let's meet next Tuesday at 3pm for an hour",
  "ref": "2026-10-08T12:00:00Z",
  "zone": "America/New_York",
  "count": 1,
  "results": [
    {
      "text": "next Tuesday at 3pm",
      "index": 11,
      "start": {
        "iso": "2026-10-13T15:00:00-04:00",
        "utc": "2026-10-13T19:00:00Z",
        "date": "2026-10-13",
        "time": "15:00",
        "certain": {
          "date": true,
          "time": true
        }
      },
      "end": null
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/date/calendar

Convert a date to or from another calendar: Hebrew, Islamic, Persian, Chinese, Japanese eras, Julian and more

Give date to convert a Gregorian date *into* calendar; give year, month and day to convert *from* it. month accepts a name (Tishri, Ramadan, First Month) or a number, where numbers are the month's position in its year: a Hebrew or Chinese leap year has 13, so months_in_year is returned alongside. Names are the safer choice. Japanese years need era (meiji, taisho, showa, heisei, reiwa).

PARAMETERS
calendarquery · enumREQUIRED
Target or source calendar
one of: hebrew, islamic-umalqura, islamic-civil, persian, chinese, japanese, buddhist, indian, coptic, ethiopic, roc, julian
datequery · string
Gregorian date to convert (default: today)
e.g. 2026-10-09
yearquery · integer
Year in `calendar` (reverse conversion)
e.g. 1
monthquery · string
Month name or number in `calendar` (reverse conversion)
e.g. string
dayquery · integer
Day in `calendar` (reverse conversion)
e.g. 1
eraquery · string
Japanese era for reverse conversion
e.g. reiwa
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/date/calendar?calendar=hebrew" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "gregorian": "2026-10-09",
  "calendar": "hebrew",
  "label": "Hebrew",
  "year": 5787,
  "month": 1,
  "month_name": "Tishri",
  "months_in_year": 12,
  "day": 28,
  "era": "AM",
  "formatted": "28 Tishri 5787 AM",
  "weekday": "Friday"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/date/easter

Easter and the moveable feasts for a year, Western or Orthodox

PARAMETERS
yearquery · integer
Year (default: this year)
e.g. 2026
traditionquery · enum
Gregorian computus or the Julian one used by Orthodox churches
one of: western, orthodox
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/date/easter" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "year": 2026,
  "tradition": "western",
  "easter": "2026-04-05",
  "feasts": [
    {
      "name": "Ash Wednesday",
      "date": "2026-02-18",
      "offset_days": -46
    },
    {
      "name": "Good Friday",
      "date": "2026-04-03",
      "offset_days": -2
    },
    {
      "name": "Easter Sunday",
      "date": "2026-04-05",
      "offset_days": 0
    },
    {
      "name": "Pentecost",
      "date": "2026-05-24",
      "offset_days": 49
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Holidays

GET/v1/holidays

Public holidays for a country and year, optionally for one state or region

National holidays by default. Add subdivision (a state, province or region code such as TX or BY) to include regional ones. Years 2020–2030 for every country the data covers.

PARAMETERS
countryquery · stringREQUIRED
ISO 3166-1 alpha-2 code
e.g. US
yearquery · integer
Year (default: the current year)
e.g. 2026
subdivisionquery · string
State / province / region code
e.g. TX
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/holidays?country=US" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "country": "US",
  "name": "United States",
  "year": 2026,
  "subdivision": null,
  "weekend": [
    "Saturday",
    "Sunday"
  ],
  "count": 2,
  "holidays": [
    {
      "date": "2026-01-01",
      "weekday": "Thursday",
      "name": "New Year's Day",
      "national": true,
      "subdivisions": null
    },
    {
      "date": "2026-01-19",
      "weekday": "Monday",
      "name": "Martin Luther King Jr. Day",
      "national": true,
      "subdivisions": null
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/holidays/countries

Countries with holiday data, and their subdivisions

Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/holidays/countries" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "count": 2,
  "countries": [
    {
      "country": "US",
      "name": "United States",
      "subdivisions": 57,
      "years": "2020–2030"
    },
    {
      "country": "GB",
      "name": "United Kingdom",
      "subdivisions": 4,
      "years": "2020–2030"
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Cron

GET/v1/cron

Validate a cron expression, say it in English and list its next runs in a time zone

PARAMETERS
expressionquery · stringREQUIRED
Five-field cron or a macro like @daily
e.g. 0 9 * * 1-5
tzquery · string
Zone the schedule runs in
e.g. America/New_York
fromquery · string
Instant to start from (default now)
e.g. string
countquery · integer
How many upcoming runs
e.g. 5
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/cron?expression=0+9+%2A+%2A+1-5" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "expression": "0 9 * * 1-5",
  "normalized": "0 9 * * 1-5",
  "description": "At 09:00 Monday through Friday",
  "zone": "America/New_York",
  "from": "2026-10-09T15:00:00Z",
  "next": [
    {
      "utc": "2026-10-12T13:00:00Z",
      "local": "2026-10-12T09:00:00-04:00",
      "weekday": "Monday"
    },
    {
      "utc": "2026-10-13T13:00:00Z",
      "local": "2026-10-13T09:00:00-04:00",
      "weekday": "Tuesday"
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Sun

GET/v1/sun

Sunrise, sunset, solar noon, twilights and day length for a place and date

Times are UTC instants; add tz to get local wall-clock times as well. Inside the polar circles a day may have no sunrise or sunset — those fields are null and polar says which.

PARAMETERS
latquery · numberREQUIRED
Latitude in decimal degrees
e.g. 40.7128
lonquery · numberREQUIRED
Longitude in decimal degrees
e.g. -74.006
datequery · string
Civil date, YYYY-MM-DD (default: today, UTC)
e.g. 2026-06-21
tzquery · string
IANA zone for local times
e.g. America/New_York
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/sun?lat=40.7128&lon=-74.006" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "date": "2026-06-21",
  "location": {
    "lat": 40.7128,
    "lon": -74.006
  },
  "zone": "America/New_York",
  "polar": null,
  "sunrise": {
    "utc": "2026-06-21T09:25:00Z",
    "local": "2026-06-21T05:25:00-04:00"
  },
  "sunset": {
    "utc": "2026-06-22T00:31:00Z",
    "local": "2026-06-21T20:31:00-04:00"
  },
  "solar_noon": {
    "utc": "2026-06-21T16:58:00Z",
    "local": "2026-06-21T12:58:00-04:00"
  },
  "day_length": {
    "seconds": 54360,
    "text": "15h 06m"
  },
  "civil_twilight": {
    "dawn": {
      "utc": "2026-06-21T08:52:00Z"
    },
    "dusk": {
      "utc": "2026-06-22T01:04:00Z"
    }
  },
  "nautical_twilight": {
    "dawn": {
      "utc": "2026-06-21T08:10:00Z"
    },
    "dusk": {
      "utc": "2026-06-22T01:46:00Z"
    }
  },
  "astronomical_twilight": {
    "dawn": {
      "utc": "2026-06-21T07:22:00Z"
    },
    "dusk": {
      "utc": "2026-06-22T02:34:00Z"
    }
  },
  "golden_hour": {
    "morning_end": {
      "utc": "2026-06-21T10:03:00Z"
    },
    "evening_start": {
      "utc": "2026-06-21T23:53:00Z"
    }
  },
  "max_elevation_degrees": 72.7
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Moon

GET/v1/moon

Moon phase, illumination and the next new and full moons

Add lat and lon to get moonrise and moonset for that day.

PARAMETERS
datequery · string
Date or ISO-8601 instant (default now)
e.g. 2026-10-08
latquery · number
Latitude, for moonrise and moonset
e.g. -90
lonquery · number
Longitude, for moonrise and moonset
e.g. -180
tzquery · string
IANA zone for local times
e.g. string
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/moon" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "at": "2026-10-08T12:00:00Z",
  "phase": "Waning Crescent",
  "phase_fraction": 0.91,
  "illumination": 0.08,
  "age_days": 26.9,
  "waxing": false,
  "next_new_moon": "2026-10-10T15:50:00Z",
  "next_full_moon": "2026-10-26T04:12:00Z",
  "moonrise": null,
  "moonset": null
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Units

GET/v1/units

Every unit the converter knows, grouped by category

PARAMETERS
categoryquery · enum
Only this category
one of: length, mass, temperature, volume, area, speed, time, data, energy, pressure, power
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/units" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "categories": [
    {
      "category": "temperature",
      "base": "c",
      "units": [
        {
          "id": "c",
          "label": "degree Celsius",
          "aliases": [
            "°c",
            "celsius",
            "centigrade",
            "degc"
          ]
        },
        {
          "id": "f",
          "label": "degree Fahrenheit",
          "aliases": [
            "°f",
            "fahrenheit",
            "degf"
          ]
        },
        {
          "id": "k",
          "label": "kelvin",
          "aliases": [
            "kelvin",
            "kelvins"
          ]
        }
      ]
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/units/convert

Convert a value between two units of the same kind

Units are matched loosely: km/h, kph and kilometers per hour are the same thing.

PARAMETERS
valuequery · numberREQUIRED
The quantity to convert
e.g. 26.2
fromquery · stringREQUIRED
Unit of `value`
e.g. mi
toquery · stringREQUIRED
Unit to convert into
e.g. km
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/units/convert?value=26.2&from=mi&to=km" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "value": 26.2,
  "from": {
    "id": "mi",
    "label": "mile"
  },
  "to": {
    "id": "km",
    "label": "kilometre"
  },
  "category": "length",
  "result": 42.164813,
  "formatted": "42.164813 km"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Validate

GET/v1/validate/iban

Check an IBAN: country, length and mod-97 check digits

PARAMETERS
ibanquery · stringREQUIRED
IBAN, spaces allowed
e.g. GB82 WEST 1234 5698 7654 32
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/validate/iban?iban=GB82+WEST+1234+5698+7654+32" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "input": "GB82 WEST 1234 5698 7654 32",
  "iban": "GB82WEST12345698765432",
  "formatted": "GB82 WEST 1234 5698 7654 32",
  "country": "GB",
  "valid": true,
  "reason": null,
  "check_digits": "82",
  "bban": "WEST12345698765432"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/validate/email

Check an email address: syntax, normalised form, disposable and role-based flags, optional MX lookup

Set mx=true to also check that the domain publishes MX records (a live DNS query).

PARAMETERS
emailquery · stringREQUIRED
Address to check
e.g. Jane.Doe+news@gmail.com
mxquery · boolean
Also look up MX records for the domain
e.g. false
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/validate/email?email=Jane.Doe%2Bnews%40gmail.com" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "input": "Jane.Doe+news@gmail.com",
  "valid": true,
  "reason": null,
  "local": "Jane.Doe+news",
  "domain": "gmail.com",
  "tag": "news",
  "normalized": "janedoe@gmail.com",
  "disposable": false,
  "role_based": false,
  "mx": {
    "found": true,
    "records": [
      {
        "preference": 5,
        "exchange": "gmail-smtp-in.l.google.com"
      }
    ]
  }
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/validate/phone

Parse and validate a phone number: E.164, national format, type and region

PARAMETERS
numberquery · stringREQUIRED
Number in any common format
e.g. (415) 555-2671
countryquery · string
Default region when the number has no + prefix
e.g. US
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/validate/phone?number=%28415%29+555-2671" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "input": "(415) 555-2671",
  "valid": true,
  "possible": true,
  "e164": "+14155552671",
  "international": "+1 415 555 2671",
  "national": "(415) 555-2671",
  "rfc3966": "tel:+14155552671",
  "country": "US",
  "country_calling_code": "1",
  "national_number": "4155552671",
  "type": "FIXED_LINE_OR_MOBILE"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/validate/card

Check a payment card number: Luhn checksum, brand and length (nothing is stored)

Use it to catch typos before a payment form submits. It says nothing about whether the account exists or has funds.

PARAMETERS
numberquery · stringREQUIRED
Card number, spaces or dashes allowed
e.g. 4111 1111 1111 1111
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/validate/card?number=4111+1111+1111+1111" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "valid": true,
  "luhn": true,
  "brand": "Visa",
  "length": 16,
  "bin": "411111",
  "last4": "1111",
  "masked": "4111 •••• •••• 1111",
  "reason": null
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/validate/id

Check an identifier's check digit and format: ISBN, EAN/UPC/GTIN, ISSN, ISIN, CUSIP, SEDOL, VIN, IMEI, ABA routing, NPI, VAT number, Luhn

PARAMETERS
typequery · enumREQUIRED
Which identifier
one of: isbn, ean, upc, gtin, issn, isin, cusip, sedol, vin, imei, aba, npi
valuequery · stringREQUIRED
The identifier, separators allowed
e.g. 978-0-306-40615-7
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/validate/id?type=isbn&value=978-0-306-40615-7" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "type": "isbn",
  "input": "978-0-306-40615-7",
  "normalized": "9780306406157",
  "valid": true,
  "reason": null,
  "format": "ISBN-13",
  "isbn10": "0306406152",
  "isbn13": "9780306406157",
  "prefix": "978"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Dns

GET/v1/dns

Resolve a DNS record (A, AAAA, MX, TXT, NS, CNAME, SOA, CAA, SRV) via DNS over HTTPS

PARAMETERS
namequery · stringREQUIRED
Hostname to resolve
e.g. cloudflare.com
typequery · enum
Record type
one of: A, AAAA, MX, TXT, NS, CNAME, SOA, CAA, SRV, PTR, HTTPS
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/dns?name=cloudflare.com" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "name": "cloudflare.com",
  "type": "MX",
  "status": "NOERROR",
  "dnssec_validated": true,
  "answers": [
    {
      "name": "cloudflare.com",
      "type": "MX",
      "ttl": 300,
      "data": {
        "preference": 10,
        "exchange": "mailstream-east.mxrecord.io"
      }
    },
    {
      "name": "cloudflare.com",
      "type": "MX",
      "ttl": 300,
      "data": {
        "preference": 20,
        "exchange": "mailstream-central.mxrecord.mx"
      }
    }
  ],
  "authority": []
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Useragent

GET/v1/useragent

Parse a browser User-Agent string into browser, engine, OS and device

Omit ua to parse the User-Agent of the request itself.

PARAMETERS
uaquery · string
User-Agent string
e.g. Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/useragent" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",
  "browser": {
    "name": "Mobile Safari",
    "version": "17.5",
    "major": "17"
  },
  "engine": {
    "name": "WebKit",
    "version": "605.1.15"
  },
  "os": {
    "name": "iOS",
    "version": "17.5"
  },
  "device": {
    "type": "mobile",
    "vendor": "Apple",
    "model": "iPhone"
  },
  "cpu": {
    "architecture": null
  },
  "bot": false
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Hash

GET/v1/hash

MD5, SHA-1, SHA-256, SHA-384 or SHA-512 of a string

The text is hashed as UTF-8 and never stored. For files, hash locally — this is for short strings and checksums.

PARAMETERS
textquery · stringREQUIRED
Text to hash (UTF-8)
e.g. hello
algoquery · enum
Algorithm
one of: md5, sha1, sha256, sha384, sha512
encodingquery · enum
Output encoding
one of: hex, base64
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/hash?text=hello" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "algo": "sha256",
  "encoding": "hex",
  "length": 5,
  "hash": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Uuid

GET/v1/uuid

Generate UUIDs (v4 random or v7 time-ordered)

PARAMETERS
versionquery · enum
4 = random, 7 = time-ordered (sorts by creation time)
one of: 4, 7
countquery · integer
How many
e.g. 1
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/uuid" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "version": 7,
  "count": 2,
  "uuids": [
    "019a1d2e-8f3c-7b10-9c4e-2a6f1b7d8e90",
    "019a1d2e-8f3c-7b11-8d5f-3b7a2c8e9f01"
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Numbers

GET/v1/numbers/words

Spell an integer in English words, cardinal or ordinal

PARAMETERS
nquery · stringREQUIRED
The integer
e.g. 1234
ordinalquery · boolean
true → "one thousand two hundred thirty-fourth"
e.g. false
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/numbers/words?n=1234" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "n": "1234",
  "words": "one thousand two hundred thirty-four",
  "ordinal": false
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/numbers/roman

Convert between integers (1–3999) and Roman numerals

Give n to encode or roman to decode.

PARAMETERS
nquery · integer
Integer to encode
e.g. 1994
romanquery · string
Numeral to decode
e.g. MCMXCIV
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/numbers/roman" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "n": 1994,
  "roman": "MCMXCIV"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Semver

GET/v1/semver

Parse and sort semantic versions, compare two, and test them against an npm-style range

PARAMETERS
versionsquery · stringREQUIRED
Comma-separated versions
e.g. 1.2.3, 1.10.0, 1.2.3-beta.1, 2.0.0-rc.1, v0.9.9
rangequery · string
Range to test, e.g. ^1.2.0, ~1.2.3, >=1.0.0 <2.0.0, 1.x, 1.2.3 - 1.9.0, >=2 || <1
e.g. ^1.2.0
comparequery · string
Two versions separated by a comma to compare directly
e.g. 1.10.0,1.9.9
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/semver?versions=1.2.3%2C+1.10.0%2C+1.2.3-beta.1%2C+2.0.0-rc.1%2C+v0.9.9" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "versions": [
    {
      "input": "1.10.0",
      "valid": true,
      "version": "1.10.0",
      "major": 1,
      "minor": 10,
      "patch": 0,
      "prerelease": [],
      "build": []
    },
    {
      "input": "1.2.3-beta.1",
      "valid": true,
      "version": "1.2.3-beta.1",
      "major": 1,
      "minor": 2,
      "patch": 3,
      "prerelease": [
        "beta",
        "1"
      ],
      "build": []
    }
  ],
  "sorted": [
    "1.2.3-beta.1",
    "1.10.0"
  ],
  "lowest": "1.2.3-beta.1",
  "highest": "1.10.0",
  "range": {
    "input": "^1.2.0",
    "matches": [
      "1.10.0"
    ],
    "highest_match": "1.10.0"
  },
  "compare": {
    "a": "1.10.0",
    "b": "1.9.9",
    "result": 1,
    "relation": "1.10.0 > 1.9.9"
  }
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Color

GET/v1/color

Parse a color (hex, rgb(), hsl(), CSS name), convert it, name it, and check WCAG contrast against another

PARAMETERS
valuequery · stringREQUIRED
The color
e.g. #2F6B4F
comparequery · string
A second color for contrast (e.g. the background)
e.g. #FAF7F0
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/color?value=%232F6B4F" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "input": "#2F6B4F",
  "hex": "#2f6b4f",
  "hex_alpha": null,
  "rgb": {
    "r": 47,
    "g": 107,
    "b": 79
  },
  "alpha": 1,
  "css": "rgb(47 107 79)",
  "hsl": {
    "h": 152,
    "s": 39,
    "l": 30,
    "css": "hsl(152 39% 30%)"
  },
  "hsv": {
    "h": 152,
    "s": 56,
    "v": 42
  },
  "cmyk": {
    "c": 56,
    "m": 0,
    "y": 26,
    "k": 58
  },
  "luminance": 0.11,
  "is_dark": true,
  "text_on_it": "#ffffff",
  "name": null,
  "nearest_named": {
    "name": "seagreen",
    "hex": "#2e8b57",
    "distance": 19.6,
    "metric": "CIE76 ΔE"
  },
  "complementary": "#6b2f4b",
  "contrast": {
    "with": "#faf7f0",
    "ratio": 5.68,
    "aa_normal_text": true,
    "aa_large_text": true,
    "aaa_normal_text": false,
    "aaa_large_text": true
  }
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Countries

GET/v1/countries

All countries and territories (ISO 3166) with capital, region, currencies, dial codes and flag

PARAMETERS
qquery · string
Substring of the name
e.g. island
regionquery · string
Africa, Americas, Asia, Europe or Oceania
e.g. Europe
subregionquery · string
e.g. Western Europe, Caribbean
e.g. string
continentquery · string
AF, AN, AS, EU, NA, OC or SA
e.g. string
currencyquery · string
Only countries using this ISO 4217 currency
e.g. EUR
independentquery · boolean
true for sovereign states only, false for territories only
e.g. true
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/countries" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "count": 1,
  "countries": [
    {
      "code": "FR",
      "alpha3": "FRA",
      "numeric": "250",
      "name": "France",
      "official_name": "the French Republic",
      "capital": "Paris",
      "continent": "EU",
      "region": "Europe",
      "subregion": "Western Europe",
      "intermediate_region": null,
      "currencies": [
        "EUR"
      ],
      "currency_names": [
        "Euro"
      ],
      "calling_codes": [
        "33"
      ],
      "tld": ".fr",
      "languages": [
        "fr-FR",
        "frp",
        "br",
        "co",
        "ca",
        "eu",
        "oc"
      ],
      "flag": "🇫🇷",
      "independent": true,
      "landlocked": false,
      "least_developed": false,
      "small_island": false,
      "fips": "FR",
      "ioc": "FRA",
      "fifa": "FRA",
      "geoname_id": 3017382,
      "wikidata": "Q142"
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/countries/{code}

One country by ISO alpha-2, alpha-3, numeric code or exact name

PARAMETERS
codepath · stringREQUIRED
FR, FRA, 250 or France
e.g. FR
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/countries/FR" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "code": "FR",
  "alpha3": "FRA",
  "numeric": "250",
  "name": "France",
  "official_name": "the French Republic",
  "capital": "Paris",
  "continent": "EU",
  "region": "Europe",
  "subregion": "Western Europe",
  "intermediate_region": null,
  "currencies": [
    "EUR"
  ],
  "currency_names": [
    "Euro"
  ],
  "calling_codes": [
    "33"
  ],
  "tld": ".fr",
  "languages": [
    "fr-FR",
    "frp",
    "br",
    "co",
    "ca",
    "eu",
    "oc"
  ],
  "flag": "🇫🇷",
  "independent": true,
  "landlocked": false,
  "least_developed": false,
  "small_island": false,
  "fips": "FR",
  "ioc": "FRA",
  "fifa": "FRA",
  "geoname_id": 3017382,
  "wikidata": "Q142"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Currencies

GET/v1/currencies

ISO 4217 currencies in circulation with minor units, symbols and where they are used

PARAMETERS
qquery · string
Substring of the name or an entity using it
e.g. dollar
kindquery · enum
`special` = funds, metals and test codes (X…)
one of: currency, special
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/currencies" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "count": 1,
  "currencies": [
    {
      "code": "EUR",
      "name": "Euro",
      "numeric": "978",
      "minor_unit": 2,
      "symbol": "€",
      "kind": "currency",
      "entities": [
        "Andorra",
        "Austria",
        "Belgium"
      ]
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/currencies/{code}

One currency by ISO 4217 code

PARAMETERS
codepath · stringREQUIRED
ISO 4217 alphabetic code
e.g. JPY
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/currencies/JPY" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "code": "JPY",
  "name": "Yen",
  "numeric": "392",
  "minor_unit": 0,
  "symbol": "¥",
  "kind": "currency",
  "entities": [
    "Japan"
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Languages

GET/v1/languages

ISO 639 languages with two- and three-letter codes

PARAMETERS
qquery · string
Substring of the English name
e.g. chin
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/languages" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "count": 1,
  "languages": [
    {
      "alpha2": "fr",
      "alpha3": "fra",
      "alpha3_b": "fre",
      "name": "French",
      "aliases": [],
      "french": "français"
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/languages/{code}

One language by ISO 639-1 (fr) or 639-2 (fra / fre) code

PARAMETERS
codepath · stringREQUIRED
Two- or three-letter code
e.g. fr
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/languages/fr" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "alpha2": "fr",
  "alpha3": "fra",
  "alpha3_b": "fre",
  "name": "French",
  "aliases": [],
  "french": "français"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Naics

GET/v1/naics

Search NAICS 2022 industry codes by title, or list a level (2 = sectors … 6 = national industries)

Without q or level, returns the 20 two-digit sectors.

PARAMETERS
qquery · string
Words in the industry title
e.g. software
levelquery · integer
Code length to return
e.g. 2
limitquery · integer
Maximum results
e.g. 50
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/naics" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "count": 2,
  "total": 2,
  "industries": [
    {
      "code": "511210",
      "title": "Software Publishers",
      "level": 6
    },
    {
      "code": "5112",
      "title": "Software Publishers",
      "level": 4
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/naics/{code}

One NAICS code with its parents up to the sector and its direct children

PARAMETERS
codepath · stringREQUIRED
NAICS code
e.g. 541511
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/naics/541511" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "code": "541511",
  "title": "Custom Computer Programming Services",
  "level": 6,
  "parents": [
    {
      "code": "54",
      "title": "Professional, Scientific, and Technical Services",
      "level": 2
    },
    {
      "code": "541",
      "title": "Professional, Scientific, and Technical Services",
      "level": 3
    },
    {
      "code": "5415",
      "title": "Computer Systems Design and Related Services",
      "level": 4
    },
    {
      "code": "54151",
      "title": "Computer Systems Design and Related Services",
      "level": 5
    }
  ],
  "children": []
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Locale

GET/v1/locale

How a locale writes things: first day of week, weekend, 12/24-hour clock, number and currency formats, date patterns, text direction

Pass currency to see money formatting, amount and date to format your own values. Everything comes from CLDR via the runtime.

PARAMETERS
tagquery · stringREQUIRED
BCP 47 locale tag
e.g. de-DE
currencyquery · string
Currency to format (default: the region's)
e.g. EUR
amountquery · number
Number to format in the examples (default 1234567.891)
e.g. 1.5
datequery · string
Date to format in the examples
e.g. string
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/locale?tag=de-DE" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "tag": "de-DE",
  "language": "de",
  "script": "Latn",
  "region": "DE",
  "likely_subtags": "de-Latn-DE",
  "direction": "ltr",
  "week": {
    "first_day": "Monday",
    "first_day_iso": 1,
    "weekend": [
      "Saturday",
      "Sunday"
    ],
    "minimal_days_in_first_week": 4
  },
  "hour_cycle": "h23",
  "calendars": [
    "gregory"
  ],
  "numbering_systems": [
    "latn"
  ],
  "measurement_system": "metric",
  "paper_size": "A4",
  "number": {
    "example": "1.234.567,891",
    "decimal_separator": ",",
    "group_separator": ".",
    "numbering_system": "latn",
    "percent_example": "25,6 %",
    "compact_example": "1,2 Mio."
  },
  "currency": {
    "currency": "EUR",
    "example": "1.234.567,89 €",
    "symbol": "€",
    "symbol_position": "after",
    "accounting_negative": "-1.234.567,89 €",
    "minor_units": 2
  },
  "dates": {
    "short": {
      "pattern": "dd.MM.yy",
      "example": "09.10.26"
    },
    "medium": {
      "pattern": "dd.MM.yyyy",
      "example": "09.10.2026"
    },
    "long": {
      "example": "9. Oktober 2026"
    },
    "full": {
      "example": "Freitag, 9. Oktober 2026"
    },
    "time_short": "14:30",
    "uses_12_hour_clock": false
  },
  "names": {
    "language": {
      "english": "German",
      "native": "Deutsch"
    },
    "region": {
      "code": "DE",
      "english": "Germany",
      "native": "Deutschland"
    },
    "script": {
      "code": "Latn",
      "english": "Latin"
    }
  }
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Airports

GET/v1/airports

Find airports by IATA or ICAO code, country, or a word in the name or city

At least one filter is required; results are capped by limit. Large airports with scheduled service sort first.

PARAMETERS
iataquery · string
IATA code
e.g. JFK
icaoquery · string
ICAO code
e.g. KJFK
countryquery · string
ISO 3166-1 alpha-2
e.g. US
qquery · string
Substring of the airport name or city
e.g. new york
typequery · enum
Airport size class
one of: large, medium, small
limitquery · integer
Maximum results
e.g. 20
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/airports" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "count": 1,
  "total": 1,
  "airports": [
    {
      "iata": "JFK",
      "icao": "KJFK",
      "name": "John F Kennedy International Airport",
      "type": "large",
      "city": "New York",
      "country": "US",
      "region": "US-NY",
      "continent": "NA",
      "lat": 40.63975,
      "lon": -73.77893,
      "elevation_ft": 13,
      "scheduled_service": true
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/airports/{code}

One airport by IATA (3 letters) or ICAO (4 letters) code

PARAMETERS
codepath · stringREQUIRED
IATA or ICAO code
e.g. LHR
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/airports/LHR" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "iata": "JFK",
  "icao": "KJFK",
  "name": "John F Kennedy International Airport",
  "type": "large",
  "city": "New York",
  "country": "US",
  "region": "US-NY",
  "continent": "NA",
  "lat": 40.63975,
  "lon": -73.77893,
  "elevation_ft": 13,
  "scheduled_service": true
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Postal

GET/v1/postal/us/{zip}

City, state, county and coordinates for a US ZIP code

ZIP+4 is accepted; the +4 is ignored.

PARAMETERS
zippath · stringREQUIRED
ZIP code
e.g. 10001
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/postal/us/10001" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "postal_code": "10001",
  "country": "US",
  "city": "New York",
  "state": "New York",
  "state_code": "NY",
  "county": "New York",
  "lat": 40.7484,
  "lon": -73.9967,
  "attribution": "Postal code data © GeoNames (geonames.org), CC BY 4.0"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Cities

GET/v1/cities

Find cities by name: coordinates, population, time zone and the local time there now

Cities of 15,000+ people worldwide. Name matches are prefix first, then substring; results are ordered by population, so q=paris puts Paris, France before Paris, Texas. Add country to narrow.

PARAMETERS
qquery · stringREQUIRED
City name (any script; ASCII spellings work too)
e.g. denver
countryquery · string
ISO 3166-1 alpha-2
e.g. US
limitquery · integer
Maximum results
e.g. 10
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/cities?q=denver" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "count": 1,
  "total": 1,
  "cities": [
    {
      "id": 5419384,
      "name": "Denver",
      "ascii_name": "Denver",
      "country": "US",
      "admin1": "Colorado",
      "admin1_code": "CO",
      "lat": 39.7392,
      "lon": -104.9847,
      "population": 715522,
      "elevation_m": 1609,
      "timezone": "America/Denver",
      "offset": "-06:00",
      "abbreviation": "MDT",
      "local_time": "2026-10-09T10:30:00-06:00"
    }
  ],
  "attribution": "City data © GeoNames (geonames.org), CC BY 4.0"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/cities/nearest

Nearest cities to a coordinate, with distance and time zone (a coarse reverse geocode)

Cities of 15,000+ people only, so remote coordinates return the nearest town some distance away; distance_km says how far.

PARAMETERS
latquery · numberREQUIRED
Latitude
e.g. 40.6413
lonquery · numberREQUIRED
Longitude
e.g. -73.7781
limitquery · integer
How many
e.g. 5
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/cities/nearest?lat=40.6413&lon=-73.7781" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "query": {
    "lat": 40.6413,
    "lon": -73.7781
  },
  "count": 1,
  "cities": [
    {
      "id": 5125771,
      "name": "Jamaica",
      "ascii_name": "Jamaica",
      "country": "US",
      "admin1": "New York",
      "admin1_code": "NY",
      "lat": 40.6915,
      "lon": -73.8057,
      "population": 216866,
      "elevation_m": 11,
      "timezone": "America/New_York",
      "offset": "-04:00",
      "abbreviation": "EDT",
      "local_time": "2026-10-09T12:30:00-04:00",
      "distance_km": 6.1,
      "bearing": 338
    }
  ],
  "attribution": "City data © GeoNames (geonames.org), CC BY 4.0"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/cities/{id}

One city by its GeoNames id

PARAMETERS
idpath · integerREQUIRED
GeoNames id
e.g. 5419384
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/cities/5419384" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "id": 5419384,
  "name": "Denver",
  "ascii_name": "Denver",
  "country": "US",
  "admin1": "Colorado",
  "admin1_code": "CO",
  "lat": 39.7392,
  "lon": -104.9847,
  "population": 715522,
  "elevation_m": 1609,
  "timezone": "America/Denver",
  "offset": "-06:00",
  "abbreviation": "MDT",
  "local_time": "2026-10-09T10:30:00-06:00",
  "attribution": "City data © GeoNames (geonames.org), CC BY 4.0"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Geo

GET/v1/geo/distance

Great-circle distance, bearings, midpoint and bounding box between two coordinates

Give lat2/lon2 for a second point, or bearing and distance_km to project from the first point instead. radius_km adds a bounding box around the first point, handy for "within 25 km" searches.

PARAMETERS
lat1query · numberREQUIRED
First point latitude
e.g. 40.7128
lon1query · numberREQUIRED
First point longitude
e.g. -74.006
lat2query · number
Second point latitude
e.g. 51.5074
lon2query · number
Second point longitude
e.g. -0.1278
bearingquery · number
Projection: initial bearing in degrees
e.g. 0
distance_kmquery · number
Projection: distance to travel
e.g. 0
radius_kmquery · number
Bounding box radius around the first point
e.g. 0
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/geo/distance?lat1=40.7128&lon1=-74.006" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "from": {
    "lat": 40.7128,
    "lon": -74.006
  },
  "to": {
    "lat": 51.5074,
    "lon": -0.1278
  },
  "distance": {
    "km": 5570.2,
    "mi": 3461.2,
    "nmi": 3007.7,
    "m": 5570222
  },
  "initial_bearing": 51.2,
  "final_bearing": 108.3,
  "compass": "NE",
  "midpoint": {
    "lat": 52.3,
    "lon": -41.7
  },
  "bounding_box": {
    "south": 40.7128,
    "north": 51.5074,
    "west": -74.006,
    "east": -0.1278
  },
  "note": "great-circle on a sphere of radius 6371.0088 km"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Fx

GET/v1/fx

Daily exchange rates for ~30 currencies (ECB reference rates), rebased to any of them

PARAMETERS
basequery · string
Base currency
e.g. USD
symbolsquery · string
Only these currencies
e.g. EUR,GBP,JPY
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/fx" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "base": "USD",
  "date": "2026-10-07",
  "rates": {
    "EUR": 0.8531,
    "GBP": 0.7452,
    "JPY": 149.21
  },
  "count": 3,
  "source": "European Central Bank euro foreign exchange reference rates (ecb.europa.eu). Indicative only."
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

GET/v1/fx/convert

Convert an amount between two currencies at the latest ECB reference rate

PARAMETERS
amountquery · numberREQUIRED
Amount in `from`
e.g. 100
fromquery · stringREQUIRED
Currency of `amount`
e.g. USD
toquery · stringREQUIRED
Currency to convert into
e.g. EUR
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/fx/convert?amount=100&from=USD&to=EUR" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "amount": 100,
  "from": "USD",
  "to": "EUR",
  "rate": 0.8531,
  "result": 85.31,
  "date": "2026-10-07",
  "source": "European Central Bank euro foreign exchange reference rates (ecb.europa.eu). Indicative only."
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Markets

GET/v1/markets

Is a market open right now? Session, next open and close, holidays and early closes (NYSE, NASDAQ, LSE, ECB, B3)

Regular sessions only, no pre- or after-hours. ECB means TARGET2 business days, which is what euro settlement and most European contracts key on.

PARAMETERS
marketquery · enumREQUIRED
Market code
one of: NYSE, NASDAQ, LSE, ECB, B3
atquery · string
ISO-8601 instant to evaluate (default now)
e.g. 2026-11-27T18:30:00Z
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/markets?market=NYSE" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "market": "NYSE",
  "name": "New York Stock Exchange",
  "timezone": "America/New_York",
  "at": {
    "utc": "2026-11-27T18:30:00Z",
    "local": "2026-11-27T13:30:00-05:00"
  },
  "status": "closed",
  "reason": "after the early close (Day after Thanksgiving)",
  "session": {
    "date": "2026-11-27",
    "open": {
      "utc": "2026-11-27T14:30:00Z",
      "local": "2026-11-27T09:30:00-05:00"
    },
    "close": {
      "utc": "2026-11-27T18:00:00Z",
      "local": "2026-11-27T13:00:00-05:00"
    },
    "early_close": "Day after Thanksgiving"
  },
  "next_open": {
    "utc": "2026-11-30T14:30:00Z",
    "local": "2026-11-30T09:30:00-05:00"
  },
  "next_close": {
    "utc": "2026-11-30T21:00:00Z",
    "local": "2026-11-30T16:00:00-05:00"
  },
  "previous_close": {
    "utc": "2026-11-27T18:00:00Z",
    "local": "2026-11-27T13:00:00-05:00"
  },
  "regular_hours": "09:30–16:00 America/New_York",
  "source": "python-holidays financial calendar NYSE"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.

Loan

GET/v1/loan

Monthly payment, total interest, yearly summary and optional full schedule for a loan or mortgage

rate is the annual percentage rate. Give years or months. extra is an additional principal payment each month; start dates the schedule.

PARAMETERS
principalquery · numberREQUIRED
Amount borrowed
e.g. 400000
ratequery · numberREQUIRED
Annual interest rate, percent
e.g. 6.25
yearsquery · number
Term in years
e.g. 30
monthsquery · integer
Term in months (overrides years)
e.g. 1
extraquery · number
Extra principal paid every month
e.g. 0
startquery · string
Date of the first payment
e.g. string
schedulequery · boolean
Include every monthly row (up to 1,200)
e.g. false
Open on its own page
REQUEST
curl "https://api.apialmanac.com/v1/loan?principal=400000&rate=6.25" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "principal": 400000,
  "rate": 6.25,
  "months": 360,
  "payment": 2462.87,
  "total_paid": 886633.2,
  "total_interest": 486633.2,
  "extra": 0,
  "payoff_months": 360,
  "payoff_date": null,
  "yearly": [
    {
      "year": 1,
      "paid": 29554.44,
      "principal": 4694.14,
      "interest": 24860.3,
      "balance": 395305.86
    }
  ],
  "schedule": []
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.