Skip to content
Lighthouse Lights APIDeveloper docs · v1

Errors, limits and notes

Errors use problem details (RFC 9457). Each has a stable code, a plain sentence in detail, and a request_id. Treat any code you do not recognise as a generic failure.

The shape of an error

Response · 422 · application/problem+json
{
  "type": "https://sagar.build/lighthouse/api/errors#DOES_NOT_FIT",
  "title": "The light code cannot be read",
  "status": 422,
  "code": "DOES_NOT_FIT",
  "detail": "That group does not fit its period; use a longer period or fewer flashes.",
  "request_id": "ecb56945-777c-4652-b1a6-c202044081df"
}

parameter appears when one parameter is at fault. Quote request_id when you report a problem.

Error codes

StatusCodeWhat happened, and what to do
400# MISSING_PARAMETERA required parameter is missing. Add the parameter that the parameter field names.
400# INVALID_PARAMETERA parameter is outside its range or format. Send a value in the range shown on the Reference page.
404# NOT_FOUNDNo such light, or no such path. Check the light ID and the path.
405# METHOD_NOT_ALLOWEDOnly GET is supported. Send a GET request.
422# EMPTYThe code is blank. Send a code.
422# UNKNOWN_RHYTHMThe rhythm is not recognised. Start with a code such as Fl, Oc or Q.
422# UNSUPPORTED_RHYTHMThis combined rhythm is outside v1. Use a single rhythm.
422# UNSUPPORTED_ARRANGEMENTThis multi-lamp arrangement is outside v1. Use a single-lamp code.
422# UNSUPPORTED_DIRECTIONALDirectional codes are outside v1. Use a non-directional code.
422# UNSUPPORTED_ALTERNATINGAlternation with this rhythm is outside v1. Use a different rhythm with alternation.
422# BAD_GROUPThe group is invalid. Use values from 1 to 9.
422# BAD_MORSEMorse needs one to six letters in parentheses.
422# BAD_PERIODThe period is invalid. Use a number greater than zero.
422# PERIOD_TOO_LONGThe period is over 300 seconds. Use 300 seconds or less.
422# PERIOD_REQUIREDA flashing light needs a period. Add one, such as 15s.
422# DOES_NOT_FITThe group does not fit in the period. Use a longer period or fewer flashes.
422# BAD_COLOR_OR_TEXTThe colour is not recognised. Use W, R, G, Y, Bu, Vi, Or or Am.
422# AMBIGUOUS_COLORB is ambiguous. Use Bu for blue.
422# TRAILING_TEXTExtra text follows the characteristic. Remove it.
422# ALTERNATING_NEEDS_TWO_COLORSAn alternating light needs at least two colours.
429# RATE_LIMITEDToo many requests. Wait the number of seconds in the Retry-After header.
500# INTERNALThe service could not answer. Try again later.

Limits and versioning

Requests

60 requests a minute per caller. Every answer includes RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. A refused request gets status 429 with Retry-After.

Caching

Answers may be cached for an hour (Cache-Control: public, max-age=3600). Refused answers (429) are sent with Cache-Control: no-store.

Versions

Version 1 is the only version. Within it, changes are additive: new fields, endpoints, optional parameters and error codes. A change that removes or renames something needs a new major version. Anything retired is announced in the changelog and kept working for at least 90 days. The timing model has its own version, and a change to it is announced in the changelog even if no field changes.

VersionChanges
1.0.0Draft, unreleased: first local build. Decode, search, lookup, nearby, sources, health, contract, rate limit.

Data and credits

The API reads two public lists, both retrieved on October 28, 2026. Every light says which source it came from, and GET /v1/sources returns the record count and details for each.

SourceLicenceWhere it comes from
U.S. Coast Guard Light ListU.S. federal public domainnavcen.uscg.gov/msi
NGA List of LightsPublic domainmsi.nga.mil (lights and buoys, by volume)

Together the two lists hold 59,151 records. Duplicates are removed, and the first source wins.