POST /api/viewport
Sends the current map viewport bounds to the backend, which uses them to filter the AIS WebSocket stream to vessels in the visible area. This reduces memory and CPU overhead when the map is zoomed in on a small region.
Rate limit: 60 requests per minute per IP.
How it works
The frontend calls this endpoint automatically on every map pan or zoom event. The backend applies a 10% padding around the provided bounds before passing them to the AIS stream filter, so vessels don’t abruptly disappear at the exact viewport edge. For example, if the map shows latitudes 48–50°N, the backend filters for vessels between approximately 47.8–50.2°N.This endpoint is called automatically by the ShadowBroker frontend. You only need to call it manually if you are building a custom client.
Request body
South bound of the viewport (latitude, −90 to 90).
West bound of the viewport (longitude, −180 to 180).
North bound of the viewport (latitude, −90 to 90).
East bound of the viewport (longitude, −180 to 180).
Response
Always
"ok".