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
{
"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
| Status | Code | What happened, and what to do |
|---|---|---|
| 400 | # MISSING_PARAMETER | A required parameter is missing. Add the parameter that the parameter field names. |
| 400 | # INVALID_PARAMETER | A parameter is outside its range or format. Send a value in the range shown on the Reference page. |
| 404 | # NOT_FOUND | No such light, or no such path. Check the light ID and the path. |
| 405 | # METHOD_NOT_ALLOWED | Only GET is supported. Send a GET request. |
| 422 | # EMPTY | The code is blank. Send a code. |
| 422 | # UNKNOWN_RHYTHM | The rhythm is not recognised. Start with a code such as Fl, Oc or Q. |
| 422 | # UNSUPPORTED_RHYTHM | This combined rhythm is outside v1. Use a single rhythm. |
| 422 | # UNSUPPORTED_ARRANGEMENT | This multi-lamp arrangement is outside v1. Use a single-lamp code. |
| 422 | # UNSUPPORTED_DIRECTIONAL | Directional codes are outside v1. Use a non-directional code. |
| 422 | # UNSUPPORTED_ALTERNATING | Alternation with this rhythm is outside v1. Use a different rhythm with alternation. |
| 422 | # BAD_GROUP | The group is invalid. Use values from 1 to 9. |
| 422 | # BAD_MORSE | Morse needs one to six letters in parentheses. |
| 422 | # BAD_PERIOD | The period is invalid. Use a number greater than zero. |
| 422 | # PERIOD_TOO_LONG | The period is over 300 seconds. Use 300 seconds or less. |
| 422 | # PERIOD_REQUIRED | A flashing light needs a period. Add one, such as 15s. |
| 422 | # DOES_NOT_FIT | The group does not fit in the period. Use a longer period or fewer flashes. |
| 422 | # BAD_COLOR_OR_TEXT | The colour is not recognised. Use W, R, G, Y, Bu, Vi, Or or Am. |
| 422 | # AMBIGUOUS_COLOR | B is ambiguous. Use Bu for blue. |
| 422 | # TRAILING_TEXT | Extra text follows the characteristic. Remove it. |
| 422 | # ALTERNATING_NEEDS_TWO_COLORS | An alternating light needs at least two colours. |
| 429 | # RATE_LIMITED | Too many requests. Wait the number of seconds in the Retry-After header. |
| 500 | # INTERNAL | The 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.
| Version | Changes |
|---|---|
1.0.0 | Draft, 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.
| Source | Licence | Where it comes from |
|---|---|---|
| U.S. Coast Guard Light List | U.S. federal public domain | navcen.uscg.gov/msi |
| NGA List of Lights | Public domain | msi.nga.mil (lights and buoys, by volume) |
Together the two lists hold 59,151 records. Duplicates are removed, and the first source wins.