A Node.js/TypeScript API for retrieving real-time positions of vessels and aircraft from various sources, including MarineTraffic (AIS) and ADS-B Exchange.
git clone https://github.com/transparency-everywhere/position-api.git
cd position-api
npm installCopy the environment template and adjust as needed:
cp .env.template .envnpm run buildDevelopment mode (with auto-reload):
npm run devProduction mode:
npm startGET /ais/mt/:mmsi/location/latestGET /adsb/adsbe/:icao/location/latest/legacy/getLastPositionFromVF/:mmsi/legacy/getLastPositionFromMT/:mmsi/legacy/getLastPosition/:mmsi/legacy/getVesselsInArea/:area/legacy/getVesselsNearMe/:lat/:lng/:distance/legacy/getVesselsInPort/:shipPortnpm run lintnpm run prettiernpm testPull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
Powered by Node.js, Express, Puppeteer, and TypeScript. curl http://localhost:5000/legacy/getVesselsInArea/WMED,EMED
curl http://localhost:5000/legacy/getVesselsNearMe/37.7749/-122.4194/10
curl http://localhost:5000/legacy/getVesselsInPort/Hamburg
---
## Notes
- All endpoints return JSON.
- Replace `localhost:5000` with your server's address and port if different.
- Pull requests and issues are welcome!
---
## Notes
- All endpoints return JSON.
- Replace `localhost:5000` with your server's address and port if different.
- Pull requests and issues are welcome!
---
- **Get latest location by ICAO**
GET /adsb/adsbe/:icao/location/latest **Example:** curl
http://localhost:5000/adsb/adsbe/abc123/location/latest
```
Get last position from MST (replaces VF)
GET /legacy/getLastPositionFromVF/:mmsi
Example:
curl http://localhost:5000/legacy/getLastPositionFromVF/211879870Get last position from Marinetraffic
GET /legacy/getLastPositionFromMT/:mmsi
Example:
curl http://localhost:5000/legacy/getLastPositionFromMT/211879870Get last position (default)
GET /legacy/getLastPosition/:mmsi
Example:
curl http://localhost:5000/legacy/getLastPosition/211879870Get vessels in area
GET /legacy/getVesselsInArea/:area
:area is a comma-separated list,
e.g. WMED,EMED Example:curl http://localhost:5000/legacy/getVesselsInArea/WMED,EMEDGet vessels near me
GET /legacy/getVesselsNearMe/:lat/:lng/:distance
Example:
curl http://localhost:5000/legacy/getVesselsNearMe/37.7749/-122.4194/10Get vessels in port
GET /legacy/getVesselsInPort/:shipPort
Example:
curl http://localhost:5000/legacy/getVesselsInPort/Hamburglocalhost:5000 with your server’s address and
port if different.