ListManager
Description
The ListManager method manages your list of vessels, used by the VesselsList method.
The changes are reported in the X-API-ADDED-*, X-API-DELETED-* and
X-API-REMAINING-SLOTS-* response headers (see Implementation).
Each added vessel uses one slot of your monthly limit (REMAINING_SLOTS in
Status). Deleting does not free a slot.
URL format
https://api.vesselfinder.com/listmanager
Parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
userkey | yes | text | - | Your personal API key |
imo | yes* | list of integers | - | List of IMO numbers (comma separated)** |
mmsi | yes* | list of integers | - | List of MMSI numbers (comma separated)** |
- (*) Not required for GET.
- (**) IMO numbers, MMSI numbers or both.
Code examples
# Get your list of vessels
curl -i "https://api.vesselfinder.com/listmanager?userkey=YOUR_API_KEY"
# Add vessels to the list
curl -i -X POST https://api.vesselfinder.com/listmanager \
-d "userkey=YOUR_API_KEY&imo=9175717,9228801&mmsi=227441980"
# Replace all vessels in the list
curl -i -X PUT https://api.vesselfinder.com/listmanager \
-d "userkey=YOUR_API_KEY&imo=9175717,9228801&mmsi=227441980"
# Delete vessels from the list
curl -i -X DELETE "https://api.vesselfinder.com/listmanager?userkey=YOUR_API_KEY&imo=9175717"
import requests
# Add vessels to your list (POST). Use PUT to replace the list, DELETE to remove vessels,
# GET to read it.
resp = requests.post(
"https://api.vesselfinder.com/listmanager",
data={"userkey": "YOUR_API_KEY", "imo": "9175717,9228801", "mmsi": "227441980"},
timeout=30,
)
if "X-API-ERROR" in resp.headers:
raise RuntimeError(resp.headers["X-API-ERROR"])
print("added IMO:", resp.headers.get("X-API-ADDED-IMO"))
print("added MMSI:", resp.headers.get("X-API-ADDED-MMSI"))
print("remaining slots:", resp.headers.get("X-API-REMAINING-SLOTS-NEW"))
<?php
// Add vessels to your list (POST). Use PUT to replace the list, DELETE to remove vessels,
// GET to read it.
$ch = curl_init('https://api.vesselfinder.com/listmanager');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'userkey' => 'YOUR_API_KEY',
'imo' => '9175717,9228801',
'mmsi' => '227441980',
]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => true,
]);
$response = curl_exec($ch);
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
curl_close($ch);
$headers = [];
foreach (explode("\r\n", substr($response, 0, $headerSize)) as $line) {
if (strpos($line, ':') !== false) {
[$name, $value] = explode(':', $line, 2);
$headers[strtoupper(trim($name))] = trim($value);
}
}
if (isset($headers['X-API-ERROR'])) {
throw new Exception($headers['X-API-ERROR']);
}
echo 'added IMO: ', $headers['X-API-ADDED-IMO'] ?? '', "\n";
echo 'added MMSI: ', $headers['X-API-ADDED-MMSI'] ?? '', "\n";
echo 'remaining slots: ', $headers['X-API-REMAINING-SLOTS-NEW'] ?? '', "\n";
// Node.js 18+ (save as listmanager.mjs)
// Add vessels to your list (POST). Use PUT to replace the list, DELETE to remove vessels,
// GET to read it.
const resp = await fetch('https://api.vesselfinder.com/listmanager', {
method: 'POST',
body: new URLSearchParams({ userkey: 'YOUR_API_KEY', imo: '9175717,9228801', mmsi: '227441980' }),
});
const error = resp.headers.get('X-API-ERROR');
if (error) throw new Error(error);
console.log('added IMO:', resp.headers.get('X-API-ADDED-IMO'));
console.log('added MMSI:', resp.headers.get('X-API-ADDED-MMSI'));
console.log('remaining slots:', resp.headers.get('X-API-REMAINING-SLOTS-NEW'));
package main
import (
"fmt"
"log"
"net/http"
"net/url"
)
// Add vessels to your list (POST). Use PUT to replace the list, DELETE to remove vessels,
// GET to read it.
func main() {
form := url.Values{
"userkey": {"YOUR_API_KEY"},
"imo": {"9175717,9228801"},
"mmsi": {"227441980"},
}
resp, err := http.PostForm("https://api.vesselfinder.com/listmanager", form)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
if e := resp.Header.Get("X-API-ERROR"); e != "" {
log.Fatal(e)
}
fmt.Println("added IMO:", resp.Header.Get("X-API-ADDED-IMO"))
fmt.Println("added MMSI:", resp.Header.Get("X-API-ADDED-MMSI"))
fmt.Println("remaining slots:", resp.Header.Get("X-API-REMAINING-SLOTS-NEW"))
}
Methods
GET
Get your current list of vessels’ IMO / MMSI numbers.
GET https://api.vesselfinder.com/listmanager?userkey=YOUR_API_KEY
POST
Add new vessel(s) to the list.
POST https://api.vesselfinder.com/listmanager
userkey=YOUR_API_KEY&imo=IMO1,IMO2,IMO3,IMO4&mmsi=MMSI1,MMSI2,MMSI3
PUT
Replace all vessels in your list.
PUT https://api.vesselfinder.com/listmanager
userkey=YOUR_API_KEY&imo=IMO1,IMO2,IMO3,IMO4&mmsi=MMSI1,MMSI2,MMSI3
DELETE
Delete vessel(s) from your list.
DELETE https://api.vesselfinder.com/listmanager?userkey=YOUR_API_KEY&imo=IMO1,IMO2,IMO3,IMO4&mmsi=MMSI1,MMSI2,MMSI3