One endpoint, and the counts behind every entry and exit chart: how many vessels crossed into and out of a zone over a period, bucketed the way you ask for it.Zone Insights tells you which vessels crossed and when. This tells you how many.
GET /v1/analytics/zones/{id_type}/{id}/entries-exits
How many vessels entered and left over this period, broken down how I asked?
It takes a zone identifier, a date range, and two required parameters that between them decide the shape of the response.
This endpoint sits behind a base path of its own
Zone Analytics is served by our maritime analytics service, which the gateway reaches at /maritime-analytics. Call it at https://api.polestar-production.com/maritime-analytics/v1/analytics/zones/id/{id}/entries-exits. The reference page shows the path the service sees, without that prefix, because every other Insights endpoint carries its service prefix in the path itself and this one carries it in the base URL.
The path reads {id_type}/{id}, and id_type has exactly one legal value: id, followed by the zone UUID. Ports accept a UN/LOCODE as a second form of identifier; zones have no equivalent, so the discriminator has nothing to discriminate between.
Get the UUID from GET /zone-port-insights/v1/zones, the same identifier every other zone endpoint takes. Custom zones work here too, so you can baseline activity in an area you drew yourself.
group_by and period_aggregation are both required, and the combination you pick decides what comes back. There are three useful ones:
group_by
period_aggregation
What you get
Chart it as
NONE
DAILY, WEEKLY, MONTHLY, QUARTERLY or YEARLY
One data point per period, each holding a single combined entry and exit count
A line over time
VESSEL_TYPE
any period (any of DAILY, WEEKLY, MONTHLY, QUARTERLY or YEARLY, excluding NONE)
One data point per period, each holding one item per vessel type
A stacked or clustered bar
VESSEL_TYPE
NONE
A single data point holding one item per vessel type, summed across the whole range
A donut or a pie
NONE and NONE together is not a useful pair and not a shape worth asking for.When group_by is NONE, every items array holds exactly one element, with group_by_key set to "none". Vessel types with nothing in a period are left out of that period rather than returned as zero, so do not rely on a fixed number of items per bucket.
The period key is the end of the period, not the start
period_key is always the last calendar day of its bucket: the Sunday that closes a week, the last day of a month or quarter. It stays the end of the full period even when your date_end falls part way through one, so a chart axis built from it will not shift as you extend the range.
Four optional filters, all repeatable where they take a list:
vessel_types, ship type level-3 names such as Chemical Tanker or Bulk Carrier
vessel_class, size and capability classes within a type
flag_codes, ISO 3166-1 alpha-2 codes such as NO or GB
top_visitors_limit and top_visitors_sort, which shape the top_visitors array rather than the counts
Omit a filter and we include everything in that dimension. The totals object reflects the whole range after every filter has been applied, so it agrees with the data array rather than describing the unfiltered zone.
Zone Analytics counts all 16 vessel type categories, commercial and non-commercial: the eleven commercial types, plus Fish Processing, Offshore Production/Support, Other Types, Passenger and Tow Boat.This is the one place the two analytics endpoints differ in what they see. Port Analytics covers commercial vessels only, across 11 categories. A zone and a port over the same water will not return the same counts, and the difference is coverage rather than data quality.
Alongside data and totals, the response carries zone_information with the zone's name, type and sub-type, and top_visitors: the vessels crossing the boundary most often over the range, with identity, flag, ship type and visit count. top_visitors is ten entries by default, up to 50, sorted busiest first unless you ask for ASC.
date_start and date_end are required, inclusive, and yyyy-MM-dd. The range may not span more than two years. We treat a date_end in the future as today (UTC).