JSON. To receive XML, set the Accept header to
            application/xml.
            GET https://api.myshiptracking.com/api/v2/vessel
        | Parameter | Required | Type | Default | Description | 
|---|---|---|---|---|
| apikey (header) | yes | text | Your API key. Pass it via the HTTP header Authorization: Bearer YOUR_API_KEYorx-api-key. | |
| response | no | text | simple | Allowed values: simple or extended. simple: Returns basic vessel information. extended: Returns additional details. | 
| mmsi | yes (one required) | integer | 9-digit Maritime Mobile Service Identity. (Do not include if using imo.) | |
| imo | integer | 7-digit International Maritime Organization number. (Do not include if using mmsi.) | 
| Field | Type | Description | 
|---|---|---|
| vessel_name | text | Name of the vessel. | 
| mmsi | int | Maritime Mobile Service Identity. | 
| imo | int | International Maritime Organization number (if available). | 
| vtype | int | Vessel type group code according to References | 
| lat | real | Latitude in decimal degrees. | 
| lng | real | Longitude in decimal degrees. | 
| course | real | Course in degrees. | 
| speed | real | Speed in knots. | 
| nav_status | text | Navigation status according to AIS Specification | 
| received | datetime | UTC timestamp when the position was received. | 
Includes all simple fields plus:
| Field | Type | Description | 
|---|---|---|
| callsign | text | Vessel's callsign. | 
| vessel_type | text | Readable description of the vessel type. | 
| ais_type | int | AIS Ship Type according to AIS Specification | 
| size_a | int | Length from GPS antenna to the bow (meters). | 
| size_b | int | Length from GPS antenna to the stern (meters). | 
| size_c | int | Distance from GPS antenna to the port side (meters). | 
| size_d | int | Distance from GPS antenna to the starboard side (meters). | 
| draught | real | Current draught (meters) of the vessel. | 
| flag | text | Country flag code. | 
| flag_mid | text | Maritime flag identifier. | 
| gt | int | Gross Tonnage (if available). | 
| dwt | int | Deadweight (if available). | 
| built | int | Year the vessel was built (if available). | 
| destination | text | Reported destination. | 
| eta | datetime | Estimated Time of Arrival (UTC). | 
| current_port | text | Current port name (if available). | 
| current_port_id | int | Current port identifier. | 
| current_port_unloco | text | Current port UN/LOCODE. | 
| current_port_country | text | Country of the current port. | 
| current_port_arr_utc | datetime | Arrival time at current port (UTC). | 
| current_port_arr_local | datetime | Arrival time at current port (local time). | 
| last_port | text | Last port visited. | 
| last_port_id | int | Last port identifier. | 
| last_port_unloco | text | Last port UN/LOCODE. | 
| last_port_country | text | Country of the last port. | 
| last_port_dep_utc | datetime | Departure time from last port (UTC). | 
| last_port_dep_local | datetime | Departure time from last port (local time). | 
| next_port | text | Next port name. | 
| next_port_id | int | Next port identifier. | 
| next_port_unloco | text | Next port UN/LOCODE. | 
| next_port_country | text | Country of the next port. | 
| next_port_eta_utc | datetime | ETA at next port (UTC). | 
| next_port_eta_local | datetime | ETA at next port (local time). | 
| avg_sog | real | Average speed over ground. | 
| max_sog | real | Maximum speed over ground. | 
| distance_covered | real | Distance covered (nautical miles). | 
| wind_knots | real | Wind speed (knots). | 
| wind_direction | text | Wind direction. | 
| humidity | real | Humidity percentage. | 
| pressure | real | Atmospheric pressure. | 
| temperature | real | Temperature in Celsius. | 
| visibility | int | Visibility in meters. | 
All API responses follow a standardized envelope format for consistency and ease of integration.
On success (HTTP status code 200), the envelope includes:
status: "success"duration: Time taken to process the request (in seconds).timestamp: Server timestamp when the response was generated (ISO 8601 format).data: The requested resource data. For XML responses, the data is formatted according to
                the requested XML structure.On error, the envelope includes:
status: "error"duration: Time taken to process the request.timestamp: Server timestamp when the error was generated.code: Specific error code used for troubleshooting.message: Detailed error message.The response format (JSON or XML) is determined by the Accept header.
Note: When credits are charged for a request, the response includes a custom HTTP header
            X-Credit-Charged indicating the number of credits deducted.
        
