Freightos provides instant accurate shipping quotes for air and ocean freight worldwide. This page describes the various ways you can access this data programmatically by API (sometimes called EDI).

Uses include:

  • Freight forwarders securely accessing their own buy or sell rates.
  • E-commerce web sites providing buyers with a shipping estimate (to help buyers arrange their own shipping)
  • E-commerce web sites providing shipping as a service which is added to the shopping cart and then arranged by the vendor
All use of APIs is subject to the Freightos terms of service.

Shipping Estimates API for marketplace

Freightos has a single API at /api/shippingCalculator for obtaining quotes and/or a summary of quote estimates. The API supports GET using simple URL parameters, or POST of an XML for more sophisticated quote requests.

It may be accessed at https://ship.freightos.com/api/shippingCalculator for public marketplace rates or at https://yourCustomFreightosSite.freightos.com/api/shippingCalculator using an appropriate secure API key for private rates from Custom Sites.

GET public quote estimates from the Freighots marketplace

Here are some live links to GET freight estimates from the Freightos marketplace. No API key is required to get this price range data, but you must use this data in accordance with Freightos terms of service including a clearly visible credit for Freightos and link to https://ship.freightos.com.

GET public rate estimates with JSON response example: door-to-door boxes

GET public rate estimates with XML response example: port-to-port container

XML/JSON responses for price estimates from the marketplace

<?xml version="1.0" encoding="UTF-8"?><response>
  <!--© Tradeos Ltd ("Freightos"), all rights reserved 
  except those explicitly granted in the publically posted 
  terms of service. This API is in beta.-->
  <estimatedFreightRates numQuotes="1">
  <mode mode="FCL">
    <price>
        <min>
          <moneyAmount amount="3262" currency="USD"/>
        </min>
        <max>
          <moneyAmount amount="3554" currency="USD"/>
        </max>
      </price>
    <transitTimes unit="days">
        <min>17</min>
        <max>21</max>
      </transitTimes>
  </mode>
</estimatedFreightRates>
</response>
					
{"response": {
    "estimatedFreightRates": {
        "numQuotes": "1",
        "mode": {
            "price": {
                "min": {"moneyAmount": {
                    "amount": "3262",
                    "currency": "USD"
                }},
                "max": {"moneyAmount": {
                    "amount": "3554",
                    "currency": "USD"
                }}
            },
            "transitTimes": {
                "min": "17",
                "unit": "days",
                "max": "21"
            },
            "mode": "FCL"
        }
    }
}}
					

XML public estimator quote requests

The XML POST provides more options in the quote request compared to the GET


Generate your own XML Quote Request

Private quote requests from your Custom Site

This section is only for Freightos SaaS subscribers with their own site yourCustomDomain.freightos.com.

Obtaining an API key

Business admins with their own Freightos Custom Site may obtain an API key and manage API keys here.

Keep your API key safe and attach it to API GET and POST requests using the key parameter. Always submit over HTTPS only. If you feel your API key could have been compromised, immediately ask your business admin to revoke it and create a new one.

Shipping quotes API for Custom Sites

Private GET request

GET: JSON Response Example (add your API key)

HTTP://ship.freightos.com/api/shippingCalculator?loadtype=boxes&weight=200&width=50&length=50&height=50&origin=PVG&quantity=2&destination=JFK&apiKey=

GET: XML Response Example (add your API key)

HTTP://ship.freightos.com/api/shippingCalculator?loadtype=boxes&weight=200&width=50&length=50&height=50&origin=PVG&quantity=2&destination=JFK&apiKey=

Limitations of the GET

For now GET does not support accessorials, future pickup dates etc.

XML POST request

XML schema for quote request

XML quote request generator

You can also use the XML quote request generator tool to create valid XML quote requests using the familiar Freightos quote request web user interface.

Test XML Post quote request


Generate your own XML sample

Parameters Details

Parameter Name Type Description More Infor
request String Body string parameters that represents the quote request xml Quote request xml string should be validated by the QuoteRequest XML Schema. or can be generated using the tool at
https://yourdomain.freightos.com/#!freightTrade/FreightRFQOnBehalfOfCustomerXMLer/new
apiKey String apiKey used for authentication A key that can be generated to grant access for the API

XML response

Errors

If the call is successful but there are some error messages or warnings, these will be placed in an <errors> element immediately within the <response> e.g.

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <quotes number="0"/>
    <errors>Some services have per-unit fees - to see more quotes please specify the exact load (not just the total weight and volume).
    </errors>
</response>
				

JSON response

Shipping estimates widget

The shipping estimate widget allows buyers on your e-commerce site to get an estimate for shipping the goods to buyer's own location. A couple of lines in your web page, next to each product, tell Freightos the dimensions of the product, and where it is shipped from, and Freightos does the rest.

Custom HTML element for button and popup

The custom html element is the simplest way

Place the following once anywhere in your page, can be at the end (if you already have JQuery 1.11 or better, skip that line).

<script src="https://maps.googleapis.com/maps/api/js?&signed_in=true&libraries=places&key=[googleServerApiKey]"></script>
<script src="https://ship.freightos.com/js/jquery-1.11.1.min.js"></script>
<script src="https://ship.freightos.com/api1/freightosShippingCalculator.js"></script>

For default styling, place the following in <head>:

