Spire Messages API is a REST API allowing continual paging of AIS messages (NMEA or decoded) received using time based criteria for when data is received. IE received_after filter can be used to continually capture data from a point in time onwards.
Messages API can be filtered to only return data for a specific list of vessels by MMSI number.
Messages API is documented here: https://developers.sense.spire.com/get-started#messagesApi
You can request any AIS messages with timestamps within the past seven days from the Messages API.