# Sri Lanka Trade Data API

Source: https://srilankaexport.com/ta/developer-api/

## Sri Lanka trade data, as an API

Two free, public JSON endpoints: Sri Lanka’s annual export profile, and a daily read of what is leaving the Port of Colombo. No key, no signup, no rate card. Use them in a dashboard, a model, or a spreadsheet.

### What this is

We publish two datasets that we already maintain for our own trade desk. The annual profile is a curated aggregate of Sri Lanka’s export statistics. The live feed is built each morning from the Port of Colombo berthing program, so it tells you what is actually moving this week rather than what moved two years ago.

Both are served free of charge and require no authentication. They are rate limited at 120 requests per hour per IP, which is far more than a dashboard needs and far less than a scraper wants.

Read this before you plot anything. The live feed is port outflow: each vessel’s next port of call. Colombo is a transshipment hub, so this is not where the cargo ultimately ends up, and it is not a list of Sri Lanka’s export destinations. For actual export markets, use the annual endpoint below. We label it this way in the data too, and we would rather you got this right than got a bigger number.

### Endpoints

#### GET/wp-json/sle/v1/export-data

Sri Lanka’s annual export profile: total value, the ten largest destination markets with coordinates, and six commodity groups with their top three markets each. Refreshed annually by hand from UN Comtrade. Cached for 12 hours.

Field | What it holds |

data.year | Reporting year for every figure in the response. |

data.total_usd_m | Total exports, USD millions. |

data.markets[] | Destination markets: name, ISO code, latitude, longitude, value in USD millions. |

data.commodities[] | Commodity groups: name, value, and top three markets with their share. |

meta.attribution | Required attribution string. Carry it wherever you show the figures. |

meta.cadence | How often the underlying file changes. |

curl https://srilankaexport.com/wp-json/sle/v1/export-data

#### GET/wp-json/sle/v1/export-data/live

Container traffic leaving the Port of Colombo, rebuilt daily from the Sri Lanka Ports Authority and Colombo International Container Terminals berthing programs. Cached for 30 minutes.

Field | What it holds |

snapshot_utc | When this snapshot was built. Use this, not the HTTP date, to tell whether the data moved. |

window | The rolling window the counts cover, with its start, end and length in days. |

vessel_calls | Vessel calls in the window. |

export_containers | Containers loaded. This is the export signal. |

import_containers | Containers discharged. |

top_lines[] / top_services[] | Shipping lines and services by volume loaded. |

upcoming_departures[] | Vessels scheduled to sail, with line, service, ETA and load. |

flows[] | Volume by destination region. See the caveat above: next port of call, not final destination. |

meta.stale | True when the snapshot is over 36 hours old. Check it before you trust the numbers. |

curl https://srilankaexport.com/wp-json/sle/v1/export-data/live

### Sources, and what you owe us

The annual figures derive from UN Comtrade (United Nations Statistics Division). They are a curated aggregate, not the full dataset. The live feed comes from the Sri Lanka Ports Authority and Colombo International Container Terminals, both public and unauthenticated.

Every response carries an attribution string in meta.attribution. If you publish the figures, publish that with them. Beyond that there is no license to sign and nothing to pay.

If you are building something that needs more than this, or a longer history than the current window, tell us what you need. We keep a daily archive of the port feed that goes back further than the live endpoint exposes.

### Building something with this?

We would like to know. It costs you nothing and it tells us which data is worth maintaining.

[Tell our Trade Desk →](/contact-us/)