{
    "status": "success",
    "duration": "0.396032677",
    "timestamp": "2025-10-31T22:48:14.585Z",
    "data": {
        "vessel_name": "BLUE STAR DELOS",
        "mmsi": 241087000,
        "imo": 9565039,
        "lat": 0,
        "lng": 0,
        "course": 182,
        "speed": 0,
        "nav_status": 0,
        "received": "2025-10-31T22:47:28Z"
    }
}{
    "status": "error",
    "duration": "0.001600648",
    "timestamp": "2025-10-31T22:48:31.240Z",
    "code": "MST_ERR_VALIDATOR",
    "message": "MMSI must be at most 999999999."
}The following error responses can be returned. Each error follows the standardized response envelope.
| Error Code | HTTP Status | Description | 
|---|---|---|
| MST_ERR_VALIDATOR | 400 | Parameter validation failed (e.g., incorrect MMSI/IMO format or out-of-range values). | 
| ERR_INVALID_IDENTIFIER | 400 | Both or neither of MMSI and IMO were provided; exactly one identifier is required. | 
| ERR_NO_KEY | 401 | No API key was provided in the request headers. | 
| ERR_INVALID_KEY | 401 | The provided API key is invalid or unrecognized. | 
| ERR_NOACCESS | 403 | The API key does not have permission to access this endpoint. | 
| ERR_NO_CREDITS | 402 | Insufficient credit balance for the requested operation. | 
| ERR_VESSEL_NOT_FOUND | 404 | No vessel was found matching the provided identifier. | 
| ERR_RATE_LIMIT | 429 | The request rate limit has been exceeded. | 
| ERR_INTERNAL | 500 | An internal server error occurred. | 
<?php
$apiKey = "YOUR_API_KEY";
$mmsi   = "241087000"; // Or use IMO by setting $imo instead
$url    = "https://api.myshiptracking.com/api/v2/vessel?mmsi={$mmsi}";
// For extended response, append: &response=extended
// $url = "https://api.myshiptracking.com/api/v2/vessel?mmsi={$mmsi}&response=extended";
$headers = [
    "Authorization: Bearer $apiKey"
    // Alternatively: "x-api-key: $apiKey"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
if(curl_errno($ch)) {
    echo 'Request Error: ' . curl_error($ch);
} else {
    echo $response;
}
curl_close($ch);
?>curl -X GET "https://api.myshiptracking.com/api/v2/vessel?mmsi=241087000" \
  -H "Authorization: Bearer YOUR_API_KEY"
# For extended response, add: &response=extendedimport requests
api_key = "YOUR_API_KEY"
mmsi    = "241087000"  # Or use IMO by modifying the URL
url     = f"https://api.myshiptracking.com/api/v2/vessel?mmsi={mmsi}"
# For extended response, append: &response=extended
# url = f"https://api.myshiptracking.com/api/v2/vessel?mmsi={mmsi}&response=extended"
headers = {
    "Authorization": f"Bearer {api_key}"
    # Alternatively: "x-api-key": api_key
}
response = requests.get(url, headers=headers)
if response.ok:
    print(response.json())
else:
    print("Error:", response.status_code, response.text)const apiKey = "YOUR_API_KEY";
const mmsi   = "241087000"; // Or use IMO by adjusting the URL
let url    = `https://api.myshiptracking.com/api/v2/vessel?mmsi=${mmsi}`;
// For extended response, append: &response=extended
// url = `https://api.myshiptracking.com/api/v2/vessel?mmsi=${mmsi}&response=extended`;
fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${apiKey}`
    // Alternatively: "x-api-key": apiKey
  }
})
.then(response => {
  if (!response.ok) {
    throw new Error("Network response was not ok");
  }
  // Check Content-Type to decide on parsing
  return response.headers.get("Content-Type").includes("application/xml")
    ? response.text()
    : response.json();
})
.then(data => console.log(data))
.catch(error => console.error("Error:", error));import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class VesselAPIExample {
    public static void main(String[] args) {
        try {
            String apiKey = "YOUR_API_KEY";
            String mmsi   = "241087000"; // Or set IMO here
            String urlString = "https://api.myshiptracking.com/api/v2/vessel?mmsi=" + mmsi;
            // For extended response, append: &response=extended
            // urlString += "&response=extended";
            URL url = new URL(urlString);
            
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            conn.setRequestProperty("Authorization", "Bearer " + apiKey);
            // Alternatively: conn.setRequestProperty("x-api-key", apiKey);
            
            int responseCode = conn.getResponseCode();
            BufferedReader in = new BufferedReader(new InputStreamReader(
                (responseCode == HttpURLConnection.HTTP_OK) ? conn.getInputStream() : conn.getErrorStream()));
            String inputLine;
            StringBuilder response = new StringBuilder();
            
            while ((inputLine = in.readLine()) != null) {
                response.append(inputLine);
            }
            in.close();
            
            System.out.println(response.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class VesselAPIExample {
    static async Task Main() {
        string apiKey = "YOUR_API_KEY";
        string mmsi   = "241087000"; // Or use IMO instead
        string url    = $"https://api.myshiptracking.com/api/v2/vessel?mmsi={mmsi}";
        // For extended response, append: &response=extended
        // url += "&response=extended";
        using (HttpClient client = new HttpClient()) {
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
            // Alternatively: client.DefaultRequestHeaders.Add("x-api-key", apiKey);
            HttpResponseMessage response = await client.GetAsync(url);
            if (response.IsSuccessStatusCode) {
                string content = await response.Content.ReadAsStringAsync();
                Console.WriteLine(content);
            } else {
                Console.WriteLine("Error: " + response.StatusCode);
            }
        }
    }
}require 'net/http'
require 'uri'
require 'json'
api_key = "YOUR_API_KEY"
mmsi    = "241087000"  # Or use IMO instead
uri     = URI("https://api.myshiptracking.com/api/v2/vessel?mmsi=#{mmsi}")
# For extended response, use:
# uri = URI("https://api.myshiptracking.com/api/v2/vessel?mmsi=#{mmsi}&response=extended")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{api_key}"
# Alternatively: request["x-api-key"] = api_key
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end
if response.is_a?(Net::HTTPSuccess)
  data = JSON.parse(response.body)
  puts data
else
  puts "Error: #{response.code} #{response.message}"
end
Your request preview will appear here...
        
            
Your response will appear here...