<link rel="stylesheet" href="https://ship.freightos.com/api1/shippingCalculatorHostPage.css"/>

Place this after each product which should have a shipping calculator button, adding XML attributes instead of URL parameters.

<freightos:shippingCalculatorButton parameters></freightos:shippingCalculatorButton>
Here it is on this page:

IFrame

Another way to embed shipping estimates is via an iframe. In the following example a button opens a popup which contains the following code for estimating shipping from Shanghai, China to the user's location

<iframe class="freightosShippingWidget" frameborder="0" src="HTTP://ship.freightos.com/api1/shippingCalculatorWidgetForIFrame.jsp?loadtype=boxes&weight=200&volume=50&origin=Shanghai,China&quantity=2">

E-commerce integration

Magento - coming soon


URL and custom XML element parameters

URL Parameters used in estimator and calculator GET (Case sensitive)

estimateSet to true for a super-fast rate estimate with coverage of most of the world
currencyUsed only with estimate=true. Set to a three letter currency code like CNY, GBP. Default is USD.
originAny address recognized by Google maps / three letter airport code / 5 letter UN seaport code (for FOB). Required.
destinationAny address recognized by Google maps e.g. a zip code "10002" or street address / three letter IATA airport code / 5 letter UN seaport code. Optional - if omitted, Freightos will use GEO-IP to use a city near the caller as destination (useful for e-commerce).
weightWeight per load unit (or total weight if no quantity specified). Double. Optional for containers, otherwise required.
widthWidth in cm. Optional for containers, for standardized pallets, or if volume is specified. Otherwise required.
lengthLength. See not below on lengths. Optional for containers, for standardized pallets, or if volume is specified. Otherwise required.
heightHeight in cm. Optional for containers, or if volume is specified. Otherwise required.
volumeVolume in CBM. Optional for containers, or if w, l, h, all specified (also for a standardized pallet if h specified). Otherwise required.
quantityNumber of load units. Integer. Optional, default 1.
hazardCodeIf hazardous, specify the 4-digit UN Number, or multiple comma-separated UN Numbers (or can use hazardCode=xxxx if hazardous but unknown code)
modeRestrict searches to a specific mode. Values: air, LCL, FCL, LTL, FTL, express. Optional. Note that full containers will automatically only match FTL and FCL.
formatxmlorjson. Default is JSON for GET and XML for POST.
priceLevelFor custom sites only, the Price Level defined by pricing managers here.
resultSetall (default) or cheapestEachMode. cheapestEachMode is recommended - only with this option do you received binding quote with a quote ID and URL
saveThisQuotesaves a specific quote to your site and equires resultSet=cheapestEachMode and mode=(e.g LTL) to be included in the request params.
rFQType NETWORK for marketplace rates (this is the only option on ship.freightos.com)
ON_BEHALF_OF_CUSTOMER for private sell rates on Custom Sites
BUY_PRICE_LOOK_UP to look up buy rates on a Custom Site
BUY_FROM_TENANT To look up web site ready sell rates on a Custom Site.
apiKeyValid API Key. Keep your API key safe and never embed it in any way in your web site/client. Send over HTTPS only. Required for Calculator, optional for Estimator.
loadtype
CodeDescriptionAvailable for use in marketplace
boxesAvailable
crateAvailable
envelopeAvailable
palletsAvailable
pallet_EUR1Unavailable
pallet_EUR2Unavailable
pallet_48_40Unavailable
container2020'Available
container4040'Available
container4545'Available
container40HC40'HCAvailable
container45HC45'HCAvailable
roRoUnavailable
breakBulkUnavailable
container20FR20'FRUnavailable
container40FR40'FRUnavailable
container20Refrigerated20'RUnavailable
container40Refrigerated40'RUnavailable
container40HCRefrigerated40'HC RUnavailable
container45HCRefrigerated45'HC RUnavailable
container20NORefrigerated20'NORUnavailable
container40NORefrigerated40'NORUnavailable
container40HCNORefrigerated40'HC NORUnavailable
container20IsoTank20' TankUnavailable
container40IsoTank40' TankUnavailable
container20OpenTop20'OTUnavailable
container40OpenTop40'OTUnavailable
container40HCOpenTop40'HC OTUnavailable
container4848'Unavailable
container5353'Unavailable
LD1LD1Unavailable
LD2LD2Unavailable
LD3LD3Unavailable
LD5LD5Unavailable
LD6LD6Unavailable
LD7LD7Unavailable
LD8LD8Unavailable
LD9LD9Unavailable
LD11LD11Unavailable
M1M1Unavailable
DrumUnavailable
RollUnavailable
displayoriginThe origin to show the customer. E.g. origin might be a specific address in Shanghai, China, while displayorigin can be "China". Optional - defaults to origin. Blank to show no origin. For Widget only

General

  • Numbers always use . as a decimal point and never contain any comma ,
  • Lengths are by default in centimeters cm. You may append any of [cm, inch, m, km, mile] e.g. width=30inch.
  • Volumes are by default in cubic centimeters (ccm also known as cc or ml). You may append any of [ccm, liter, cbm, cft, cbi, wm] e.g. width=30inch.
  • Weights are by default in kilograms kg. You may append any of [kg, ton, lb, oz, wm] e.g. width=30inch.

Quotas

Any given IP address may only call any Freightos API 100 times in any hour. Contact Freightos if you need a higher quota.