{
  "openapi": "3.0.1",
  "info": {
    "title": "Sea Route Distance and Shipping CO2 Emissions, Searoutes API",
    "description": "Calculate sea route distance, voyage duration and ETA between ports, plus ISO 14083 and GLEC shipping CO2e emissions per shipment, carrier CO2e on a port pair, ocean schedules with CO2e, vessel ETA, port and carrier lookup through the Searoutes API. Bring your own key.",
    "version": "0.1",
    "x-build-id": "hcQclVEx1nsWxacZe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~sea-route-distance-co2-emissions-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-sea-route-distance-co2-emissions-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nabeelbaghoor~sea-route-distance-co2-emissions-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-sea-route-distance-co2-emissions-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nabeelbaghoor~sea-route-distance-co2-emissions-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-sea-route-distance-co2-emissions-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to get",
            "enum": [
              "seaRoute",
              "shipmentEmissions",
              "carrierEmissions",
              "oceanSchedules",
              "vesselEta",
              "portSearch",
              "carrierSearch"
            ],
            "type": "string",
            "description": "Sea route distance and ETA: GET /route/v2/sea, one row per route with distance in km and nautical miles, duration, ETA, crossed canals and straits, ECA (SECA) and high risk area distance. Shipment CO2e emissions: POST /shipment/v2/report/co2 (ISO 14083, GLEC), one row per shipment. Carrier port pair CO2e: GET /co2/v2/plan, one row of statistics per port pair. Ocean schedules with CO2e: GET /itinerary/v2/execution, one row per upcoming sailing. Vessel ETA: GET /vessel/v2/{imo}/eta. Port search and Carrier search: reference lookups. Each lookup is one call on your Searoutes plan.",
            "default": "seaRoute"
          },
          "routes": {
            "title": "Routes or port pairs",
            "type": "array",
            "description": "Sea route, shipment, carrier and schedule modes. One route per line as UN/LOCODEs or lon,lat pairs separated by \";\", such as CNSHA;NLRTM, SGSIN;USLAX or 121.8,31.2;4.0,51.9. Sea routes take up to 20 stops; shipments turn each pair of stops into a sea leg; carrier and schedule modes take exactly two UN/LOCODEs.",
            "items": {
              "type": "string"
            }
          },
          "detailedPlan": {
            "title": "Detailed route plan with waypoints",
            "type": "boolean",
            "description": "Sea route only. Uses GET /route/v2/sea/{locations}/plan, which adds the waypoints (canal, strait and voyage entries and exits with times and distances) to each route.",
            "default": false
          },
          "includeGeometry": {
            "title": "Include route geometry",
            "type": "boolean",
            "description": "Sea route only. Adds the GeoJSON LineString of the route to each row, ready for a map. Off by default to keep rows small.",
            "default": false
          },
          "vesselImo": {
            "title": "Vessel IMO",
            "type": "string",
            "description": "Sea route and shipment modes, optional. The 7 digit IMO number of the vessel, such as 9776418. Routes then use its draft and speed; shipment emissions use its own profile and fuel."
          },
          "speedKnots": {
            "title": "Speed (knots)",
            "minimum": 1,
            "maximum": 40,
            "type": "number",
            "description": "Sea route only, optional. Vessel speed in knots (sent as speedInKts), used for the duration and ETA."
          },
          "vesselDraft": {
            "title": "Vessel draft (m)",
            "minimum": 1,
            "maximum": 30,
            "type": "number",
            "description": "Sea route only, optional. Vessel draft in meters, so shallow passages are avoided."
          },
          "departureDate": {
            "title": "Departure date",
            "type": "string",
            "description": "Sea route and shipment modes, optional. YYYY-MM-DD. Sea routes return the ETA from this departure; shipments send it as the first leg departure date."
          },
          "avoidSeca": {
            "title": "Avoid ECA (SECA) zones",
            "type": "boolean",
            "description": "Sea route only. Routes around sulphur emission control areas where possible (avoidSeca).",
            "default": false
          },
          "avoidHighRiskAreas": {
            "title": "Avoid high risk areas",
            "type": "boolean",
            "description": "Sea route only. Routes around piracy high risk areas (avoidHRA).",
            "default": false
          },
          "allowIceAreas": {
            "title": "Allow ice areas",
            "type": "boolean",
            "description": "Sea route only. Allows routes through ice areas such as the Northern Sea Route and the Bering Sea (allowIceAreas).",
            "default": false
          },
          "blockAreas": {
            "title": "Block canals and straits",
            "type": "array",
            "description": "Sea route only. Canals and straits the route must not pass, such as the Suez Canal or the Panama Canal (blockAreas). Useful for Red Sea and Cape of Good Hope diversions.",
            "items": {
              "type": "string",
              "enum": [
                "11100",
                "11101",
                "11103",
                "11112",
                "11115",
                "11117",
                "11122",
                "11127",
                "11128",
                "11129",
                "11133",
                "11135",
                "11136",
                "11137",
                "11142",
                "11150",
                "11169",
                "11173",
                "11240"
              ],
              "enumTitles": [
                "Gibraltar (11100)",
                "Kiel Canal (11101)",
                "Magellan Strait (11103)",
                "Panama Canal (11112)",
                "NE Passage (11115)",
                "Suez Canal (11117)",
                "Irish Sea (11122)",
                "Cape Horn (11127)",
                "Bosporus (11128)",
                "Dardanelles Strait (11129)",
                "Dover Strait (11133)",
                "Malacca Strait (11135)",
                "Cape Good Hope (11136)",
                "Singapore Strait (11137)",
                "Lombok Strait (11142)",
                "Taiwan Strait (11150)",
                "Florida Strait (11169)",
                "Torres Strait (11173)",
                "NW Passage (11240)"
              ]
            }
          },
          "carrier": {
            "title": "Carrier SCAC",
            "type": "string",
            "description": "Shipment, carrier and schedule modes. The carrier SCAC, such as CMDU, MSCU or MAEU (or a Searoutes carrier ID for carrier and schedule modes). Required for carrier and schedule modes; the Carrier search mode finds it from a name."
          },
          "orderType": {
            "title": "Order type",
            "enum": [
              "FCL",
              "LCL",
              "parcel",
              "bulk",
              "breakbulk"
            ],
            "type": "string",
            "description": "Shipment only. FCL needs the number of containers; every other type needs the cargo weight.",
            "default": "FCL"
          },
          "containerCount": {
            "title": "Number of containers",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Shipment, carrier and schedule modes. Number of containers shipped (nContainers).",
            "default": 1
          },
          "containerSizeTypeCode": {
            "title": "Container type",
            "enum": [
              "20GP",
              "20NOR",
              "22G1",
              "2200",
              "22G0",
              "2202",
              "2210",
              "40GP",
              "40NOR",
              "42G1",
              "42G0",
              "40G1",
              "40HC",
              "45G1",
              "45G0",
              "4500",
              "4510",
              "40HCNOR",
              "22R1",
              "2231",
              "42R1",
              "4531",
              "40RF",
              "40REHC",
              "45R1",
              "45R8",
              "LNR1",
              "45RH",
              "53GP",
              "L5G1",
              "45HC"
            ],
            "type": "string",
            "description": "Shipment, carrier and schedule modes, optional. ISO container size type code such as 20GP, 40GP, 40HC or 45R1 (reefer). Searoutes defaults to 20GP."
          },
          "cargoWeightKg": {
            "title": "Cargo weight (kg)",
            "minimum": 0.001,
            "type": "number",
            "description": "Shipment, carrier and schedule modes. Weight of the goods in kilograms. Required for LCL, parcel, bulk and breakbulk shipments."
          },
          "fuelType": {
            "title": "Fuel type",
            "enum": [
              "HFO",
              "VLSFO",
              "ULSFO",
              "MDO",
              "MGO",
              "LNG",
              "BIOLNG",
              "LSMGO",
              "METHANOL",
              "BIOMETHANOL",
              "IFO380",
              "LNG_CMACGM_VAS",
              "UCO",
              "METHANOL_COAL",
              "METHANOL_GAS",
              "METHANOL_RENEWABLES"
            ],
            "type": "string",
            "description": "Shipment only, optional. Sea fuel such as VLSFO, LNG, BIOLNG or METHANOL for fuel switch scenarios. Searoutes applies it only when the vessel IMO is set; without it the vessel's least green fuel is assumed."
          },
          "generateCertificate": {
            "title": "Generate PDF certificate",
            "type": "boolean",
            "description": "Shipment only. Asks Searoutes for a PDF emissions certificate per shipment; its link is returned as certificateUrl.",
            "default": false
          },
          "scheduleFromDate": {
            "title": "Sailing from date",
            "type": "string",
            "description": "Ocean schedules only, optional. Earliest sailing date, YYYY-MM-DD."
          },
          "scheduleToDate": {
            "title": "Sailing to date",
            "type": "string",
            "description": "Ocean schedules only, optional. Latest sailing date, YYYY-MM-DD."
          },
          "sortBy": {
            "title": "Sort schedules by",
            "enum": [
              "CO2",
              "TRANSIT_TIME"
            ],
            "type": "string",
            "description": "Ocean schedules only, optional. Searoutes sorts by CO2e when not set."
          },
          "imos": {
            "title": "Vessel IMO numbers",
            "type": "array",
            "description": "Vessel ETA only. One 7 digit IMO number per line. Returns the last AIS position, speed, destination and the ETA from AIS and from the predicted route.",
            "items": {
              "type": "string"
            }
          },
          "portQueries": {
            "title": "Ports",
            "type": "array",
            "description": "Port search only. One port name or UN/LOCODE per line, such as Rotterdam or NLRTM. A UN/LOCODE in capitals is an exact lookup.",
            "items": {
              "type": "string"
            }
          },
          "portSizes": {
            "title": "Port sizes",
            "type": "array",
            "description": "Port search only, optional. Keeps ports of these sizes.",
            "items": {
              "type": "string",
              "enum": [
                "large",
                "medium",
                "small",
                "tiny"
              ],
              "enumTitles": [
                "Large",
                "Medium",
                "Small",
                "Tiny"
              ]
            }
          },
          "countryCodes": {
            "title": "Country codes",
            "type": "array",
            "description": "Port search only, optional. Two letter ISO country codes to keep, such as NL or SG.",
            "items": {
              "type": "string"
            }
          },
          "excludeCountryCodes": {
            "title": "Excluded country codes",
            "type": "array",
            "description": "Port search only, optional. Two letter ISO country codes to leave out.",
            "items": {
              "type": "string"
            }
          },
          "carriers": {
            "title": "Carriers",
            "type": "array",
            "description": "Carrier search only. One carrier name, partial name or 4 letter SCAC per line, such as Maersk, CMA CGM or MSCU.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Pacing for calls to api.searoutes.com. Your Searoutes usage plan sets the real ceiling.",
            "default": 60
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own Searoutes API key. Stored as a secret and sent only to api.searoutes.com in the x-api-key header; it is never logged. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}